erabot.ai
ProductPricingCase studiesEvalBlogDocs
Book a demo

Provider prompt caching in 2026: the discounts, and the fine print

TL;DR: The prompt caching discount is real and large — OpenAI starts at 50% off cached input and goes higher on its newest models, Gemini 2.5 implicitly discounts shared prefixes by roughly 75%, and Anthropic reads cached tokens at about 10% of the base input price. But the fine print splits hard by provider: OpenAI and Gemini cache automatically with no code change, while Anthropic needs explicit markers and charges a premium to write the cache — which means caching only pays when the prefix is reused enough to earn that write back. The one portable code change is prompt ordering: stable content first, variable content last. And turning caching on changes what your token counter reports, which can silently break a budget guard — so test that before you ship.

What the discount actually applies to

Caching discounts the repeated prefix of your prompt — the part that is byte-for-byte identical from one call to the next. A system prompt, a block of tool schemas, a long set of few-shot examples, a document you keep asking questions about: send that same leading chunk again and the provider bills it at a steep discount instead of full input price.

This is why caching is the highest-leverage fix on anything that loops. If the same large prefix rides along on every agent turn or every request, you are paying full freight for tokens the model has already processed. That re-sent context is frequently the biggest single line on an agent's bill — the mechanism, and why it dominates, is the subject of The 62% problem.

What each provider offers in 2026

The headline rates are generous, but the shape of the deal is different in each case. Rates and thresholds below are current as of this writing and move over time, so treat them as a snapshot, not a constant.

OpenAI. A 50% baseline discount on cached input tokens, applied automatically, with a 1,024-token minimum prefix before caching kicks in. No code change required — you order your prompt well and the platform does the rest. On the newest models the discount is higher, reported up to roughly 90%, so the exact number is model-dependent. (Source: openai.com/index/api-prompt-caching.)

Google Gemini 2.5. Implicit caching gives roughly a 75% discount on matching shared prefixes, automatically, with no explicit cache step to call. Like OpenAI, this is a "do nothing extra" discount — the platform detects the shared prefix and prices it down. (Source: developers.googleblog.com, Gemini implicit caching.)

Anthropic. The deepest read discount of the three: cache reads are billed at about 10% of the base input rate — roughly 90% off. The catch is on the other side of the ledger. Cache writes carry a premium over normal input — about 1.25× the base rate for the 5-minute cache and 2× for the 1-hour cache — and you have to add explicit cache_control breakpoints in your code to mark what gets cached. So Anthropic is the only one of the three where caching is a code change, not a free default. (Source: docs.claude.com, prompt caching.)

The thing to carry out of this section: "no code change required" is an OpenAI and Gemini property, not a universal one. Advice that says caching is always automatic and always free is quietly describing two providers and ignoring the third.

The one code change that is portable: order your prompt

There is exactly one author-time pattern that helps on every provider, and it is small: put the stable content at the start of the prompt and the variable content at the end.

Caching keys on the longest identical leading run of tokens. If your system prompt and tool schemas come first and the user's unique input comes last, the whole stable front is one long cacheable prefix. Flip it — interleave a timestamp, a per-request ID, or the user's text near the top — and you shorten or break the prefix, and the discount shrinks or disappears. Nothing errors; you just quietly stop getting the rate.

This is the rare caching fix that is a real, detectable, static code edit rather than a platform setting. It costs nothing, it helps everywhere, and it is the first thing to check when a cache hit rate looks lower than it should. It is one of the patterns we cover in the broader LLM cost optimization guide.

When caching pays — and when it quietly doesn't

On OpenAI and Gemini, the discount is close to free money: the platform caches automatically, you are not charged a premium to create the cache, so a well-ordered prompt essentially can't lose. Order it well and move on.

Anthropic is where you have to do the arithmetic, because the write premium means caching can cost you more if the prefix is not reused. The logic, derived straight from the published rates above (and so an illustration of the break-even, not a measured dollar figure):

  • Writing a prefix to the 5-minute cache costs about 1.25× base — i.e. roughly 0.25× base more than just sending it uncached once.
  • Each later read of that cached prefix costs about 0.1× base instead of 1× — a saving of about 0.9× base per reuse.
  • So a single reuse inside the window already earns back the 5-minute write premium and then some. For the 1-hour cache the write premium is larger (about 2× base, so ~1× base extra), and it takes on the order of two reuses to clear it.

The practical rule: caching a prefix you reuse many times inside the window is a clear win; caching a prefix you touch once and discard is a small loss. Cache the things that genuinely repeat — the standing system prompt, the fixed tool schemas, the long shared document — and don't bother marking content that changes every call. Actual break-even depends on your prefix size and how often it is really reused, so measure it on your own traffic rather than trusting the back-of-envelope.

The gotcha that isn't on the pricing page

One more piece of fine print, and it has nothing to do with the rate: turning caching on changes what the input_tokens counter reports. Cached tokens get moved into separate usage fields, so any budget check, context-window guard, or truncation rule that reads input_tokens as "how big is this request" can silently under-count once caching is live — and the error grows as your hit rate climbs. It was a real production bug, and the direction of the breakage is provider-specific. We wrote up the incident and the fix in The caching trap; if you are about to enable caching, read that before you do, because the failure is silent.

Where erabot fits

We will not charge you to "discover" prompt caching — on two of the three providers it is already free and automatic, and we would rather tell you that than dress up a platform default as a finding. What is genuinely worth catching in code is the stuff that quietly costs money: a prompt ordered variable-first so the discount never lands, an Anthropic prefix marked for caching that is never reused enough to earn the write premium back, and a budget guard still reading input_tokens after caching moved the tokens elsewhere. erabot scans your repo (or any public one) for exactly those patterns, marks every volume assumption as an assumption, and the verified audit shadow-tests any model swap to prove quality holds before you ship it. Start at erabot.ai.

Rates and thresholds in this piece come from the providers' own documentation — openai.com/index/api-prompt-caching, developers.googleblog.com (Gemini implicit caching), and docs.claude.com (prompt caching) — and change over time; the break-even figures are derived from those published rates and are illustrative, not measured.

EB
erabot.ai

Scan any codebase. See exactly what you spend on AI. Get one-click fixes.

No spam. Only launch updates and cost optimization tips.

Product

  • Product
  • CLI
  • Pricing
  • Changelog
  • Docs

Resources

  • Example audit
  • Blog
  • Case studies
  • Eval

Company

  • Security
  • Privacy
  • Terms
  • Support

© 2026 erabot.ai. All rights reserved.