How credits work
Many AI products sell credits: your customer pays up front for a balance, and their usage spends it down at rates you set. Paid keeps two ideas apart. A credit currency is what amounts are quoted in when they aren’t money, such as “Adatum credits”. Credits are a customer’s prepaid balance in that unit. The one fact that makes it click: spending never blocks, so usage past the balance is still recorded, and billed in money at the rate you set on the credit currency.
Use credits to:
- Sell prepaid usage with a price that grants credits each interval, or a one-time top-up. See Grants from prices.
- Charge different rates for different work from one shared balance, by pricing each kind of usage in the same credit currency.
- Show customers what’s left with credit balances, and explain every change with the credit ledger.
- Stop work at zero when you need a hard limit, with credit holds.
How credits work
- You define a credit currency, such as
adatum_credits, with what one unit costs in money. - You price usage in it. A usage price or rate card names the
creditCurrencyinstead of acurrency, so its amounts are in credits. - Your customer gets credits from a price on their order, such as a yearly credit bundle, or from a grant you create by hand.
- Usage spends the balance as it arrives. Once the balance is empty, further usage is overage, billed in money at the credit currency’s
conversion.
These objects make up the credit system:
Credit currencies
Adatum sells video analysis as prepaid credits. It defines one credit currency for them, and sets what a credit costs when a customer spends past their balance:
API
Dashboard
Create a credit currency with a key, a name, and a conversion to money. These endpoints are in the credits=v1 beta; send Paid-Beta: credits=v1.
Prices, grants and balances refer to the unit by its key or its cc_ ID.
Here "unitAmount": "75" is 75¢ a credit.
Price usage in credits
A usage price in a credit currency spends credits as usage arrives, at its rate. Adatum charges 4 credits per minute of video analysed:
Every amount on the price is then in credits, with up to 15 decimal places, so "0.25" is a quarter of a credit. Only usage prices and rate cards can be in a credit currency. Tiers, rate cards and negotiated pricing all work in credits the same way they work in money, except that credits are spent as each reading arrives, so a charge in credits can’t go negative or depend on the end of the period: volume tiers over the billing period, volume banded discounts and amount discounts aren’t available in credits.
Every price in the same credit currency spends the same balance. A customer’s credits are shared across all their orders and products, unless a grant is scoped to some products or prices.
Sell credits
Credits come from prices that grant them, priced in money like any other recurring or one-time price:
- A credit bundle is a recurring price with
grants, such as 20,000 credits a year at 70¢ a credit. - A top-up is a one-time price with
grants, added to an order with an amendment or bought automatically by an auto top-up.
See Grants from prices. You can also grant credits by hand, for example as goodwill.
Spend order
When a customer has several grants in a credit currency, each spend draws on them in this order:
- Scoped grants first, for the usage they cover. A grant scoped to a product pays for that product before an unscoped grant does.
- Then the grant whose credits are forfeited soonest. Rollover counts, and so does a refilling grant’s next refill.
- Then the oldest grant.
Brightrail has three grants in adatum_credits:
Grants from orders and grants made by hand follow the same order, so goodwill credits that never expire never cause paid credits to expire unspent.
Overage
Spending never blocks. Once the balance is empty, further usage is overage: recorded in the ledger and billed in money at the credit currency’s conversion, for the billing period it happened in. A negotiated pricing entry that targets the credit currency’s overage can give one customer a different overage rate.
Without a conversion, overage is recorded but never billed. To stop usage at zero instead, place a credit hold before the work runs.
unfundedUsage decides what happens to usage that arrives before a customer’s first grant:
After a customer’s first grant, an empty balance always produces overage, whichever you choose. unfundedUsage is fixed when you create the credit currency, so usage already recorded is never reclassified.
How it bills
Brightrail buys Adatum’s yearly credit bundle with a quantity of 20,000, at 70¢ a credit. Adatum’s video analysis spends 4 credits a minute, and its credit currency converts overage at 75¢ a credit:
Usage paid from credits is never invoiced in money: only the bundle and the overage are. Usage summaries show the credits spent and the overage next to the usage behind them.
Change or retire a credit currency
Update a credit currency to change its name, description, displayName, conversion or metadata. A new displayName applies to invoices issued afterwards, and a new conversion to overage billed afterwards: issued invoices are never rewritten. key and unfundedUsage can’t change: create a new credit currency instead.
Archive a credit currency to stop new prices and manual grants using it. Existing prices keep working on existing orders, including their grants, and balances in the unit stay spendable.