Does prompt caching save money?
Yes, when many requests start with the same long block of text, such as instructions, tool definitions or a shared document. Cached input is billed at a fraction of the normal input price: at Anthropic and on OpenAI's newer models, cache reads cost 0.1 times the base input rate or less. Writes to the cache can cost more than normal input, so savings depend on how often the prefix is reused.
Last updated
How the billing works
With prompt caching the provider stores the processed start of your prompt. When the next request starts with exactly the same prefix, those input tokens are read from the cache at a reduced rate.
Anthropic's docs list cache writes at 1.25 times the base input price for the default 5-minute lifetime, or 2 times for a 1-hour lifetime, and cache reads at 0.1 times, lower on some newer models. OpenAI turns caching on by default for supported models; on its GPT-5.6 and later models, reads cost 0.1 times the input rate and writes cost more than normal input, while earlier models had no write charge. Both set a minimum prompt length before caching applies.
When it pays off, and when it does not
- 1Pays off: chat apps and agents that resend the same system prompt and tool list on every turn.
- 2Pays off: questions asked again and again over the same long document or codebase.
- 3Pays off: high request volume, so the cache stays warm within its lifetime.
- 4Does not help: prompts that change near the start, since only an identical prefix is cached.
- 5Does not help: low traffic, where the cache expires between requests and you keep paying write prices.
- 6Does not help much: output-heavy workloads, since caching only reduces input cost.
How to set it up
Put the parts that never change first: instructions, tool definitions, examples, shared documents. Put the user's message and changing data last. Then measure: log cached and uncached input tokens per feature, and compare cost per task before and after.
Check it for your case.
Read the official text.
- Anthropic docs, prompt cachingchecked 2026-10-25
- OpenAI docs, prompt cachingchecked 2026-10-25
Common follow-up questions.
Does caching change the model's answers?
No. The model sees the same input. Caching changes cost and often speed, not the output.
Is caching the same as caching whole responses?
No. Prompt caching reuses the processed prompt. Response caching stores finished answers to identical questions, which you build yourself and which avoids the model call entirely.
Do all providers price caching the same way?
No. Discounts, write charges, lifetimes and minimum lengths differ by provider and model. Check the current docs for the models you use.
Related questions and guides.
- How do I reduce LLM API costs?Question
- How do I estimate LLM costs?Question
- Which LLM API is cheapest?Question
- AI agent vs workflow automationComparison
- RAG vs fine-tuningComparison
- GlossaryEvery term, in plain words.
- LLM API pricingModel prices side by side, with sources.
- Pricing librarySoftware and API prices, each with its source and date.
- AI automationHow OceanLab automates company workflows with AI.