Prompt caching is the largest discount most teams can get without changing models. The vendors publish the rules, and they differ enough that a saving quoted for one does not carry over to another. Every price below was read from the vendor's own pricing page on 18 October 2026. Prices change, so check the pages before you budget.
What the three vendors publish
| Vendor | Cache write | Cache read | Lifetime |
|---|---|---|---|
| Anthropic | 1.25x base input for 5 minutes, 2x for 1 hour | 0.1x base input, except 0.05x on Opus 5.5 and Sonnet 5.5 and 0.025x on Fable 5.1 | 5 minutes, refreshed free on each use, or 1 hour |
| OpenAI | GPT-5.6 and later: 1.25x input | GPT-5.6 and later: 0.1x input, 0.05x for GPT-6.1 Sol | GPT-5.6 and later: 30 minutes. Earlier models: in memory or 24h retention |
| Gemini lists a context caching price per million tokens, plus a storage price per million tokens per hour on some models | Example: Gemini 3.8 Flash caching is $0.075 against $0.75 input | Billed by storage time where a storage price is listed |
Anthropic's page says a 5 minute write pays for itself after one cache read, and a 1 hour write after two. OpenAI's guide says cached input is discounted "up to 95%". Gemini 4 Argon is listed as implicit caching only, with no storage price.
A worked example
Take a made up agent session: 40 turns on Claude Sonnet 5.5, a 20,000 token prefix that never changes, 3,000 new input tokens and 600 output tokens per turn. Sonnet 5.5 is listed at $2 input, $2.50 for a 5 minute cache write, $0.10 per cache read and $10 output, all per million tokens.
Without caching: 40 turns x (23,000 x $2 + 600 x $10) per million, which is $2.08.
With caching: one write of the prefix ($0.05), 39 reads ($0.078), new input at full price ($0.24) and output ($0.24). Total $0.61.
That is about 71 percent less on this invented session. The same session on Opus 5.5 goes from $4.16 to $1.22, and on Fable 5.1 from $10.40 to $2.85. These are list price estimates for a scenario, not measured bills. Your saving depends on how much of each request really is a stable prefix.
Calculator
# prices in USD per million tokens, from the vendor page
inp, write, read, out = 2.00, 2.50, 0.10, 10.00 # Sonnet 5.5
turns, prefix, new, outt = 40, 20000, 3000, 600
no_cache = turns * (prefix + new) * inp / 1e6 + turns * outt * out / 1e6
cache = (prefix * write + (turns - 1) * prefix * read
+ turns * new * inp + turns * outt * out) / 1e6
print(round(no_cache, 2), round(cache, 2))
Change the four prices to another model and the saving changes with them.
When caching does not save money
- The prefix is shorter than the minimum. Anthropic lists 512 tokens for its newest models and 4,096 for Opus 4.6, Opus 4.5 and Haiku 4.5. Shorter prompts are processed without caching and no error is returned. OpenAI lists 1,024 tokens for GPT-5.6 and later.
- The prefix changes. Anthropic says cache hits need identical segments, and a change in tool definitions, tool choice or images invalidates parts of the cache.
- Requests are too far apart. After the lifetime ends you pay the write price again.
- The prompt is over a price bracket. Anthropic says Claude Haiku 5.5 prompts over 100,000 tokens pay higher prices, and that cache reads count toward that length.
How to check your own hit rate
Anthropic returns cache_creation_input_tokens and cache_read_input_tokens in usage. OpenAI returns usage.input_tokens_details.cached_tokens. If both Anthropic numbers are zero on every call, nothing was cached. OpenAI's guide suggests tracking cached tokens divided by total input tokens over time.
If you connect Safeguard to an agent over MCP, tool calls are unlimited, and you can bring your own model, so these provider settings are the ones that decide your model bill.
Quick check
Why can a long cached prompt still cost more on Claude Haiku 5.5?
The page prices a request by its total prompt length, including cache reads and writes. Over 100,000 tokens the higher bracket applies, even on a cache hit.
Sources
- Claude API pricing, fetched 18 October 2026
- Claude prompt caching, fetched 18 October 2026
- OpenAI prompt caching guide, fetched 18 October 2026
- OpenAI API pricing, fetched 18 October 2026
- Gemini API pricing, fetched 18 October 2026