§01 · The Model

Cache tokens

Also called Cached tokens · Cache read tokens · Cache hit

The share of a request's input served from the prefix cache. Heavily discounted, and the first thing to check when a session feels pricey.

Cache tokens are the portion of a request's input tokens that the model provider recognised from its prefix cache and didn't have to process again. They still count toward the context window (the model sees them) but are billed at a fraction of the normal input rate and cost almost no latency. On a healthy coding session, the large majority of input on each request should be cache tokens.

They're the number to watch when a session feels expensive. If a usage readout shows a big context but few cache tokens, something is breaking the cache on every request: an instruction file that's regenerated each turn, a tool whose definition changes, or gaps between messages long enough for the cache to expire. If cache tokens are high and the bill is still climbing, the problem is simply that the window is too big, and compaction is the fix.

Providers report them separately, and harnesses surface them. Learning to read that line ('cached' vs 'fresh' input) turns cost from a mystery into a diagnostic. Cache-write tokens are the other side: the first time a prefix is stored, some providers charge a small premium. That's fine as long as it's followed by many reads.

In the tools
  • Anthropic APIUsage returns cache_read_input_tokens and cache_creation_input_tokens alongside plain input.
  • OpenAI APIcached_tokens appears under prompt token details when caching kicks in.
  • Claude Code/cost splits the session's input into cached and uncached.
In conversation

The status line says 180k context but the cost barely moved this turn.

Most of it came back as cache tokens. You're paying for the new tool result, not the whole history.

Related terms
Learn it in the school
Words are the easy part

Course 01 puts every one of these terms to work: you install Claude Code, run the loop, and ship a real project — permission modes, compaction, hooks and all.

Start Course 01 →