OpenAI and Claude both cache prompt prefixes, but they enable the cache differently
Answer: Prompt caching lets you store and reuse context within your prompts.
OpenAI
OpenAI offers discounted prompt caching for prompts exceeding 1024 tokens. Prompt caching is scoped at the organization level. Members of the same organization can access shared caches. Prompt caching automatically activates for prompts longer than 1024 tokens.
Claude
There are two ways to enable prompt caching. Explicit cache breakpoints place cache_control on individual content blocks. Automatic caching adds a single cache_control field at the top level of your request. In that automatic mode, the system manages cache breakpoints for you.
See also
- ao-caching-openai-automatic-prompt-caching
- ao-caching-anthropic-cache-control
- ao-caching-gemini-context-caching
Claims
- id: C1 claim: OpenAI prompt caching is described for prompts exceeding 1024 tokens. source: S1 evidence: "discounted prompt caching for prompts exceeding 1024 tokens"
- id: C2 claim: OpenAI prompt caching automatically activates above 1024 tokens. source: S1 evidence: "Prompt caching automatically activates for prompts longer than 1024"
- id: C3 claim: Claude documents two ways to enable prompt caching. source: S2 evidence: "There are two ways to enable prompt caching:"
- id: C4 claim: Automatic Claude caching uses a top-level cache_control field. source: S2 evidence: "Add a single
cache_controlfield at the top level of your request."
Sources
- [S1] Prompt Caching 101. OpenAI Cookbook. https://github.com/openai/openai-cookbook/blob/main/examples/Prompt_Caching101.ipynb . License: MIT. Accessed 2026-11-16.
- [S2] Prompt caching (Claude cookbooks). Claude Cookbooks. https://github.com/anthropics/claude-cookbooks/blob/main/misc/prompt_caching.ipynb . License: MIT. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: OpenAI Cookbook, Prompt Caching 101, MIT (https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE); Claude Cookbooks, Prompt caching (Claude cookbooks), MIT (https://raw.githubusercontent.com/anthropics/claude-cookbooks/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: OpenAI Cookbook, Prompt Caching 101, MIT (https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE); Claude Cookbooks, Prompt caching (Claude cookbooks), MIT (https://raw.githubusercontent.com/anthropics/claude-cookbooks/main/LICENSE).
Cite this
iinventedlight. 2026. "OpenAI and Claude both cache prompt prefixes, but they enable the cache differently." iinventedlight Library, iil:note:yzwkh4sb, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-caching-across-providers/. License: CC-BY-4.0.
@misc{iil_note_yzwkh4sb,
author = {{iinventedlight}},
title = {{OpenAI and Claude both cache prompt prefixes, but they enable the cache differently}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/ao-caching-across-providers/},
note = {Permanent ID iil:note:yzwkh4sb. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- ao-caching-across-providers.table.json (table; CC-BY-4.0)
- ao-caching-across-providers.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-caching-across-providers.md.