Skip to navigation

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

  1. You define a credit currency, such as adatum_credits, with what one unit costs in money.
  2. You price usage in it. A usage price or rate card names the creditCurrency instead of a currency, so its amounts are in credits.
  3. Your customer gets credits from a price on their order, such as a yearly credit bundle, or from a grant you create by hand.
  4. 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:

ObjectWhat it does
Credit currencyNames the unit amounts are quoted in, and sets the overage rate.
Credit grantAdds credits to a balance, with an optional expiry, rollover and refill.
Credit balanceShows what’s been granted, used, held and is still available, per customer and credit currency.
Credit transactionOne ledger entry: a grant, spend, expiry, void, refill, overage or pending usage, with the balance after it.
Credit auto top-upBuys more credits automatically when a balance runs low.
Credit holdReserves credits before work runs, so you can stop at zero.

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:

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.

{
"key": "adatum_credits",
"name": "Adatum credits",
"displayName": "Credits",
"conversion": { "currency": "usd", "unitAmount": "75" }
}

Prices, grants and balances refer to the unit by its key or its cc_ ID.

FieldWhat it’s for
keyHow prices, grants and balances name the unit. Up to 64 lowercase letters, digits and underscores, unique on your account. It can’t be an ISO currency code, and can’t change.
nameA label for your team, shown in the dashboard and the API.
displayNameWhat your customers see on invoices, credit notes, checkout and the portal. Up to 250 characters; null uses name.
conversionWhat one unit costs in money: a currency and a unitAmount in that currency’s minor units, as a decimal string. currencyOptions adds amounts for other currencies. Used to bill overage, in the order’s currency: an order in a currency the conversion doesn’t cover fails with currency_mismatch. null records overage without billing it.
unfundedUsageWhat happens to usage before a customer’s first grant. See Overage.

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:

POST /v1/prices
{
"product": "video_analysis",
"name": "Video analysis",
"creditCurrency": "adatum_credits",
"type": "usage",
"usage": {
"meter": "video_minutes",
"pricing": { "type": "perUnit", "perUnit": { "unitAmount": "4" } }
}
}

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:

  1. Scoped grants first, for the usage they cover. A grant scoped to a product pays for that product before an unscoped grant does.
  2. Then the grant whose credits are forfeited soonest. Rollover counts, and so does a refilling grant’s next refill.
  3. Then the oldest grant.

Brightrail has three grants in adatum_credits:

GrantScopeForfeitedSpent
Live analysis trialthe live_analysis product31 December 2026first, for live analysis only
Yearly bundlenone1 January 2028, after rollovernext, for everything else
Goodwillnoneneverlast

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:

unfundedUsageUsage before the first grant
overage (default)is overage, billed at conversion like any other.
pendingis held as pending on the balance, and spent from the first grant when it arrives. What the first grant can’t cover becomes overage.

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:

StepValue
Bundle charge, invoiced at the start of the year20,000 × 70¢ = 1,400,000¢ = $14,000.00
Credits granted+20,000 adatum_credits
Spent by the end of March: 4,850 minutes4,850 × 4 = 19,400 credits, leaving 20,000 - 19,400 = 600
April usage: 300 minutes300 × 4 = 1,200 credits
Spent from the grant in April600 credits, leaving 0
Overage in April1,200 - 600 = 600 credits
Overage charge600 × 75¢ = 45,000¢
Overage line on the invoice for the period, labelled Credits$450.00

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.