← All notes

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

Claims

Sources

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

Permanent ID: iil:note:yzwkh4sb

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.},
}

Markdown

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.

All artifact files (JSON index)

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.