> This page is for version Preview (default).
> For other versions, use one of these documentation indexes:
> - Preview (default): https://docs.preview.paid.ai/preview/llms.txt
> - Current: https://docs.preview.paid.ai/current/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.preview.paid.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.preview.paid.ai/_mcp/server.

# How credits work

> Sell prepaid credits, price usage in them, and know exactly what a customer is billed when they run out.

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](/credits/credit-grants#grants-from-prices).
* **Charge different rates for different work** from one shared balance, by pricing each kind of usage in the same [credit currency](#credit-currencies).
* **Show customers what's left** with [credit balances](/credits/credit-ledger#credit-balances), and explain every change with the [credit ledger](/credits/credit-ledger#credit-transactions).
* **Stop work at zero** when you need a hard limit, with [credit holds](/credits/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:

| Object                                                           | What it does                                                                                                 |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [Credit currency](#credit-currencies)                            | Names the unit amounts are quoted in, and sets the overage rate.                                             |
| [Credit grant](/credits/credit-grants)                           | Adds credits to a balance, with an optional expiry, rollover and refill.                                     |
| [Credit balance](/credits/credit-ledger#credit-balances)         | Shows what's been granted, used, held and is still available, per customer and credit currency.              |
| [Credit transaction](/credits/credit-ledger#credit-transactions) | One ledger entry: a grant, spend, expiry, void, refill, overage or pending usage, with the balance after it. |
| [Credit auto top-up](/credits/auto-top-ups)                      | Buys more credits automatically when a balance runs low.                                                     |
| [Credit hold](/credits/credit-holds)                             | Reserves 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:

#### API

[Create a credit currency](../api-reference/catalog/credit-currencies/create) with a `key`, a `name`, and a `conversion` to money. These endpoints are in the `credits=v1` beta; send `Paid-Beta: credits=v1`.

**`POST /v1/credit-currencies`**

```json title="POST /v1/credit-currencies"
{
  "key": "adatum_credits",
  "name": "Adatum credits",
  "displayName": "Credits",
  "conversion": { "currency": "usd", "unitAmount": "75" }
}
```

**`Response`**

```json title="Response"
{
  "id": "cc_4Tq9Hc",
  "object": "creditCurrency",
  "livemode": false,
  "key": "adatum_credits",
  "name": "Adatum credits",
  "description": null,
  "displayName": "Credits",
  "unfundedUsage": "overage",
  "conversion": { "currency": "usd", "unitAmount": "75" },
  "metadata": {},
  "createdAt": "2026-11-01T09:00:00Z",
  "archivedAt": null
}
```

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

#### Dashboard

> **Draft**
>
> These steps describe the planned v1 dashboard and will change before release.

1. Go to **Configure > Credits** and click **Create credit currency**.
2. Enter a **Key** (`adatum_credits`), which can't change later, and a **Name** for your team.
3. Under **Display name**, enter what your customers see on invoices (`Credits`).
4. Under **Conversion**, choose **USD** and enter what one credit costs in cents (`75`).
5. Leave **Usage before the first grant** as **Bill as overage**. It can't change later.
6. Click **Create credit currency**.

| Field           | What it's for                                                                                                                                                                                                                                                                                                                                         |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key`           | How 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.                                                                                                                                                                        |
| `name`          | A label for your team, shown in the dashboard and the API.                                                                                                                                                                                                                                                                                            |
| `displayName`   | What your customers see on invoices, credit notes, checkout and the portal. Up to 250 characters; `null` uses `name`.                                                                                                                                                                                                                                 |
| `conversion`    | What 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. |
| `unfundedUsage` | What happens to usage before a customer's first grant. See [Overage](#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`**

```json title="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](/core-concepts/introduction-to-pricing#how-one-line-is-priced) 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](/credits/credit-grants#grants-from-prices) 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](/orders-and-billing/amending-orders) or bought automatically by an [auto top-up](/credits/auto-top-ups).

See [Grants from prices](/credits/credit-grants#grants-from-prices). You can also [grant credits by hand](/credits/credit-grants#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`:

| Grant               | Scope                       | Forfeited                      | Spent                         |
| ------------------- | --------------------------- | ------------------------------ | ----------------------------- |
| Live analysis trial | the `live_analysis` product | 31 December 2026               | first, for live analysis only |
| Yearly bundle       | none                        | 1 January 2028, after rollover | next, for everything else     |
| Goodwill            | none                        | never                          | last                          |

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](/credits/credit-ledger#credit-transactions) and billed in money at the credit currency's `conversion`, for the billing period it happened in. A [negotiated pricing](/core-concepts/introduction-to-pricing#how-one-line-is-priced) 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](/credits/credit-holds) before the work runs.

`unfundedUsage` decides what happens to usage that arrives before a customer's first grant:

| `unfundedUsage`     | Usage before the first grant                                                                                                           |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `overage` (default) | is overage, billed at `conversion` like any other.                                                                                     |
| `pending`           | is 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:

| Step                                                           | Value                                                     |
| -------------------------------------------------------------- | --------------------------------------------------------- |
| Bundle charge, invoiced at the start of the year               | 20,000 × 70¢ = 1,400,000¢ = **\$14,000.00**               |
| Credits granted                                                | +20,000 `adatum_credits`                                  |
| Spent by the end of March: 4,850 minutes                       | 4,850 × 4 = 19,400 credits, leaving 20,000 - 19,400 = 600 |
| April usage: 300 minutes                                       | 300 × 4 = 1,200 credits                                   |
| Spent from the grant in April                                  | 600 credits, leaving 0                                    |
| Overage in April                                               | 1,200 - 600 = 600 credits                                 |
| Overage charge                                                 | 600 × 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](/usage/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](../api-reference/catalog/credit-currencies/update) 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](../api-reference/catalog/credit-currencies/archive) 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.

## Related

* [Credit grants](/credits/credit-grants)
* [Credit balances and ledger](/credits/credit-ledger)
* [Credit holds](/credits/credit-holds)
* [Prices](/catalog/prices)
* [Credit currencies API reference](../api-reference/catalog/credit-currencies/create)