Prompt Caching Savings: The Real Numbers

What prompt caching actually saves on coding agents: cache reads at 10% of input, the cache-write premium, real production reductions of 59–70%, and why a stable prefix is the whole game — all from primary sources.

Profile photo of Paul Irolla

By Paul Irolla

Founder · AI & developer tools · Tokenade

Ph.D. in AI · builds token-optimization tooling for AI coding agents

View author page
10 min read
Cite this page

Key figures

TL;DR
  • 10%
    cost of a cache-read token vs. a fresh input token on Anthropic — a 90% discount on repeated context
    Anthropic, Prompt Caching docs, platform.claude.com (2026)
  • 1.25× / 2×
    cache-write premium over base input price for a 5-minute TTL / 1-hour TTL on Anthropic
    Anthropic, Prompt Caching docs, platform.claude.com (2026)
  • 59–70%
    LLM cost reduction ProjectDiscovery's agentic security system achieved with prompt caching (59% initial, 70% after tuning)
    ProjectDiscovery, 'How We Cut LLM Costs by 59% With Prompt Caching' (2026)
  • 93%+
    cache hit rate GitHub reached on repeated context by keeping system prompts and tool definitions byte-stable across turns
    GitHub Blog, 'Improving token efficiency in GitHub Agentic Workflows' (2026)
  • 90%
    discount on cached input tokens for GPT-5-class models on OpenAI (cached input billed at 10% of base), applied automatically
    OpenAI, Prompt Caching docs, developers.openai.com (2026)
  • 1,024
    minimum prompt length in tokens before OpenAI's automatic caching engages at all
    OpenAI, Prompt Caching docs, developers.openai.com (2026)
Prompt caching is the single highest-leverage cost lever on a coding agent, and the headline number is simple: a cache-read token on Anthropic costs 10% of a fresh input token — a 90% discount on whatever context you re-send unchanged. [1] This page collects the real caching numbers — discount rates, the write premium, breakeven math, and the production reductions teams have actually published — from primary sources, so they sit in one place. All figures are quoted as of June 2026. Caching mechanics and multipliers change (Anthropic quietly changed a default TTL mid-March 2026 — more on that below), so re-verify at the primary source before quoting commercially.

Key Takeaways

Key numbers at a glance

  • A cache read costs 10% of base input on Anthropic — a 90% discount on repeated context. [1]
  • Cache writes carry a 1.25× premium for a 5-minute TTL and 2× for a 1-hour TTL; the write pays for itself after one re-read (5-min) or two re-reads (1-hour). [1]
  • ProjectDiscovery's agentic security system cut LLM costs by 59% with caching, rising to 70% after tuning. [2]
  • GitHub reached a 93%+ cache hit rate in production agentic workflows by keeping prompts and tool definitions byte-stable. [3]
  • OpenAI gives GPT-5-class models a 90% discount on cached input automatically, but only once a prompt crosses 1,024 tokens. [4]
  • The discount is worthless if the prefix isn't byte-identical — a single reordered instruction invalidates the whole cache. [1]

What does a cache read actually cost on Anthropic?

A cache-read token is billed at 10% of the base input price on Anthropic's prompt caching — so on Claude Sonnet 4.6 ($3.00/MTok input) a cache hit costs $0.30/MTok, and on Claude Opus 4.8 ($5.00/MTok input) it costs $0.50/MTok. [1] That is a 90% discount on every token the model re-reads from a cached prefix instead of reprocessing it. This is the number that matters because of how agents actually run. An agent re-reads its full context — system prompt, tool definitions, conversation history, file contents, command output — on every single tool call. By turn 30 of a debugging session it is paying to re-read tens of thousands of tokens of accumulated history on every request. Caching is what turns that re-read from full price into a tenth of the price. For the underlying mechanics, the prompt caching and context window glossary entries cover the accumulation pattern that makes this worth so much.
ModelBase input ($/MTok)Cache read ($/MTok)5-min write ($/MTok)1-hour write ($/MTok)
Claude Opus 4.8$5.00$0.50$6.25$10.00
Claude Sonnet 4.6$3.00$0.30$3.75$6.00
Claude Haiku 4.5$1.00$0.10$1.25$2.00

Cache read = 0.1× base input; 5-min write = 1.25× base input; 1-hour write = 2× base input. Source: Anthropic, Prompt Caching docs (platform.claude.com, June 2026) [1]

What is the cache-write premium, and when does it pay off?

Writing to the cache is not free: a cache-write token costs 1.25× the base input price for a 5-minute TTL and 2× for a 1-hour TTL on Anthropic. [1] You pay that premium once, when the prefix is first cached, and then read it back at 10% of base for as long as it stays warm. The breakeven is generous. With the 5-minute cache, a single re-read already beats paying full input price twice. With the 1-hour cache, two re-reads cover the 2× write. Concretely, for a stable 10,000-token prefix (system prompt plus tool definitions) on Sonnet 4.6 across a 50-turn session:
  • Without caching: 10,000 × 50 × $3 / 1,000,000 = $1.50 for that static block alone.
  • With caching (1 write + 49 reads, 5-min TTL): (10,000 × 1.25 × $3 / 1,000,000) + (10,000 × 49 × $0.30 / 1,000,000) = $0.038 + $0.147 = $0.185 — roughly an 88% reduction on that block.
The arithmetic is boring on purpose. The point is that the write premium is a rounding error against the read savings the moment a prefix is reused even a handful of times, which is exactly what an agentic loop does.

How much do real teams actually save?

