Pro: $20 a month, including $20 of usage at cost. Past that, usage at cost on your next invoice, up to $100 a month. Top up $10 any time. Prepaid: buy $10 or $50 of usage, spend it at cost, top up when it runs low.A dollar balance lets you pass any cost through to customers at its exact price, from GPU seconds to third-party API calls, and show them a wallet in dollars. It is a credits balance where each credit is worth a fixed fraction of a dollar. This page uses **1 credit = $0.0001** (a hundredth of a cent), so $1 is 10,000 credits and a model call that costs you $0.0123 spends 123 credits. The feature costs 1 credit a unit (
creditCost: 1), so your backend works out each use’s real cost in credits and sends it as quantity.
For model calls, use AI usage in dollars: send each call’s model and tokens, and Ledger prices them from its model price table plus your markup. This page is for costs you work out yourself.
The same catalog serves two ways to sell it: a monthly plan that includes a balance and bills usage past it, or prepaid balance only, where customers top up a wallet and never hold a plan.
The catalog
The calls
Reserve your estimate with the check asreserve.quantity, then settle with the real cost as the track’s quantity, under the same request_id. The reservation confirms a $2 run fits before it starts; a plain check asks about one unit, 1 credit.
Response
availableCredits / 10_000, here $19.99. For short calls you don’t estimate, skip reserve and send the track’s quantity alone. Reserve whenever a run costs you real money, so Ledger confirms the balance covers it before the work runs. Reservations has the rules.
Per-unit prices
When each unit has a list price, such as a GPU-second or a megabyte, put the price in the feature’screditCost and send the units as quantity: Ledger multiplies them, and the rate lives in your catalog, not your code. Pick a scale where every rate is a whole number of credits. At **1 credit = $0.000001**, a GPU-second at $0.000025 is creditCost: 25 and a megabyte of egress at $0.000004 is creditCost: 4; overage at cost is 1 cent per 10,000 credits.
gpu_second with quantity: 180 and spends 4,500 credits ($0.0045). Count a unit that comes in fractions, such as megapixels, in whole units rounded up, or in a smaller unit with its own creditCost.
Prepaid balance only
Prepaid: buy $10 or $50 of usage, spend it at cost, top up when it runs low.Customers top up a prepaid wallet and use your product with no plan at all. A customer with top-up or pack credits can use every credits feature while their credits cover the cost (Customers without a plan). Nothing bills later: the balance is exactly what they can spend. 1. Sell balance. Let the customer top up any amount within the catalog’s
topUps: $5 to $500 here, at 10,000 credits a dollar, so $10 buys 100,000 credits. Checkout opens by default, and the credits land when Stripe confirms the payment; paymentMethod: "saved" charges the saved card at once.
addOnId.
2. Spend it at cost. The same check with reserve and track with the real cost as quantity, as above.
3. Offer a top-up when it runs out. When the balance doesn’t cover a reservation, check answers allowed: false with reason: "no_plan":
Response
409 insufficient_credits and charges nothing.
4. Top up automatically when it runs low. Save an auto top-up for the customer, and Ledger charges their saved card when the balance falls below the threshold: here $25 whenever it drops under $1 (10,000 credits), at most 4 times a month.
creditCost when some uses have a fixed price: feature({ id: "web_search", name: "Web search", creditCost: 100 }) spends 1 cent a search from the same balance: each track sends the number of searches as quantity, and Ledger applies the 100 credits.
Rules
- Pick the scale for your cheapest use. A credit is the smallest price, and every per-unit rate is a whole
creditCostat that scale. At $0.0001 a credit, a $0.00002 call costs 1 credit. Rounding each use up withceiladds at most one credit per use. - Each amount holds up to 2,147,483,647 credits, which is $214,748.36 at this scale. That covers a feature's `creditCost`, a plan's `monthlyCredits`, a pack's `creditAmount`, a reservation, and `quantity × creditCost` on one check or track. One [balance adjustment](/customers/balance-adjustments) adds or removes at most 1,000,000,000 credits ($100,000). A balance can be larger: it’s the sum of its grants.
quantityis a whole number of the feature’s units, 1 or more on a track without a reservation. Round each cost up to whole credits before you send it.- Overage on Pro. Overage has the cap and how a period’s overage rounds.
- Invoices count credits. Stripe lines read “Pro – overage, 15,000 credits”, and Checkout describes overage per 100 credits. Name packs in dollars (“$10 of usage”) so the purchase line reads well.
- Spend order. Balances has the order a plan’s balance, packs and overage are spent in.
Related
- AI usage in dollars: model calls priced from their tokens, natively.
- Credits: the shared balance this pattern builds on.
- Reservations: hold an estimate, settle the real cost.
- Top-ups and auto top-ups: any amount, and automatic top-ups when the balance runs low.
- Credit packs: selling balance in fixed amounts.
- AI coding tool: a dollar balance across Free, Pro and Business.