Add billing with
Encore
Built for Encore
Billing that fits your stack
Encore's //encore:api annotations define billing endpoints with zero boilerplate. Secrets are injected at runtime — no .env files. Deploy billing to your own cloud with one command.
package billingimport ("context"commet "github.com/commet-labs/commet-go")type SubscribeParams struct {Email string `json:"email"`CustomerID string `json:"customer_id"`}type SubscribeResponse struct {CheckoutURL string `json:"checkout_url"`}//encore:api public method=POST path=/billing/subscribefunc Subscribe(ctx context.Context, req *SubscribeParams) (*SubscribeResponse, error) {client.Customers.Create(ctx, &commet.CreateCustomerParams{Email: req.Email,ID: req.CustomerID,})sub, err := client.Subscriptions.Create(ctx, &commet.CreateSubscriptionParams{CustomerID: req.CustomerID,PlanCode: "pro",})if err != nil {return nil, err}return &SubscribeResponse{CheckoutURL: sub.Data["checkout_url"].(string),}, nil}
Get started
Install in seconds
Add billing to your Encore app with the Commet SDK. Type-safe API endpoints with built-in secrets management and cloud deployment.
go get github.com/commet-labs/commet-go
Frequently Asked Questions
Install the Commet SDK, add your API key, and start billing. Follow the Encore integration guide for a step-by-step walkthrough with code examples.
Commet supports metered (pay for what you use), credits (block when exhausted), balance (spend across features), seats (per-user pricing), and boolean (feature gating). Learn more in the consumption models guide.
Yes. Call the usage tracking method whenever a billable event happens. Commet aggregates usage and bills it at the end of each billing period. Works for API calls, AI tokens, storage, or any custom metric. See the usage tracking guide for details.
Yes. Commet has a built-in AI model catalog with per-token pricing. You can track input, output, and cache tokens with configurable margins. See the AI token billing guide for setup instructions.
Yes. Commet is a Merchant of Record that handles taxes, compliance, refunds, and payouts. Stripe Tax is integrated for automatic tax calculation. Read more about the Merchant of Record model.
Commet has no setup fees and no monthly minimums. You only pay 4.5% + $0.40 per successful transaction. You can start building and testing for free using the sandbox environment. See pricing for details.
Start billing in minutes
No setup fees. No monthly minimums. 4.5% + $0.40 per successful transaction.
Start billing for free