How to sell prepaid API credits in a SaaS
To sell prepaid API credits, define one billable unit, sell it in fixed packs that customers pay for up front, record every purchase and every use in a ledger, and block or charge overage when the balance hits zero. Your billing provider handles the payment and, if you want, the balance itself: Stripe does this with credit grants on metered prices, and Polar with its Meter Credits benefit.
This guide covers the decisions in order, then the setup on Stripe and Polar, and ends with a worked example. Vendor behavior was checked against their docs on 27 November 2026.
Why prepaid credits instead of a monthly usage bill
Pure pay-as-you-go is fair, but the customer only learns the cost when the invoice arrives. Polar's credits page puts it plainly: an invoice "four times larger than last month's makes any product feel volatile, even when the underlying behavior is correct." Prepaid credits fix the predictability problem for the buyer and the cash-flow problem for you, since the money arrives before the compute bill.
They fit best when usage per customer varies a lot, when you pay a supplier per call (an LLM API, SMS, enrichment data), or when the buyer has a fixed budget. If most customers use roughly the same amount each month, a flat plan is simpler. The trade-offs are covered in usage-based vs seat-based pricing for AI products.
Step-by-step setup
-
Pick the unit. Either sell money (a 50 USD balance drawn down at list rates) or sell abstract credits (5,000 credits, where one image costs 10 and one text call costs 1). Money is easier to explain and to account for. Abstract credits let you change the cost of each action later without touching pack prices, but customers then have to learn an exchange rate.
-
Price the packs from your own unit cost. Take your cost per unit (supplier price plus a share of hosting), set a margin you can live with at the smallest pack, and give larger packs a modest discount. Keep it to three packs at most so the pricing page stays readable; how to write a pricing page for a new SaaS has the layout.
-
Decide what happens at zero. You have two choices: stop serving requests until the customer tops up, or keep serving and bill the overage at a metered rate. Stopping is safer for small customers who chose prepaid because they fear a large bill. Overage is better for teams running production traffic who cannot afford an outage.
-
Set the expiry rule before launch. Credits that never expire are the friendliest option, but they leave an open liability on your books indefinitely. A common middle ground is a long expiry (12 months) for purchased credits and a short one for free or promotional credits. Write the rule on the pricing page and the receipt.
-
Keep a ledger, even if the provider keeps one too. One row per event: purchase, use, expiry, refund, manual adjustment. Compute the balance as the sum of the rows instead of storing one number and overwriting it. With the rows in hand you can answer "where did my credits go?" from a support ticket in a minute.
-
Check the balance on every request. Waiting until invoice time means a customer can run far past what they paid for. Your API should read the remaining balance (from your ledger or the provider's API), reject or flag the call when it is exhausted, and record the usage event after the call succeeds. The same request path is where per-customer limits live; see how to cap AI API costs in a SaaS.
-
Warn before the balance runs out. Email at 20% remaining and again at zero. Offer auto top-up (charge the saved card for the same pack when the balance drops below a threshold) as something the customer switches on.
Option A: Stripe credit grants
Stripe's billing credits are built for this. A credit grant holds prepaid or promotional credit for one customer, and Stripe applies it to invoices when they finalize. Points worth knowing before you build on it:
- Credit grants only apply to subscription items with metered prices that report usage through Meters. So the customer needs a usage-based subscription, and the grant pays down its invoices.
- Grants apply after discounts but before taxes and before the customer invoice balance.
- Credits do not expire unless you set
expires_at. You can also expire a grant early. - When several grants could apply, Stripe uses the lowest
prioritynumber first, then the earliest expiry, then promotional before paid. - A customer can hold up to 100 unused credit grants at a time. Selling many small packs to one customer can hit this.
- Issuing a credit note does not restore credits that were applied to an invoice; you must create a new grant. Voiding the invoice does restore them.
The typical flow: the customer pays for a pack through Checkout, your webhook handler receives the payment event, and you create a credit grant for that amount with your chosen expiry. Stripe also has a separate customer invoice balance, which is not the same thing; its customer balance docs explain when to use each.
Option B: Polar Meter Credits
Polar's credits docs describe credits as "prepaid units on a meter": usage draws the balance down before anything is billed. You attach a Meter Credits benefit to a product.
- On a one-time product, credits are granted once at purchase. Polar calls this a credit pack, such as 10 USD for 500 credits; customers buy another pack to top up.
- On a subscription, credits are granted at the start of each cycle, with optional rollover of unused units.
- One-time products cannot have metered prices, so a credit pack has no overage. Polar's pricing models page warns that Polar "doesn't block usage when a balance runs out"; your app reads the balance and decides whether to serve the request.
Polar acts as merchant of record, which also changes how tax on the packs is handled; see merchant of record explained.
Which setup fits
| Situation | Simplest fit |
|---|---|
| Already on Stripe Billing with a metered subscription | Stripe credit grants on the metered price |
| One-time credit packs, no subscription | Polar credit packs, or your own ledger with Stripe Checkout |
| Credits included in a monthly plan, overage allowed | Polar subscription with Meter Credits plus a metered price, or Stripe subscription plus monthly grants |
| Several actions with different costs | Abstract credits in your own ledger, provider only takes the payment |
If none of this fits, you can always sell packs as plain one-time payments and keep the balance entirely in your own database. You lose the provider's reporting, but you keep full control of expiry and refunds.
Worked example
Say an API call costs you about 0.4 cents in supplier fees and hosting. You sell three packs: 10 USD for 1,000 calls, 40 USD for 5,000 calls and 150 USD for 25,000 calls. The smallest pack earns 6 USD over cost (60% margin); the largest earns 50 USD (33%). Purchased calls expire after 12 months, and a 100-call free starter grant expires after 30 days. The free grant has a lower priority number so it is used first. At 200 remaining calls, the customer gets an email with a one-click top-up link. At zero, the API returns HTTP 402 with a message that points to the billing page.
Frequently asked questions
Should prepaid credits expire?
They can, but say so before purchase. Many teams expire promotional credits quickly and give purchased credits a long window such as 12 months. Stripe credit grants never expire unless you set an expiry date.
Can I refund unused prepaid credits?
Yes, but decide the policy first: full refund of the unused balance, refund within a window, or no cash refund. On Stripe, refunding the payment leaves the credit grant you created in place, so expire or void the remaining credits yourself; how to handle refunds for a small SaaS covers the policy side.
Do Stripe credit grants work with one-time payments?
Not directly. Stripe applies credit grants only to subscription items with metered prices that report through Meters. For one-time packs without a subscription, keep the balance in your own ledger or use a provider with credit packs, such as Polar.
Credits or dollars: which unit should I sell?
Sell dollars if you have one action with one cost, since customers understand it at once. Sell abstract credits if actions have very different costs or if you expect supplier prices to change.