Skip to main content

What is prompt caching?

Prompt caching reuses an unchanged prompt prefix at a lower input rate: OpenAI says up to 95% off, Anthropic bills reads at 0.1x. Example. 1 Dec 2026.

Prompt caching lets an AI API reuse the work it already did on an unchanged start of your prompt (the “prefix”), so repeated tokens are cheaper and faster. It matters most for apps that send the same long system prompt, documents or tool definitions on every request.

How the official docs describe it

  • OpenAI: prompt caching is enabled by default for supported models and reuses a matching prompt prefix. Cached input is billed at a reduced rate, “discounted up to 95%” depending on the model. The minimum cacheable length is 1,024 tokens for GPT-5.6 and later; the entire rendered prefix must match, so a change early in the prompt breaks the cache after that point. Cache-write pricing is not an additive fee: input tokens use the uncached, cached or cache-write rate.
  • Anthropic: cache entries last 5 minutes by default (measured from the start of the request that writes or reads the entry); a 1-hour lifetime is available at additional cost. A 5-minute cache write costs 1.25 times the base input price and a cache read costs 0.1 times it, with per-model exceptions. Cache reads do not count toward input-token rate limits.

Worked example (our arithmetic)

Use Cursor’s published API list prices for Claude Sonnet 5.5 (checked 2026-12-01): input $2, cache write $2.50, cache read $0.10, output $10 per million tokens. Suppose 1,000 requests each send a 20,000-token shared prefix, 500 new input tokens and get 400 output tokens, all within the cache lifetime.

Without caching With caching
Prefix tokens 20M x $2 = $40.00 1 write: 20,000 x $2.50 / 1M = $0.05; 999 reads: 19.98M x $0.10 = $2.00
New input (0.5M tokens) $1.00 $1.00
Output (0.4M tokens) $4.00 $4.00
Total $45.00 about $7.05

That is roughly 84% cheaper in this idealized case. Real savings fall if requests are spread out beyond the cache lifetime, if the prefix changes, or if the prefix is below the minimum length. Model it yourself with our prompt caching savings calculator.

Tips

  • Put stable content (system prompt, tools, documents) first and variable content last.
  • Keep timestamps and per-user text out of the prefix.
  • Watch the usage fields in responses to confirm cache hits.

FAQ

Does caching change the answers?

No. It reuses computation on the same input; it does not alter the prompt.

Is caching always cheaper?

Not always. Writes can cost more than normal input (1.25x on Anthropic’s default cache), so a prefix you never reuse costs extra.

How we checked

From OpenAI’s prompt caching guide, Anthropic’s prompt caching docs and Cursor’s models and pricing table (captures in docs/completion/captures-2026-12-01/). All sources were read on 2026-12-01 (Asia/Colombo). Prices are USD list prices as printed and may exclude tax. This is desk research from official pages, not a hands-on test. Corrections: [email protected]. See /methodology/.

Related: What is a token? · Blended LLM rate · Batch API savings