LLM Prompt Caching ROI & Break-Even Calculator
Anthropic charges 1.25Γ to 2.0Γ for cache writes and grants a 90% discount on cache reads. Compute your exact break-even velocity, avoid the 5-minute TTL expiration trap, and project monthly dollar savings across Claude, OpenAI, and DeepSeek.
Prompt caching saves you $994.92 / month (-52.8%). Break-even requires 1.3 reads per write within the 5m TTL.
π€ 1. Select LLM Architecture & Provider
πͺ 2. Token Breakdown Per Call
β‘ 3. Request Velocity & TTL Settings
π― Break-Even Analysis
At your prefix size, you need at least 1.26 cache reads per write for prompt caching to pay for itself.
Average request interval: 1.0 minutes.β Cache active: Every call resets the 5m TTL timer before expiration.
Cost & ROI Comparison Across Scale Tiers
Projected dollar spend for Claude Sonnet 5.5 with 16,000 prefix tokens.
| Request Volume | Without Caching | With Prompt Cache | Net Savings | Latency (TTFT) |
|---|---|---|---|---|
| 10,000 requests | $430.00 | $202.80 | β$227.20 (53%) | ~85% faster |
| 1,00,000 requests | $4300.00 | $2028.00 | β$2272.00 (53%) | ~85% faster |
| 10,00,000 requests | $43000.00 | $20280.00 | β$22720.00 (53%) | ~85% faster |
Prompt caching requires prefixes to match identically from token #1. Keep dynamic tokens (timestamps, user inputs) at the very bottom of the prompt.
Anthropic refreshes the 5-minute TTL on every single cache read. In production systems serving >12 req/hr, the cache rarely ever expires.
Cached prompts bypass the compute-heavy prefill phase, reducing Time-To-First-Token (TTFT) by up to 80% on long 20k+ token prompts.
How Prompt Caching Works: Anthropic vs. OpenAI vs. DeepSeek
Prompt caching is one of the most impactful architectural developments in generative AI. By retaining the Key-Value (KV) cache states of frequently repeated prompt segments in GPU memory, frontier LLM providers eliminate redundant prefill computations, slashing both inference costs and Time-To-First-Token (TTFT) latency.
Explicit caching with cache_control: {"type": "ephemeral"}. Charges 1.25x base price on writes, gives a 90% discount (0.10x) on reads within a sliding 5-minute TTL. Optional 1-hour extended TTL costs 2.0x on writes.
Fully automatic caching on prefixes ≥ 1,024 tokens. No write fee markup (charged at standard 1.0x base rate). Cache hits receive an automatic 50% discount ($1.25/1M on GPT-4o, $0.075/1M on mini).
Granular 64-token block caching. Automatic multi-turn caching with no write markup and an industry-leading 74%β75% read discount ($0.07/1M on V3, $0.14/1M on R1).
The Break-Even Formula: When Does Prompt Caching Pay For Itself?
Because Anthropic imposes a write premium ($1.25\times$), prompt caching is not free. If you write to the cache and never read from it again, you pay 25% more than standard un-cached inference.
// Mathematical Break-Even Formula
Uncached Cost for N requests = N Γ BasePrice
Cached Cost for N requests = (1 Γ WriteMultiplier Γ BasePrice) + ((N - 1) Γ ReadMultiplier Γ BasePrice)
Break-Even Condition: Cached Cost ≤ Uncached Cost
N ≥ (WriteMultiplier - ReadMultiplier) / (1 - ReadMultiplier)
Anthropic 5m TTL: N ≥ (1.25 - 0.10) / (1.00 - 0.10) = 1.15 / 0.90 ≈ 1.28 requests
Anthropic 1h TTL: N ≥ (2.00 - 0.10) / (1.00 - 0.10) = 1.90 / 0.90 ≈ 2.11 requests
Verdict: On Anthropic's 5-minute cache, you need at least 2 requests within the 5-minute sliding TTL window to break even and profit. On request #2, your net prompt costs drop below uncached rates. By request #10, your prompt costs are cut by over 80%.
β οΈ The 5-Minute TTL Expiration Trap (Why Developers Lose Money)
The single most common mistake reported on Hacker News and Reddit is enabling Anthropic prompt caching on low-traffic background jobs or sporadic API endpoints:
- The Sliding Window Rule: Anthropic's 5-minute TTL timer is refreshed every time a request hits the cache. If requests arrive every 3 minutes, the cache stays hot indefinitely.
- The Expiration Disaster: If your requests arrive every 6 to 10 minutes (less than 12 requests per hour), the cache evicts between every call. Every single request is treated as a fresh cache write, incurring the 1.25Γ write penalty every time without ever hitting a 0.10Γ read!
- The Fix: For workloads with low or intermittent frequency, either upgrade to Anthropic's 1-hour extended caching (which gives a 60-minute window) or keep caching disabled until traffic reaches steady-state.
Frequently Asked Questions
How does Anthropic Claude prompt caching pricing work? βΎ
Anthropic Claude (including Claude 3.7 Sonnet, Claude 3.5 Sonnet, and Claude 3.5 Haiku) uses an ephemeral prompt caching model. When you write a prompt prefix (minimum 1,024 tokens for Sonnet/Opus, 2,048 tokens for Haiku) into the cache with a 5-minute TTL, Anthropic charges 1.25x the base input token price for the initial cache write. Subsequent requests that hit the cached prefix receive a 90% discount (charged at 0.10x base input price). Anthropic also offers an optional 1-hour extended cache write charged at 2.0x base price with the same 0.10x read discount.
What is the break-even point for Claude prompt caching? βΎ
For Anthropic's 5-minute ephemeral cache, the mathematical break-even point is exactly 1.28 requests per cache write. That means if you make at least 2 requests within the 5-minute TTL window before the cache expires, caching is guaranteed to save money. For Anthropic's 1-hour extended cache (2.0x write fee), the break-even point is 2.11 requests (at least 3 requests per hour).
Does OpenAI charge for prompt cache writes? βΎ
No! Unlike Anthropic, OpenAI does not charge any upfront write premium for prompt caching. Cache writes on GPT-4o, GPT-4o mini, o1, and o3-mini cost 1.0x the standard base input price (free write markup). When a prompt prefix of 1,024+ tokens matches an existing cache entry, OpenAI applies an automatic 50% discount on cached input tokens ($1.25/1M on GPT-4o). Therefore, on OpenAI, any cache hit produces instant cost savings with a break-even threshold of 1 request.
What is the Cache Expiration Trap and how do I avoid it? βΎ
The Cache Expiration Trap occurs when developers enable Anthropic prompt caching on low-traffic endpoints where requests arrive more than 5 minutes apart. Because the 5-minute TTL expires before the next request arrives, every single call incurs the 1.25x cache write fee without ever scoring a 0.10x cache read hit. In this scenario, caching actually increases your prompt costs by 25%! To avoid this trap, ensure your traffic meets minimum velocity (~12+ requests/hour), use the 1-hour extended TTL, or disable caching on sporadic endpoints.
How does prompt caching reduce API latency and Time-To-First-Token (TTFT)? βΎ
Prompt caching stores the precomputed Key-Value (KV) attention states of your system prompt and context documents directly in the provider's GPU memory. When a cached request arrives, the model skips the entire compute-intensive prompt processing (prefill) phase and jumps directly to token generation. For long prompts (15k to 50k tokens), prompt caching reduces Time-To-First-Token (TTFT) by up to 80% to 85%.
How does DeepSeek prompt caching compare to Claude and OpenAI? βΎ
DeepSeek (V3 and R1) features native context caching operating at an ultra-fine 64-token granularity. DeepSeek charges standard input rates on cache misses and grants a 74% to 75% discount on cached tokens ($0.07/1M on V3, $0.14/1M on R1). Like OpenAI, DeepSeek does not charge an upfront cache write premium, making caching automatically beneficial across multi-turn agent conversations.
How do I structure my prompts to maximize cache hit rate? βΎ
To trigger prompt caching, the prompt prefix must be 100% byte-identical from token #1. Place static components first: system instructions, tool definitions, schemas, and static reference documentation. Place dynamic elements (such as timestamps, session UUIDs, and user messages) strictly at the very end of the prompt array. Changing even a single character or whitespace in the middle of a system prompt invalidates the entire downstream cache.