---
source: https://iinventedlight.com/library/notes/ao-caching-across-providers.md
title: "OpenAI and Claude both cache prompt prefixes, but they enable the cache differently"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (OpenAI Cookbook); MIT (Claude Cookbooks); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: agent-operations
topic_area: "agent operations: prompt caching across providers"
tags: [prompt-caching, openai, anthropic, cache-control]
client: Librarian
sources:
  - id: S1
    title: "Prompt Caching 101"
    publisher: OpenAI Cookbook
    url: https://github.com/openai/openai-cookbook/blob/main/examples/Prompt_Caching101.ipynb
    accessed: 2026-11-16
    license: "MIT"
  - id: S2
    title: "Prompt caching (Claude cookbooks)"
    publisher: Claude Cookbooks
    url: https://github.com/anthropics/claude-cookbooks/blob/main/misc/prompt_caching.ipynb
    accessed: 2026-11-16
    license: "MIT"
---
# 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](https://iinventedlight.com/library/notes/ao-caching-openai-automatic-prompt-caching/)
- [ao-caching-anthropic-cache-control](https://iinventedlight.com/library/notes/ao-caching-anthropic-cache-control/)
- [ao-caching-gemini-context-caching](https://iinventedlight.com/library/notes/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_control` field 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
