Build a prepaid credit model end-to-end in Chargebee
Customers buy a balance of credits and spend it as they work. You get predictable, upfront revenue and a real-time view of what every account is consuming, with nothing leaking out unbilled. Here’s how to build it in Chargebee.
A spending budget for them. Cash up front for you.
A credit is one unit of value in your product: a build, a generation, or a run. Every action your customer takes debits the balance instantly, so the running total is always accurate.
At the start of each cycle, Chargebee grants a fresh balance. Unused credits roll forward to a set cap and then expire, and a top-up refills the pool whenever it runs low.
- Customers want a spending ceiling they control, not an open-ended usage bill
- A single action maps cleanly to one credit you can price and meter
- Your per-action cost varies enough that flat seat pricing leaks margin
- You want the cash before the usage, recognised as the balance is drawn down
Here’s what you need
Three objects in the Chargebee catalog. Define them once and they carry the credit model through every deal and renewal.
The subscription tier the customer commits to, billed on a recurring cycle. The plan carries the monthly credit grant as a default that every new subscription inherits.
One value metric: ai_credits. Every grant, debit, and top-up is denominated in it. The grant quantity and the rollover policy both attach here: unused credits carry forward one cycle, then expire.
An add-on that grants extra credits beyond the plan, sold two ways: a one-time pack billed at purchase, or a recurring pack that grants credits every cycle. Customers add capacity without renegotiating the plan.
Price the credit unit once. Every subscription inherits it.
Lovable sells AI-assisted product building as a monthly credit subscription. The unit, ai_credits, gets defined once in Chargebee's Product Catalog. Grant quantity, rollover policy, and validity window all live there. When a new subscription activates, those defaults are already set.
The grant configuration is where Chargebee knows how many credits to issue, when, and what to do with the balance at cycle end. Set it once on the plan and every new subscription inherits it automatically.
Three things define the grant: the quantity issued, the frequency it issues on, and how the balance is treated at the edges of each cycle. Quantity and frequency are simple values. The two edge cases, unused credits and exhausted credits, are where the commercial model takes shape. Both are covered below.
Leftover credits don’t have to disappear. The rollover policy on the grant decides how much of an unused balance carries into the next cycle. Four modes cover the common models.
Unused credits expire at the end of the cycle. A clean slate every period.
Carry forward up to a set maximum, e.g. 25% of the grant. Anything above the cap expires.
Every unused credit carries forward with no cap. Best for enterprise commit models.
Credits carry forward but expire after a fixed window, here one cycle. Used in this recipe, mirroring Lovable.
By default, usage stops the moment the balance hits zero. If a hard stop isn't what you want, the model branches two ways. Both are off unless you switch them on.
Let the balance go negative up to a limit you define, so usage keeps flowing into an overdraft buffer that is settled against the next grant or invoice.
Attach an overage rate to the plan. Once credits run out, further usage is metered and billed at the agreed per-unit price at cycle end.
Sell credits in whatever motion you already run. Self-serve or sales-led.
Customers can buy credits in whatever motion fits your GTM: self-serve through PLG checkout, or sales-led through a quote and subscription in Chargebee CPQ. Either way, the credit grant sits on the same plan, so the contract states exactly what the customer is buying. For accounts that negotiate higher volume, the default grant can be overridden on that quote or subscription without any custom code or manual workflows.
The grant override applies to this subscription only. The plan default of 50,000 credits is unchanged for all other customers.
Every action draws down the balance. Chargebee keeps the count.
Your product fires a usage event. Chargebee writes it as an immutable operation: a debit, a hold, a grant, or a rollover. Every entry has a unique ID and is never overwritten. Corrections happen via offsetting entries, not edits.
The same ledger your billing team uses for reconciliation is the one you surface to your customers as their own credit history.
Audit trail
Every grant, debit, hold, rollover, and expiry is recorded. The ledger never overwrites. Corrections happen via offsetting credits, not edits.
Hold and authorize
Reserve credits before a long-running job starts. Capture or release when the job finishes. No double-spend race conditions.
In-product usage dashboards
The same ledger data powers the credit history your customers see. Pull it via API and render it directly in your product UI.
Rollover visibility
Rolled credits appear as a distinct operation type, so customers can see exactly what carried forward from the previous cycle.
Tell the customer the balance is running low. Before it hits zero, not after.
Set a threshold on the credit unit. When any subscription crosses it, Chargebee fires credit_balance_low, giving you a precise moment to act. Route it to your product to soft-gate new jobs, to your sales team for an upsell conversation, or to both simultaneously. You catch it early. Your customer never hits a wall.
- Unit
- ai_credits
- Trigger
- Balance falls below threshold
- Threshold
- 5,000 credits
- Applies to
- All subscriptions on this unit
- Fires event
- credit_balance_low
- BrightPath
- Fenix Labs
- + 1,202 more
- Acme AI Corp
- Stackrise
- Cloudbase
Give customers a live, accurate view of every credit
Chargebee's credit API returns available balance, grant history, and ledger operations in real time. Pull it into your product and surface what your customer actually needs: credits left, credits rolled from last cycle, and when the next grant lands. Customers who can see where they stand don't dispute invoices.
What your customer sees inside your product
Live balance, no polling
Available balance, grants, and ledger operations are all readable via API. Render them on every page load, with no background sync jobs needed.
Full credit history for customers
The same ledger that powers your billing team’s audit view can power your customer’s credit history page. Grants, rollovers, and debits, all in one feed.
Upsell surface built in
Low balance triggers the alert. Your product layer surfaces the buy-more CTA. The top-up checkout is Chargebee-hosted, with zero integration work.
You can give your customers this same drill-down inside your product by reading it back from Chargebee's credit APIs, with no separate metering pipeline to build.
The plan renews the balance.
Top-ups bill on purchase. One invoice.
At renewal, the plan charge is unchanged. Top-up packs, whether one-time or recurring, appear as their own line items. The next credit grant issues automatically on the new term. Chargebee handles all three without any intervention on your end.
At cycle end, unused credits are evaluated against the rollover policy. They carry forward for one cycle as a rollover operation, and any still unused after that window appear as an expiry operation on the ledger, visible to you and your customers.
Immediate revenue and deeper customer relationships.
Prepaid credits mean customers buy upfront and stay engaged with their balance. Chargebee runs the grants, rollovers, expirations, and ledger automatically so your team ships the product, not the billing infrastructure. Customers stay in your app. You capture revenue from every cycle.


