Predict the break-even read count for Anthropic prompt caching given the 1.25x / 0.1x rates
Anthropic charges 1.25x the normal input rate on the cache WRITE (the first request that populates a cached prefix) and 0.1x the normal input rate on each cache READ (every subsequent hit on the same prefix). Compute the minimum number of total cache reads N (not counting the write) after which the cumulative cost is strictly LOWER than running the same N+1 requests against an uncached endpoint at 1.0x. Show the inequality and the integer answer.
Cached cost (write + N reads) = 1.25 + 0.1N. Uncached cost (N+1 calls) = N+1. Set cached < uncached: 0.25 < 0.9N, so N > 0.28. Caching wins from the FIRST read (1.35 < 2.0).
Picture a coffee shop that charges $1.25 to engrave your favorite order on a card the first time you visit and $0.10 each time you flash that card later. Without the card, every drink is $1.00. After your first refill ($1.25 + $0.10 = $1.35 total) you've spent more than the $1 for a single drink but less than the $2 you'd have spent on two regular drinks. From your second card flash onward, you're saving by a wide margin. The card pays off remarkably fast.
Detailed answer & concept explanation~7 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: the inequality and its solution + why N=1 is the break-even + what the '2 reads' figure actually measures + TTL implications + Anthropic vs OpenAI cache mechanics + production placement of cache_control.
Real products, models, and research that use this idea.
- Cursor and Anysphere have publicly reported 70-90% input cost reductions on their Claude usage after enabling prompt caching on system prompts and codebase context.
- Anthropic's own Computer Use sessions cache the lengthy system prompt across all turns, making the per-turn input cost manageable despite the verbose tool definitions.
- RAG-heavy products (Perplexity-style) cache retrieved chunks when the same retrieval result serves multiple users' follow-up turns within the TTL window.
- Agent frameworks like LangChain and the OpenAI Agents SDK in 2026 expose cache-control configuration as a first-class parameter on agent system prompts.
- Claude Sonnet 4.5 in production deployments commonly runs with cached system prompts + variable user messages; the cached portion bills at 0.1x and dominates the cost savings.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does Anthropic's extended 1-hour TTL change the break-even math?
QWhy does Anthropic price the write at 1.25x rather than at 1.0x like OpenAI's auto-cache?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Quoting 'two reads to break even' without showing the inequality. That number compares cached vs cached without the premium, not cached vs uncached. The cached recipe wins versus uncached on the very first read.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.