Prompt Caching Explained:
How to Cut LLM Costs by Up to 90%
Prompt caching lets you reuse repeated context (system prompts, documents, knowledge bases) across API calls at a fraction of the input token cost. On Anthropic's Claude API in October 2026, cached reads cost 90% less on Haiku 5.5, 95% less on Sonnet 5.5 and Opus 5.5, and 97.5% less on Fable 5.1. Last verified: 2026-10-16.
What Is Prompt Caching?
Normally, every API call sends the full prompt (system prompt + context + user message) to the model. The provider charges for every token on every call — even if most of the prompt is identical across requests.
With prompt caching, the provider processes the static portion of your prompt once, stores it server-side, and on subsequent calls reads the cached version at a steeply discounted rate. You pay full price to write the cache once, then a fraction to read it on every subsequent call.
Anthropic Prompt Caching Pricing (October 2026)
| Model | Standard Input | Cache Write (5m) | Cache Write (1h) | Cache Read | Savings |
|---|---|---|---|---|---|
| Claude Haiku 5.5 (≤100K prompt) | $0.10 | $0.125 | $0.20 | $0.01 | 90% |
| Claude Sonnet 5.5 | $2.00 | $2.50 | $4.00 | $0.10 | 95% |
| Claude Opus 5.5 | $4.00 | $5.00 | $8.00 | $0.20 | 95% |
| Claude Fable 5.1 | $10.00 | $12.50 | $20.00 | $0.25 | 97.5% |
| Claude Haiku 4.5 (legacy) | $1.00 | $1.25 | $2.00 | $0.10 | 90% |
Cache TTL options: 5-minute cache is sufficient for high-frequency applications where the same context is reused within a short window. 1-hour cache (higher write cost) is appropriate for knowledge bases and documents that change rarely but need to be available longer between reads.
When Prompt Caching Saves Money
Caching is most valuable when:
- Large static context: System prompts, knowledge bases, or documents that are the same across many user requests
- High call volume: The more calls reuse the cached context, the more you save
- Repeated document processing: Sending the same document to multiple users or processing it multiple times
- RAG with shared context: A fixed set of documents retrieved for many queries
- Agent frameworks: Large agent system prompts repeated across every tool call in a multi-step workflow
Savings Calculator
Formula for monthly savings from prompt caching:
Example: SaaS with 1,000-token system prompt, 100,000 calls/month on Sonnet 5.5
- Standard: 100K × 1K tokens × $2.00/M = $200/month
- With 5-min cache: ~200 writes × 1K tokens × $2.50/M + 99,800 reads × 1K × $0.10/M = $0.50 + $9.98 = $10.48/month
- Savings: $189.52/month (94.8%)
Example: Document analysis app with 10,000-token document, 5,000 analyses/month on Sonnet 5.5
- Standard: 5K × 10K tokens × $2.00/M = $100/month
- With 5-min cache (assuming 1 write per analysis, ~90% cache hit): 500 writes × 10K × $2.50/M + 4,500 reads × 10K × $0.10/M = $12.50 + $4.50 = $17.00/month
- Savings: $83.00/month (83%)
When Caching Does NOT Help
- Short or unique prompts: If every user sends a different prompt with little shared content, there's nothing to cache
- Low call volume: The cache write cost upfront only pays off when the same context is read many times — below ~5 reads, the economics are neutral
- Rapidly changing context: If your system prompt or document changes frequently, each change invalidates the cache, requiring a new write at full price
- Budget-tier models with cheap standard pricing: If you're already on GPT-6 Luna at $0.10/M, the absolute savings from caching are smaller even if the percentage is similar
How to Implement (Claude API)
The cache_control: { type: "ephemeral" } flag signals Anthropic to cache this content block. On the first call, it writes the cache. On subsequent calls within the TTL window, you'll see cache_read_input_tokens in the usage object confirming the cache hit.
Practical Architecture Patterns
Pattern 1 — Large system prompt caching
Place all static instructions, persona definition, and tool descriptions in the system array with cache_control. Keep only the dynamic user message uncached. Most appropriate for: customer support bots, internal assistants, chatbots with rich personas.
Pattern 2 — Document pre-loading
Load a document or knowledge base into the first user message with cache_control, then send multiple follow-up questions about the same document. The document is cached; only each question incurs full input cost. Most appropriate for: legal review, financial analysis, multi-query document processing.
Pattern 3 — Agent context caching
Cache the agent's large system prompt (tool definitions, instructions, examples). Only the current conversation turn and tool results are uncached. Each step in a multi-step agent workflow then pays only for the new tokens. Most appropriate for: coding agents, research agents, workflow orchestration.
Frequently Asked Questions
Does OpenAI offer prompt caching?
Yes. OpenAI's price list has a separate cached-input rate for every GPT-6 model: $0.01/M on GPT-6 Luna, $0.10/M on GPT-6.1 Sol and $1.00/M on GPT-6 Astra (90–95% off). Anthropic's version is explicit — you mark the cacheable prefix with cache_control — so check OpenAI's documentation for how its caching is triggered before you rely on the discount.
What's the minimum content size to cache?
On the current Claude models (Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5) the minimum cacheable prefix is 512 tokens; on the legacy Haiku 4.5 it is 4,096 tokens. Shorter prefixes are processed without caching and the API returns no error, so check the cache_creation_input_tokens and cache_read_input_tokens usage fields to confirm caching is working.
Does caching affect response quality?
No. A cached prompt is processed identically to a non-cached one — the model sees the same context. Caching is purely an infrastructure optimization; it has no effect on model behavior, response quality, or output determinism.
Can I cache multiple sections?
Yes. You can apply cache_control to multiple content blocks in the same request (system prompt, document 1, document 2, etc.), each with its own cache TTL. Each block is cached and billed independently.
Calculate Your Caching Savings
Enter your system prompt size and call volume to see how much prompt caching saves per month.
Open AI API Cost Calculator