Benchmark Study #3

Prompt Caching Hit-Rate Cost Savings Benchmark

Vendors advertise 'up to 90%–95% off input tokens,' yet real savings depend on cache write surcharges, traffic arrival intervals, and output token ratios. Here is the exact break-even math.

Rate Card & Spec Audit: Published by: ShiftFrameLabs Data Processing: 100% Local Client-Side Browser Math

What Hit Ratio Is Required for Ephemeral Prompt Caching to Break Even?

Direct Answer Summary (Verified 2026-12-01)

On explicit-cache APIs charging 1.25x base input for cache writes and 0.10x for cache reads, prompt caching breaks even at a 21.7% cache hit ratio (~0.28 reads per write, or 1.28 total calls per cold write). At a 91.8% burst hit ratio on a 64K system context, total end-to-end spend (including uncached outputs) drops by 67.8%.

Modeled Savings Across Traffic Arrival Patterns (64K Shared Prefix, $3/$15 Reference Tier)

Calculated per 1,000 calls assuming a 64,000-token cacheable prefix, 2,400 output tokens per call ($36.00/1K calls), 1.25x ($3.75/1M) cold cache writes, and 0.10x ($0.30/1M) warm cache reads:

Traffic Cadence (5-Min TTL Window) Cache Hit % Input Cost / 1K Calls Total Cost (incl. Output) Net Change vs. No Cache
Uncached Baseline (Control) 0.0% $192.00 $228.00 0.0%
Sparse Cron (1 call every 7 mins) 4.2% $230.73 $266.73 +17.0% (Loss)
Moderate Daytime SaaS (1 call / 90s) 76.5% $71.09 $107.09 -53.0%
Multi-Turn Agent Burst (8 steps / 45s) 91.8% $37.31 $73.31 -67.8%

Why Prompt Ordering Breaks Prefix Hit Rates

Prefix caches hash tokens sequentially from index 0. Injecting a dynamic Current_Timestamp or user ID on line 3 of your system prompt invalidates the remaining 63,950 tokens on every call.

// Correct Deterministic Prefix Ordering for >90% Cache Hits:
// [1] Static System Instructions + Safety Policy (Cached)
// [2] Alphabetically Sorted Tool Definitions (Cached)
// [3] Static Codebase / Reference Manual Context (Cached Breakpoint)
// [4] Dynamic Session Variables, Timestamps & User Turn (Uncached Suffix)
Key Takeaway for Low-Traffic Apps If your endpoint receives fewer than 12 requests per hour during off-peak hours, disable explicit cache-write breakpoints on providers that charge write surcharges, or group queued jobs into 4-minute micro-batches. Test your exact hit ratio in the Agent Cost Simulator.

Frequently Asked Technical Questions

Why does randomizing JSON dictionary keys in tool schemas destroy cache hits?

LLM tokenizers serialize tool schemas into text before hashing the prefix. Non-deterministic key ordering in Python or Go maps changes the serialized token sequence, causing silent cache misses.

Do automatic prefix caches charge a 1.25x write penalty?

OpenAI's automatic prompt caching and Google Gemini 4's implicit caching apply 0x per-token write surcharges with 75%–95% read discounts (e.g., $0.15/1M on Gemini 4 Neon's $3.00 base), whereas Anthropic's explicit cache control charges 1.25x (5-min TTL) or 2.0x (1-hr TTL) on writes alongside a 90%–95% read discount.

Does prompt caching also reduce Time-To-First-Token (TTFT) latency?

Yes. Skipping KV-state prefill computation across a 64K cached prefix typically reduces Time-To-First-Token (TTFT) by 70% to 85% compared to cold prefill.