What happened
Anthropic offers a cached version of your prompts and chat history within a session, intended to minimize costs when subsequent turns can reuse this stored context rather than re-sending the entire conversation.
This ‘stored copy’ cache is automatically cleared after a short period – currently five minutes by default – if it isn't actively used. The key finding of our tests, run in Model Routing Layers and the Prompt Cache Tax framework, was that a mid-run cache failure resulted in significantly inflated costs. We observed this primarily with Grok 4.5 using Opus 5, where the initial context was lost when we left for lunch, and attempting to resume the session triggered full input pricing.
Why it matters
The potential cost implications of cache misses are substantial. Anthropic’s pricing structure—200,000 uncached Opus 5 input tokens at $1.00 versus a hit (cached) token at $0.10—highlights the financial stakes involved.
A prolonged session with numerous missed cache hits could rapidly escalate expenses. The architecture of stored copy is an “scratch paper” type system that lives in memory, and it dies when there's no input to feed into it. It’s designed for efficiency, but that efficiency comes at the risk of a sudden bill spike if not carefully managed.
But, but, but…
The biggest challenge is predicting cache miss rates. Our tests revealed spikes in missed hits – particularly during longer coding sessions – where a single, seemingly minor interaction could trigger a full context reset and subsequent cost escalation.
The default five-minute cache lifespan isn't always sufficient for complex interactions or extended agent sessions. One specific case involved running 12-turn coding sessions through OpenRouter on the same synthetic prefix, resulting in a mid-run cache death. This underscored how external factors like user inactivity could unintentionally invalidate the cached context, leading to unexpectedly high charges.
“‘A hit is a later turn that still finds that copy. A miss is a later turn that does not find it, so you pay the full input price to send the whole history again.’”
— Dr Non
The counter-take
The perceived simplicity of Anthropic’s caching strategy obscures the complex interplay between prompt history, token usage, and cache expiration. Developers often underestimate the potential cost consequences of relying on this feature without careful monitoring.
The AI angle
AI pricing models are increasingly reliant on dynamic caching mechanisms to reduce operational costs, but these systems introduce new financial risks for developers. A deeper understanding of cache behavior is essential for effectively managing AI deployment budgets.