ProjectDiscovery, who run an agentic security system called Neo, published the cleanest production number I've seen: caching cut their LLM costs by 59%, climbing to 66% after further optimisation and 70% over their last measured ten days. [2] Their setup is a textbook case for caching — system prompts over 20,000 tokens of YAML per agent, an average of 26 steps and 40 tool calls per task, and the entire conversation re-sent on every step. A single complex Opus task burned 60 million tokens before they touched caching. [2] GitHub's measured result is about hit rate rather than dollars: they hit a 93%+ cache hit rate on repeated context in their own agentic workflows by keeping tool definitions and system prompts stable across turns. [3] That is the upstream metric — your dollar savings are roughly the hit rate times the 90% per-token discount on the cached portion of your prompt.
59–70%
total LLM cost cut on a production agentic system with caching
Source: ProjectDiscovery, 2026 [2]
93%+
cache hit rate on repeated context with byte-stable prompts
Source: GitHub, 2026 [3]
A blunt caveat on the 59–70% figure: it is a percentage of what they were already spending, on a workload that is unusually cache-friendly (huge stable prefix, dozens of re-reads). Your mileage scales with how much of your prompt is genuinely identical turn-to-turn. The savings live in the stable prefix, not in the headline percentage.

How does OpenAI's caching compare?

OpenAI caches automatically — no cache_control breakpoint, no code change — and for GPT-5-class models the cached portion of the prompt is billed at 10% of input, a 90% discount, the same magnitude as Anthropic. [4] The structural differences matter more than the rate:
  • Minimum length: OpenAI caching only engages once a prompt crosses 1,024 tokens; below that, nothing is cached and cached_tokens reports zero. [4] Anthropic similarly enforces a minimum cacheable prefix (1,024 tokens on most current models, 2,048 on the smallest).
  • No write premium: OpenAI charges nothing extra to populate the cache, whereas Anthropic charges the 1.25×/2× write. The flip side is control — Anthropic lets you decide exactly where the cache boundary sits, which is what makes a 93%+ hit rate achievable on purpose rather than by luck.
  • Discount varies by model: OpenAI's cached-input discount is 50%, 75%, or 90% depending on the model; GPT-5-class lands at 90%. [4] Don't assume the top discount on an older or smaller model.
ProviderCache read discountWrite premiumActivationMin. prefix
Anthropic (Claude)−90% (10% of input)1.25× (5-min) / 2× (1-hour)explicit cache_control1,024 tokens
OpenAI (GPT-5.5)−90% (10% of input)noneautomatic1,024 tokens

GPT-5.5 base pricing is $5/$30 per MTok input/output; cached input bills at 10% of input on GPT-5-class models. Sources: Anthropic [1], OpenAI [4] (June 2026).

Why does a byte-identical prefix decide everything?

The discount is gated on an exact prefix match: the cached block must be byte-identical across requests, and any change — even reordering instructions or appending a token before the cached region — invalidates the cache and forces a full-price reprocess. [1] This is the part teams get wrong. A timestamp in the system prompt, a per-request user ID injected near the top, a tool list that re-sorts itself — each one silently drops your hit rate to zero and you keep paying full input price while believing caching is on. It also breaks in ways you don't control. In March 2026 Anthropic changed a default cache TTL behaviour from one hour to five minutes, and a wave of Claude Code users saw cost and quota inflation before anyone identified the cause. [5] The lesson isn't "caching is unreliable" — it's that caching is a measurement problem as much as a configuration one. If you aren't watching your cache-read-to-input ratio, you won't notice when it regresses. This is exactly the bookkeeping I built Tokenade to handle: it keeps the cacheable prefix stable across an agent's turns, prunes the volatile context that would otherwise bust the cache, and surfaces your cache-hit ratio on a savings dashboard so a TTL change or a stray timestamp shows up as a line on a chart instead of a surprise on the invoice. It plugs into Claude Code, Cursor, Codex, Copilot, and Windsurf, and the engine is source-available (MIT). The free tier covers up to ≈10M tokens a month; Pro is $19.90/mo (excl. tax) with unlimited machines. For the broader cost picture these savings sit inside, see AI coding agent token costs and the practical reduce AI coding agent token usage playbook. The output filtering entry covers the complementary lever on what the model writes back.

Source notes

Cache-read, cache-write multipliers and the byte-identical-prefix requirement are from Anthropic's prompt caching documentation (primary source). OpenAI's automatic caching, 90% GPT-5-class discount, and 1,024-token minimum are from OpenAI's prompt caching docs (primary source). The 59–70% reduction is a published vendor engineering case study (ProjectDiscovery — production data, not an academic study). The 93%+ cache hit rate is from GitHub's engineering blog. The March 2026 TTL change is documented in a public Claude Code issue (secondary/community source, included because it illustrates a real regression, not as a pricing figure). Re-verify all figures at primary sources before commercial use.

Sources and references

  1. [1]Anthropic. "Prompt caching — Claude API Docs". platform.claude.com, 2026. Link ↗
  2. [2]ProjectDiscovery. "How We Cut LLM Costs by 59% With Prompt Caching". projectdiscovery.io, 2026. Link ↗
  3. [3]GitHub. "Improving token efficiency in GitHub Agentic Workflows". github.blog, 2026. Link ↗
  4. [4]OpenAI. "Prompt caching — OpenAI API". developers.openai.com, 2026. Link ↗
  5. [5]anthropics/claude-code. "Cache TTL silently regressed from 1h to 5m around early March 2026". GitHub issue #46829, 2026. Link ↗

Ranked #1 on the Token-Harness Optimizer Leaderboard.

Tokenade ranks #1 in the Token-Harness Optimizer Leaderboard — an end-to-end benchmark of agent token optimizers measured on real coding sessions. Set it up once, it works on every prompt. Works with Claude Code, Cursor, Codex, Copilot & more.