Prompt Caching Economics Compared Across Providers

Prompt caching can lower the cost of repeated input, but a cache discount is not the same as a discount on your whole application. Cache writes, fresh input, output, storage and retries still need to appear in the bill. Compare providers with a fixed workload and measured usage, rather than a headline percentage.
The table below summarises documentation checked on 10 October 2026. The worked calculation is hypothetical; it is not a benchmark we ran against a paid API or a forecast of your cache-hit rate.
Compare the billing categories before the rates
| Provider | Documented cache behaviour | Cost category to verify |
|---|---|---|
| OpenAI | For GPT-5.6 and later: writes at 1.25× uncached input; reads usually 0.1×, or 0.05× for GPT-6.1 Sol | Keep cache writes separate from uncached input; earlier model families have different rules |
| Anthropic | 5-minute writes at 1.25×; 1-hour writes at 2×. Reads are model-dependent, including 0.1×, 0.05× and 0.025× cases | Use the exact model’s row and selected TTL |
| Gemini API | Supports implicit and explicit caching on supported models | Check cached-token pricing and explicit-cache storage charges |
| DeepSeek | Automatic prefix caching with reported hit and miss tokens | Use current model pricing; old launch-announcement rates are not a current quote |
Read the provider references directly: OpenAI caching, Anthropic caching, Gemini caching and DeepSeek caching. A cache write is a billing class, not a universal extra fee added to every input token.
A reproducible small workload
Define ten requests. Each contains the same 4,096-token prefix, a different 512-token suffix and a 256-token answer. Assume one prefix write and nine full reads. These are controlled assumptions: a production trace may contain misses, partial reuse or different outputs.
For this arithmetic only, use rates of US$2 per million ordinary input tokens, US$2.50 for writes, US$0.10 for reads and US$10 for output. They match the standard short-context GPT-6.1 Sol row on the pricing page at review time. Other processing tiers, long context, tools and regional processing can change the bill.
| Component | Without caching | One write, nine reads |
|---|---|---|
| Repeated prefix | 40,960 × 2 ÷ 1,000,000 = 0.0819200 | 4,096 × 2.50 ÷ 1,000,000 + 36,864 × 0.10 ÷ 1,000,000 = 0.0139264 |
| Fresh suffix | 5,120 × 2 ÷ 1,000,000 = 0.0102400 | 0.0102400 |
| Output | 2,560 × 10 ÷ 1,000,000 = 0.0256000 | 0.0256000 |
| Total | 0.1177600 | 0.0497664 |
The prefix cost falls by 83% in this example. Total cost falls by about 57.7%, because fresh input and output remain. The calculation excludes tools and retries, so add them before projecting a monthly budget.
A worksheet for a real comparison
- Version a small set of representative prompts, expected outcomes and permission checks.
- Record model, region, tier, cache mode, prefix length and spacing between requests.
- Keep fixed context unchanged and place changing input after it.
- Collect fresh-input, cache-write, cache-read and output usage according to each provider’s fields.
- Record failed calls, retries, elapsed time and whether the output passed the same evaluation.
- Compute total spend divided by accepted outputs. Compare this with uncached spend and review any quality change.
Use a row per request. For example: request ID, input classes, output tokens, tool cost, retry count, latency and accepted/rejected. Do not call a provider cheaper if it produced fewer usable answers or required more manual repair.
When the write premium does not pay back
For a fixed prefix, a write multiplier w, read multiplier r and N requests, the ideal cached cost in ordinary-input equivalents is w + (N − 1)r. The uncached cost is N. This comparison assumes the same prefix length, full reuse and no separate storage charge.
A new prefix on every request, a cache lifetime shorter than the request interval or larger prompts added only to reach a threshold can remove the saving. Measure the workload that actually runs. Combine the worksheet with an evaluation pipeline and our model-routing guide before changing production routing.
Keep exploring
Artificial Intelligence
Test Bedrock Geo Inference Failover Without Leaving EU
Artificial Intelligence
RAG Ingestion Retries: Idempotent Chunk Indexing Guide
Artificial Intelligence
RAG Citation Verification: A Test Plan for AI Teams
Artificial Intelligence