A token is the unit a model reads and writes: a short piece of text, often part of a word. Everything a coding agent does is counted in tokens, and they come in three kinds with very different prices. On an API key you pay for them directly; on a subscription they draw on your usage limits. Either way, knowing which kind you are spending tells you what is worth saving.
Input, output and cache
- Input is everything sent to the model in a request. In Claude Code that is the whole context window: system prompt, CLAUDE.md, the conversation and every tool result so far, not just your latest message.
- Output is everything the model generates: its reply, its tool calls and its thinking. Thinking tokens are billed as output.
- Cached input is the part of the input the API recognizes from a recent request. Prompt caching re-reads it at a fraction of the input price. Writing it into the cache costs a bit more than normal input.
What they cost
Claude API list prices per million tokens:
| Model | Input | Cache read | Output |
|---|---|---|---|
| Fable 5.1 | $10 | $0.25 | $50 |
| Opus 5.5 | $4 | $0.20 | $20 |
| Sonnet 5.5 | $2 | $0.10 | $10 |
| Haiku 5.5 (prompts up to 100K tokens) | $0.10 | $0.01 | $0.50 |
Haiku 5.5 costs more for prompts over 100K tokens (2.50 output). Cache writes cost 1.25× input for a five-minute entry and 2× for a one-hour entry.
Two things stand out:
- Output costs five times input on every model in the table. A long answer or a lot of thinking is expensive per token.
- Models differ by a factor of 100. Fable output costs 100 times Haiku output. The model you pick, for the session and for each subagent, matters more than any single prompt.
Input wins on volume instead of price: the full context is sent with every request, so a big context multiplies across every turn and every tool call. Caching cuts that sharply, to 5% of the input price on Opus 5.5 and Sonnet 5.5, as long as the cache stays warm.
On a subscription
These are API prices. On a Pro or Max plan, /usage shows a dollar figure computed from your token counts at list price, but it is an estimate and not what you pay. The docs do not say how plan limits weigh input against output, so treat the price table as a guide to relative cost, not as a formula for your allowance.
Gotchas
- Your prompt is not your input. A one-line message in a long session sends the whole conversation.
- Thinking is output. A higher effort level means more thinking tokens at the output price.
- A cache miss re-processes everything. After a pause longer than the cache lifetime, or after switching models, the whole context is processed again as uncached input and written back to the cache.
Related
- Usage limits: how a subscription turns tokens into session and weekly limits.
- Effort: controlling how many thinking tokens the model spends.
- Prompt caching: how cached input works and what breaks it.
- Context window: what makes up the input.
- Reducing token usage: spending fewer of each kind.