# Prompt caching

> Canonical: https://skillalmanac.com/glossary/prompt-caching | Last verified: 2026-11-25 | Index status: index-eligible

Prompt caching lets a model provider reuse processed state for a matching prompt prefix, which can reduce repeated input processing, latency and input cost while still generating a new response.

Also called: prompt cache.

## In plain language

AI applications often resend the same instructions, tool definitions or reference material. Prompt caching allows a provider to preserve processed state for an eligible prefix and reuse it when a later request matches through an available cache breakpoint. New or changed content after that point is still processed normally, and the model generates a new answer. A change does not necessarily invalidate every shorter cached prefix; reuse depends on the provider’s breakpoint, lookup, model and lifetime rules. Cached text still occupies context and can still count toward provider-defined rate limits. Check returned usage fields rather than assuming that a cache hit occurred or saved money.

## Technical definition

Anthropic documents top-level automatic caching and block-level explicit cache breakpoints. Its prefixes are ordered through tools, system content and messages; content must match through the reused breakpoint. Top-level automatic caching is unavailable on Amazon Bedrock’s bedrock-runtime route, where explicit breakpoints are required. OpenAI enables prompt caching by default for supported models and requires the rendered prefix to match through an eligible breakpoint; available breakpoint controls and minimum cacheable lengths depend on the model. Both vendors expose cache usage fields. Prompt caching does not enlarge the context window or reuse a completed response.

## How it shows up when you use agents

Agents commonly resend stable material: system instructions, tool definitions, project rules, reference documents and earlier conversation turns. Prompt caching lets a provider preserve processed state for an eligible prefix and reuse it when a later request matches through an available breakpoint. The provider still processes new suffix content and the model still generates a new response.

Exact matching needs some nuance. If content or a relevant setting changes, reuse beyond the changed portion can fail. A provider may still find a shorter matching prefix at an earlier eligible breakpoint. Whether that happens depends on the model, caching mode, breakpoint placement, lookup rules and cache lifetime.

Illustrative scenario: an agent sends the same tool definitions and project instructions before a changing user task. Placing stable material first makes a reusable prefix possible. A later request changes only the final task. If the provider finds the earlier eligible prefix, returned usage fields can report cached input; if it does not, the request may process or write that material again. This is an illustration, not a promise of a cache hit or lower latency.

Anthropic documents both automatic caching and explicit breakpoints. Its top-level automatic mode is not available on the documented Amazon Bedrock bedrock-runtime route, where explicit breakpoints are needed. OpenAI documents default caching for supported models, with model-dependent breakpoint and eligibility rules.

Next action: keep reusable content stable and early, then inspect the provider’s cache-read and cache-write usage fields over representative requests before estimating savings.

## Common confusions

- **Prompt caching versus response caching.** Prompt caching reuses processed input state; it does not return a stored answer.
- **Caching versus context size.** Cached content still occupies the context window.
- **Exact prefix versus all-or-nothing matching.** A change can block reuse after that point without necessarily invalidating an earlier eligible prefix.
- **Provider implementations.** Automatic modes, explicit controls, lifetimes, thresholds, prices and platform support differ.

## Worked examples in this catalogue

### [llm-cost-estimator](https://skillalmanac.com/skills/skill-almanac/llm-cost-estimator)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A workflow that applies a user-supplied, dated price table and workload profile to model possible cache-write and cache-read effects without supplying vendor prices itself.

Why it exercises the concept: Prompt caching changes input accounting when reuse occurs. This illustration can compare scenarios from measured usage and current prices, but it neither creates cache hits nor verifies a provider bill.

## Related terms

- [Context window](https://skillalmanac.com/glossary/context-window.md)
- [Token](https://skillalmanac.com/glossary/token.md)
- [Inference](https://skillalmanac.com/glossary/inference.md)
- [Rate limit](https://skillalmanac.com/glossary/rate-limit.md)
- [System prompt](https://skillalmanac.com/glossary/system-prompt.md)
- [Context engineering](https://skillalmanac.com/glossary/context-engineering.md)
- [Semantic caching](https://skillalmanac.com/glossary/semantic-caching.md)

## Sources

- [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching), Anthropic (accessed 2026-11-25)
- [Prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching), OpenAI (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
