Tokens and how LLM pricing works
Working out one request
claude-haiku-5-5 at $0.10 per million input tokens and $0.50 per million output tokens.
Input.
1,840 tokens × $0.10 / 1,000,000 = $0.000184
Output.
212 tokens × $0.50 / 1,000,000 = $0.000106
Total.
$0.000290, or about $0.29 per thousand such requests

From a 1906 handbook on telephone exchanges.
The practical telephone handbook and guide to the telephonic exchange, 1906. Internet Archive Book Images, no known copyright restrictions, via Wikimedia Commons.
Kinds of tokens
| Kind | What it is | Price |
|---|---|---|
| Input | Everything you send: system prompt, messages, tool definitions | The model's input price |
| Output | What the model writes, including reasoning on reasoning models | The model's output price, usually higher |
| Cached input | Input the provider has already seen and kept | Much less than input, on providers that support it |
| Cache write | Input stored for later reuse | A little more than input, on some providers |
Rules of thumb
A page of English is about 500 to 700 tokens. Code and other languages often use more tokens per character. Images are charged as a number of tokens that depends on their size.
Questions
Why do output tokens cost more?
The model generates them one at a time, which takes far more computing than reading input.
How do I count tokens before sending?
The token cost calculator counts a prompt's tokens and prices it across models.
Read next
Live in a minute.
Create a key, change the base URL, send a request. No card needed with your own provider keys.
Start free