Cogloom · Practical AI & coding
The exact setup — and the three gotchas that quietly undo it
Anthropic bills a cached input token at roughly a tenth of the normal input rate. If a big chunk of your prompt is identical on every call — a long system prompt, tool definitions, a fixed document — you are paying full price to send the same tokens thousands of times. Caching stops that.
Here is a real shape: an agent doing about 4,000 calls a day with a ~2,800-token system prompt (rules, tool definitions, examples) sent on every single call. That prefix is identical every time. Without caching you pay full input price for those 2,800 tokens 4,000 times a day. With caching, after the first write, every subsequent read of that prefix is billed at about a tenth of the rate — and on a prompt that is mostly the repeated prefix, the input bill drops by roughly 85–90%.
"cache_control": {"type": "ephemeral"} to the last content block you want cached. Everything up to and including that block becomes the cached prefix.Cache the biggest block of your prompt that is identical across calls, place it first, and only when you send it often enough to keep the cache warm. That is the whole game.
Cogloom — practical AI & coding, checked before it is repeated. Numbers here follow Anthropic's own caching and pricing docs; verify the current multipliers against the source below before you budget on them. How we check an AI answer before we repeat it →
cache_control usage, minimum cacheable prefix, and the 5-minute / 1-hour cache lifetimes.