> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenchange.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Credits and billing

> How TokenChange credits work, how each request is priced from token usage and endpoint prices, how to add credits and how to read your transactions.

Credits are the only currency on TokenChange. You spend them when you call endpoints and earn them when others call yours.

| Unit | Value |
| - | - |
| 1 credit | \$0.01 |
| \$1 | 100 credits |

## Add credits

Open **Billing** and enter a code under **Add credits** to redeem a promo code. Card payments aren't available yet.

## How a request is priced

Each endpoint sets an input, output and cached input price in USD per million tokens. After a request finishes, its cost is calculated from the token usage the endpoint reported:

* Prompt tokens served from the provider's prompt cache are charged at the **cached input** price.
* The remaining prompt tokens are charged at the **input** price.
* Generated tokens are charged at the **output** price.

The total is rounded down to a millionth of a dollar and converted to credits. You pay the prices of the endpoint that served the request, whichever way it was routed.

Tokens

Prompt tokens

Of which cached

Completion tokens

Endpoint prices (USD per 1M tokens)

Input

Output

Cached input

Cost
credits

In USD
\$

> [!NOTE]
>
> The calculator uses the same formula as billing. Your actual token counts come from the endpoint that served the request.

### What isn't billed

* Requests that fail before any output is delivered, including attempts that failed over to another endpoint.
* Requests you cancel before any output arrives.

Once output has started, the request is billed even if you disconnect. TokenChange finishes reading the response so the usage is counted.

## Balance

Requests are refused with `402 insufficient_credits` while your balance is zero. Nothing is reserved before a request starts, so a request that begins with a small balance can cost more than you have left. In that case your balance stops at zero; it never goes negative.

Turn on **Billing** emails in **Settings** to hear about credits added and low balances.

## Transactions

**Billing** lists every change to your balance. Filter by type:

| Type | Meaning |
| - | - |
| **Purchases** | Credits you bought |
| **Promo redemptions** | Credits from a promo code |
| **Spend** | Requests you made, with their input and output tokens |
| **Earnings** | Credits earned by your endpoints, if you're a provider |
| **Adjustments** | Corrections made by TokenChange |

Read the same data from code with [`GET /v1/balance`](https://docs.tokenchange.io/api-reference/billing/get-balance) and [`GET /v1/transactions`](https://docs.tokenchange.io/api-reference/billing/list-transactions).

Cost formula: cost in USD = ((prompt tokens - cached tokens) x input price + completion tokens x output price + cached tokens x cached input price) / 1,000,000, with prices in USD per million tokens, rounded down to \$0.000001. Credits = USD x 100.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.