{"head":{"title":"Does Prompt Caching Save Money? When It Pays Off | OceanLab","description":"Prompt caching cuts the cost of repeated prompt prefixes, often to a tenth of the input price. When it pays off, when it does not, and how to set it up.","canonical":"https://oceanlab.in/questions/does-prompt-caching-save-money"},"crumbs":[{"name":"Home","path":"/"},{"name":"Questions","path":"/questions"},{"name":"Does prompt caching save money?","path":"/questions/does-prompt-caching-save-money"}],"question":"Does prompt caching save money?","answer":["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."],"sections":[{"heading":"How the billing works","body":[["With ",{"href":"/glossary/prompt-caching","text":"prompt caching"}," the provider stores the processed start of your prompt. When the next request starts with exactly the same prefix, those input ",{"href":"/glossary/token","text":"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."]],"bullets":[]},{"heading":"When it pays off, and when it does not","body":[],"bullets":[["Pays off: chat apps and agents that resend the same system prompt and tool list on every turn."],["Pays off: questions asked again and again over the same long document or codebase."],["Pays off: high request volume, so the cache stays warm within its lifetime."],["Does not help: prompts that change near the start, since only an identical prefix is cached."],["Does not help: low traffic, where the cache expires between requests and you keep paying write prices."],["Does not help much: output-heavy workloads, since caching only reduces input cost."]]},{"heading":"How to set it up","body":[["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."]],"bullets":[]}],"faqs":[{"question":"Does caching change the model's answers?","answer":"No. The model sees the same input. Caching changes cost and often speed, not the output."},{"question":"Is caching the same as caching whole responses?","answer":"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."},{"question":"Do all providers price caching the same way?","answer":"No. Discounts, write charges, lifetimes and minimum lengths differ by provider and model. Check the current docs for the models you use."}],"terms":[{"href":"/glossary/prompt-caching","label":"prompt caching"},{"href":"/glossary/token","label":"token"},{"href":"/glossary/context-window","label":"context window"},{"href":"/glossary/batch-api","label":"batch API"},{"href":"/glossary/inference","label":"inference"}],"tools":[{"href":"/tools/prompt-caching-savings","label":"Prompt caching savings","detail":"Free tool"},{"href":"/tools/llm-api-cost-calculator","label":"LLM API cost calculator","detail":"Free tool"},{"href":"/tools/token-counter","label":"Token counter","detail":"Free tool"}],"links":[{"href":"/pricing/categories/llm-api","label":"LLM API pricing","detail":"Model prices side by side, with sources."},{"href":"/pricing","label":"Pricing library","detail":"Software and API prices, each with its source and date."},{"href":"/ai-automation","label":"AI automation","detail":"How OceanLab automates company workflows with AI."}],"related":[{"href":"/questions/how-to-reduce-llm-api-costs","label":"How do I reduce LLM API costs?","detail":"Question"},{"href":"/questions/how-to-estimate-llm-costs","label":"How do I estimate LLM costs?","detail":"Question"},{"href":"/questions/which-llm-api-is-cheapest","label":"Which LLM API is cheapest?","detail":"Question"},{"href":"/compare/ai-agent-vs-workflow-automation","label":"AI agent vs workflow automation","detail":"Comparison"},{"href":"/compare/rag-vs-fine-tuning","label":"RAG vs fine-tuning","detail":"Comparison"},{"href":"/glossary","label":"Glossary","detail":"Every term, in plain words."}],"sources":[{"title":"Anthropic docs, prompt caching","url":"https://platform.claude.com/docs/en/build-with-claude/prompt-caching","checkedAt":"2026-10-25"},{"title":"OpenAI docs, prompt caching","url":"https://developers.openai.com/api/docs/guides/prompt-caching","checkedAt":"2026-10-25"}],"legal":false,"updatedAt":"2026-10-25"}