Billing
Learn how customer plans, Checkout, and the webhook fit together.
Billing in the repository is Stripe for your customers. It is not the charge for the pack. AgenticPacks Pro is $149 once, paid through Creem, and that payment is what invites you to the private repository. The prices on this page are the ones your customers pay inside the app you ship.
This page covers the plans, where Checkout is created, and which webhook events the app handles.
Plans
OSS has two plans.
| Plan | Price | Credits |
|---|---|---|
| Free | $0 | 100 |
| Hobby | $19 a month | 500 |
The source still names the $19 plan Pro. Public copy, and this page, call it Hobby, because that is the plan your customer sees.
Checkout
Checkout is created on the server with price_data. There is no publishable key, no Stripe.js, and no Dashboard Price ID to paste into the env file. An empty STRIPE_SECRET_KEY is valid in local development: the app boots, and Checkout stays off.
The webhook lives at POST /api/webhooks/stripe, with an alias at POST /api/stripe/webhook. Events the handler understands are checkout.session.completed, invoice.payment_succeeded, customer.subscription.updated, and customer.subscription.deleted. Cancelling in the customer portal takes effect immediately.
STRIPE_APP_ID is written onto the Checkout session and the subscription. A delivered event whose appId does not match this installation returns 200 and does not change the plan or the credits. The event id is stored in StripeEvent in the same transaction as the plan update, so a retry is a no-op.
Plans
Pro has three plans your customers can buy.
| Plan | Price | What it adds |
|---|---|---|
| Hobby | $19 a month | The paid individual plan |
| Plus | $49 a month | The source still names this plan Pro |
| Team | $99 a month | Creating a team workspace |
The $149 pack license is not one of these rows.
Checkout and the portal
Checkout builds the price in code. There is no Price ID to create in the Dashboard. The customer portal is where a customer changes or cancels a plan. Set its return URL to https://yourdomain.com/dashboard/billing.
Webhook
The endpoint is POST /api/webhooks/stripe. Point it at the public origin, including an sslip.io host if you do not have a domain yet.
The handler acts on five events:
checkout.session.completedsaves the first subscription and grants its credits onceinvoice.payment_succeededreplaces the balance on a renewal, or adds the new allowance after a paid upgradecustomer.subscription.updatedapplies a plan change. A cancellation scheduled for the period end leaves the current plan in place until thencustomer.subscription.deletedmoves the saved subscription to the free tier when it actually endsinvoice.payment_failedsets the balance to the current plan allowance and blocks spending
STRIPE_APP_ID is copied onto the session and the subscription. An event for a different appId returns 200 with no database change. The Stripe event id is stored with the plan update, so Stripe retries do not grant credits twice.
Where to go next
How a reply spends those credits is covered in Chat and credits.
