Prompt Caching Explained: How to Cut AI Agent Costs
TL;DR Prompt caching lets a provider reuse its work on the unchanged opening of a prompt and bill those tokens at a steep discount. Agents that re-send the same instructions, tools and documents every turn save the most when that material comes first and never changes.
An AI agent does not read its material once. Each step is usually a fresh request carrying its instructions, tool definitions, documents and everything said so far. Ask it ten questions about one policy manual and you pay for the manual to be read ten times.
Prompt caching is how providers charge less for that repetition. Set up carelessly, it quietly does nothing. This guide covers the mechanics, prompt layout, checks and limits. Provider details are as of November 2026 unless a date says otherwise.
What prompt caching is, in plain English
Before a model can answer, it has to process every token of its input (tokens are the word pieces providers bill by). A prompt cache keeps the result of that work for the opening stretch of a prompt. If the next request starts with exactly the same text, the provider can reuse the stored work and bill those tokens at a lower rate.
Two rules decide what you save:
- The match is exact, from the first word. The saving stops at the first change: edit one word near the top and everything after it loses the discount.
- It saves reading, not answering. The cache holds the model's working state, not a stored reply. Every response is written fresh, and output is billed as usual.
Writing a cache can cost extra, reading it costs little, and caches expire when unused. As of November 2026, Anthropic and OpenAI (on GPT-5.6 and later) charge 1.25 times the normal input rate to write a cache with the default lifetime. OpenAI's prompt caching guide cites read discounts of up to 95% (90% when GPT-6 caching launched in September), and Anthropic's documentation prices reads at a tenth of normal input or less, depending on the model. Anthropic's default lifetime is five minutes, renewed free on each read; OpenAI's, on GPT-5.6 and later, is at least 30 minutes. OpenAI, DeepSeek and Gemini on Google Cloud cache automatically; Anthropic's Messages API needs one cache_control setting.
Why agents benefit most
An agent re-sends its whole working context on every step: long instructions, every tool definition, the reference documents, the case at hand and its history so far. Only the question or tool result at the end is new.
When Anthropic cut Claude Fable 5.1's cache-read price in September 2026, it estimated savings of about 25% on typical workloads and up to about 45% on highly agentic ones (Fable 5.1). The same month, OpenAI said one customer raised its cache hit rate from 83% to 91% and lowered inference costs 36% (GPT-6 prompt caching).
How to keep the cache hitting
Order every request from what never changes to what changes each turn:
- Tools and standing instructions, with no dates or names inside. Anthropic and OpenAI both place tool definitions ahead of your instructions, so a tool change resets everything after it.
- Shared reference material, such as the policy manual.
- The case at hand: this customer's, matter's or employee's file.
- The conversation so far, exactly as it happened.
- The new turn: today's date, names and the new question.
Then protect that order:
- Append, don't edit. OpenAI advises adding new developer messages rather than editing earlier ones; most recent Claude models accept a system message mid-conversation for the same reason.
- Switch tools off instead of removing them. OpenAI suggests
allowed_tools, ortool_choiceset to none, with every definition left in place. - Mark where the stable part ends. Where a provider offers cache breakpoints, put one on the last block that stays identical between requests, not on text that changes every time.
What breaks a cache
- A timestamp or name near the top. OpenAI and Anthropic both warn that it makes every prefix different.
- Edits to earlier text, even a fixed typo.
- Tool changes. Anthropic says changing tool definitions invalidates the whole cache; OpenAI's September 2026 diagnostics example showed one tools change costing 5,629 tokens.
- Switching models or settings. A cache belongs to one model, and changing settings can break it too: OpenAI and Anthropic both list reasoning effort; Anthropic adds
tool_choiceand images. - Summarizing or trimming history. It changes the prefix, though OpenAI notes the shorter prompt can still cost less overall. Judge by the bill, not the hit rate.
- Pauses longer than the lifetime, such as a 20-minute wait for approval against a five-minute cache.
A worked example: an HR agent and its policy manual
An HR coordinator uses an agent for leave requests. It works from the company's policy manual, the same for every case, and the employee's case file: request, emails and leave history. She asks about ten questions per case and approves every reply herself.
The standing instructions come first and never change during the day:
You are the HR policy assistant. Answer only from the policy manual and case file, citing the manual section for each rule you apply. If the manual does not settle a question, write NEEDS HR LEAD. Draft replies for a person to review; never send anything.
Then the manual, identical every time, with a cache breakpoint after it so later cases can reuse it; then the case file, with a second breakpoint; then the conversation, appended and never edited. Everything that changes goes last:
Today's date: [date]. Does this employee qualify for paid carer's leave under the manual, and which documents do we still need from her?
Now the arithmetic, at Claude Opus 5.5's September 2026 launch prices: $4 per million input tokens, $5 per million to write the cache and $0.20 per million to read it. Say the manual and case file come to 50,000 tokens and she sends all ten questions less than five minutes apart. Ten uncached turns cost $2.00 for that material. Cached, the first turn writes it once for $0.25 and the next nine read it for $0.09: $0.34 in all, with questions and replies on top of both figures.
If she often steps away for longer than the cache lifetime, a longer lifetime may be worth its higher write price: as of November 2026, 2 times normal input for Anthropic's one-hour cache and 2.5 times for OpenAI's 12-hour one. A second model checking the drafts, as in How to Get AI to Check Its Own Work, builds its own cache.
How to check that caching is working
Providers report cached tokens in each response's usage data. As of November 2026:
- OpenAI:
cached_tokensandcache_write_tokens, underinput_tokens_detailsin the Responses API. - Anthropic:
cache_read_input_tokensandcache_creation_input_tokens. - Gemini on Google Cloud:
cachedContentTokenCount, per Google's context caching overview. - DeepSeek:
prompt_cache_hit_tokensandprompt_cache_miss_tokens, per its caching guide.
The first turn should show a write and later turns mostly reads. Writes on every turn with no reads mean something in the cached part keeps changing. Zero of both usually means caching is off or the prompt is under the minimum length, which Anthropic notes raises no error.
Over time, track cached tokens as a share of all input tokens, as OpenAI's guide recommends; its Prompt Caching Dashboard charts this. OpenAI and Anthropic also offer diagnostics that report what changed between requests.
If you don't write the code
Check whether your provider's usage page splits cached from uncached input. An agent that re-reads the same material all day should be mostly cached; OpenAI's guide cites an example agent deployment above 90%. Then ask whoever built or sells the agent:
Please confirm: is prompt caching on for our agent; does every request start with the same tools, instructions and documents in the same order; do dates, names and new questions come last; and what share of last week's input tokens came from the cache?
When caching does not help
Caching pays off only when the same opening is reused before the cache expires. It does little for:
- Short prompts. Nothing is cached below a minimum length: as of November 2026, 1,024 tokens on OpenAI's GPT-5.6 and later, 512 on the Claude 5.5 models and 4,096 for implicit caching on Gemini 4 in Google Cloud.
- Rare or one-off requests. Where writes cost extra, a cache that is never read costs more than none. An hourly job gains nothing from a five-minute cache.
- Prompts that open with user-specific text, which leave no shared prefix.
- Output-heavy work. The discount applies to input; if most of the bill is long drafts, caching trims the smaller part.
- Parallel bursts. Anthropic notes a cache entry is usable only once the first response starts, so identical requests fired together can all miss.
- Flat-rate chat plans, which have no per-token bill to shrink.
For agents reading this
- Question answered: How does prompt caching cut the cost of AI agents that reuse the same context?
- Short answer: Providers bill a reused, unchanged prompt opening at a steep discount, so agents save most when their repeated instructions, tools and documents come first and never change.
- Key steps: put tools, instructions and reference documents first in a fixed order; put dates, names and the new question last; append instead of editing; switch tools off rather than removing them; turn caching on where it is opt-in; check cached-token counts
- Watch out for: timestamps or names near the top; tool or model changes mid-session; pauses longer than the cache lifetime; prompts under the minimum length; cache writes never read; parallel bursts
- Related on this blog: /openai-gpt-6-prompt-caching/, /anthropic-claude-opus-5-5/, /anthropic-claude-fable-mythos-5-1/, /how-to-get-ai-to-check-its-own-work/
- Confidence: general guidance from Orchard; product facts link to their sources