The billing unit: tokens
Language models don't count words or characters. They split text into tokens, which are common chunks of letters. Short words are usually one token; longer or rarer words are several. In English, 1,000 tokens is roughly 750 words, or about a page and a half. Code, numbers and languages other than English tend to use more tokens for the same amount of text.
Prices are quoted per one million tokens. To price a request, you need two numbers: how many tokens you sent and how many came back.
Input and output are priced separately
Nearly every API has two prices for each model:
- Input price for everything you send: system prompt, conversation history, documents, images and tool definitions.
- Output price for everything the model writes, including hidden reasoning on models that think before answering.
The output price is usually several times the input price, because generating text takes much more computation than reading it. The formula for one request is:
cost = (input tokens × input price + output tokens × output price) ÷ 1,000,000
A worked example
Say a model costs $1.00 per million input tokens and $5.00 per million output tokens. A request sends 4,000 tokens and gets 500 back:
input: 4,000 × $1.00 ÷ 1,000,000 = $0.0040 output: 500 × $5.00 ÷ 1,000,000 = $0.0025 total: $0.0065
Notice that the output was only 11% of the tokens but 38% of the cost. That ratio is why the shape of your traffic matters as much as its size.
Know your mix
| Kind of work | Typical mix | What drives the cost |
|---|---|---|
| Classification, extraction, routing | Almost all input | Input price, and how much context you send |
| Coding agents | Usually more than 90% input | History resent on every step |
| Chat assistants | Mostly input, growing over the conversation | Length of the conversation |
| Summaries | Mostly input | Size of the source text |
| Long-form writing | Mostly output | Output price |
If you don't know your mix, measure it. Any decent provider shows input and output tokens for each request. A week of real numbers is worth more than any estimate.
How images are priced
Images work in two directions, and they are billed differently:
- Images you send to a model that can see are converted into tokens and billed as input. Larger images cost more tokens.
- Images a model creates are usually priced per image, sometimes varying with size and quality. On CheapTokens, image models have one flat price per generated image, shown on the models page.
The costs people miss
Resent history
The model does not remember the conversation. Your app sends it again with every message. The tenth message in a chat pays for the first nine again. Long-running agents are the extreme case: each step can resend everything read and written so far.
System prompts and tool definitions
A 2,000-token system prompt is billed on every single request. So is the description of every tool you make available. A long list of tools can cost more than the user's actual question.
Reasoning tokens
Models that reason before answering produce tokens you never see, and they are billed as output. A short visible answer can hide a much larger charge. Most APIs let you choose how much effort the model spends.
Retries
Every retry of a billed request is paid for again. Find out whether your provider charges for failed requests. CheapTokens does not.
Estimated usage
If a stream is cut off before the model reports its usage, a provider has to estimate. Check how that is handled and whether such requests are marked. On CheapTokens they are labelled "Estimated" in your history.
Prepaid and postpaid
With postpaid billing you get an invoice for whatever was used, which is convenient until a bug or a leaked key runs up a large amount. With prepaid billing you top up a balance and requests stop when it runs out. That caps your risk at the balance, at the price of having to top up.
Prepaid gateways often work with a hold: when a request starts, an estimate of its cost is set aside; when it finishes, the exact amount is charged and the rest is released. You may see your available balance dip briefly during a long request and then recover.
Estimating a monthly bill
- Count requests. For example, 2,000 users sending 10 messages a day is 600,000 requests a month.
- Measure an average request. Use real traffic if you can. Say 3,000 input tokens and 400 output tokens.
- Multiply. That is 1.8 billion input tokens and 240 million output tokens a month.
- Apply the prices. At $1.00 and $5.00 per million: $1,800 for input and $1,200 for output, $3,000 in total.
- Add a margin. Allow 20 to 30% for retries, long conversations and growth.
Then ask what would change the result most. In this example, halving the average input by trimming history saves $900 a month. Moving simple requests to a model that costs a quarter as much could save far more.
Keeping it under control
- Give each app or environment its own key, so you can see where the money goes.
- Set a spend limit on every key that runs without supervision.
- Review the per-request history weekly and look for unusually large requests.
- Start with a small prepaid balance while you learn your real numbers.
On CheapTokens, the dashboard shows every request with its input tokens, output tokens and exact charge, and each API key can carry its own spend limit. See the current prices or the billing section of the docs.
Create a CheapTokens account ↗