- Guides
- AI usage
Reading a token bill: four prices, and the cache that is most of it
Input, output, cache writes and cache reads bill at very different rates. Why the cache is most of an AI coding session, what makes it miss, how Codex and Gemini CLI count, and why summing the four overstates the cost several times over.
: Merged with “Why your assistant re-reads everything”: the cache's lifetime, Codex and Gemini CLI, a chart of one session's tokens against its cost.

In this guide
Open the token breakdown of almost any Claude Code session and the largest number by far is cache reads: context the model was already sent, read again on every turn. A session reports four counts, they bill at four different rates, and the most common mistake is adding them up and multiplying by the input price. Here is what each count is, why the cache is most of the bill, and what moves it.
The four numbers
- Input: fresh context, charged at the full input rate.
- Cache write: context stored for reuse, charged above the input rate: 1.25 times for Anthropic's 5-minute cache, twice for the 1-hour one.
- Cache read: context served from that cache, charged at a tenth of the input rate on most Claude models, and less on some.
- Output: what the model generated. The most expensive per token, and usually the smallest count.
Why the cache is most of the bill
An assistant does not remember the conversation between two turns: it sends the whole of it again, with the files it read and the tool results, every time. The cache is what makes that affordable. The first turn writes the conversation to it; each later turn reads that part back at a tenth of the price and pays full rate only for what is new.
Here is one session of the AI cost calculator's example, priced at Anthropic's list prices for Claude Sonnet 5.5, checked on 14 October 2026.
| Tokens | Cost | |
|---|---|---|
| Cache reads | 3 M | $0.60 |
| Cache writes | 250 K | $0.63 |
| Input | 40 K | $0.08 |
| Output | 25 K | $0.25 |
The cache is prefix-based, and it does not last. Three habits decide how much of a session it serves:
- Starting a new conversation for each task. A fresh session has no cache to hit. Two related tasks in one conversation cost less than the same two apart.
- Changing the early part of the context. Editing something near the start invalidates everything after it. Adding to the end is cheap; compacting the conversation rewrites it, and the next turn writes it to the cache again.
- Long gaps. The default cache lives 5 minutes, renewed each time it is read. A conversation resumed after a coffee break writes its context again, at 1.25 times the input rate.
A high cache-read share is therefore the healthy case. What is worth a look is a session where fresh input or cache writes stay high against cache reads: the context is being rebuilt rather than reused.
Why summing them goes so wrong
Priced at the input rate, the 3.3 million input-side tokens of that session come to $6.63, plus $0.25 of output: $6.88 against a real $1.56, more than four times too much. On a model whose cache reads cost less than a tenth, the gap is wider. Pricing everything at the cache-read rate fails just as badly the other way.
The method is the long one: multiply each of the four counts by its own rate for the model you used, and add them. On a subscription such as Claude Pro or Max, the bill is a flat fee: the same sum then says what the work would have cost on the API, not what you paid.
Price a session
Codex and Gemini CLI
Codex and Gemini CLI report their tokens differently: both count cached input inside input. inlinr takes it out, so that input means the uncached part for every assistant and the four counts compare. Gemini's thinking tokens bill as output and are counted there. The same habits move their cache: it is still the conversation sent again at every turn.
What inlinr does
The Claude Code plugin reads the session files of Claude Code, Codex and Gemini CLI on your machine and sends the four counts of each session with its model, never a prompt or a response. The dashboard shows the four counts side by side, and an estimate for Claude models at list price with the day those prices were checked. For a model whose prices inlinr has not verified, it shows the tokens without an amount: a figure from a guessed price would look more certain than it is.
Sources
- Prompt caching, Anthropic: how the cache is keyed by prefix, its 5-minute lifetime renewed on each read, the 1-hour option, and the price multipliers. Checked on 29 October 2026.
- Pricing, Anthropic: input, output and cache prices per model. Checked on 14 October 2026.
What changed
- : Merged with “Why your assistant re-reads everything”: the cache's lifetime, Codex and Gemini CLI, a chart of one session's tokens against its cost.
- : The dashboard shows an estimate at list price; the guide said it showed no amount.
- : first published.
See it on your own sessions
inlinr records the four token counts of every Claude Code, Codex and Gemini CLI session separately, and prices each at its own list rate for the Claude model that produced it.
Free for solo use · no source code leaves your machine