Features
Prompt caching
Prompt caching is an API feature that keeps the start of a prompt after one request, so the next request that begins with exactly the same text reads it from the cache, faster and at a lower price.
Also called Context caching, Cached input, Cache reads
Checked November 29, 2026
At a glance
- Saves
- Time and money on a repeated prompt start
- Match
- Exact, word for word, from the start of the prompt
- Lifetime at Anthropic
- 5 minutes, refreshed on use; or 1 hour
- Usage fields
cache_read_input_tokens,cache_creation_input_tokens(Anthropic);cached_tokens(OpenAI)- On /model
cache_controlon/v1/messages; each channel's cache prices on /pricing
It pays off when many requests share a long start: a system prompt, tool definitions, a document, or a coding agent's growing conversation. Only an exact match counts: change one character near the start, and everything after it is new input again.
At Anthropic
You mark what to cache with cache_control. An entry lasts 5 minutes by default, refreshed each time it is used, or 1 hour at a higher write price. Several models cache only prompts of at least 1,024 tokens. The usage counts tokens written to the cache in cache_creation_input_tokens and tokens read from it in cache_read_input_tokens (Anthropic).
Writing to the cache costs more than plain input, and reading from it costs a fraction of the input price, which depends on the model. So a 5-minute entry pays for itself after one read, and a 1-hour entry after two (Anthropic).
At OpenAI
Caching works on prompts of 1,024 tokens or more for GPT-5.6 and later, without being asked; newer models also take explicit breakpoints. cached_tokens in the usage shows how many input tokens came from the cache (OpenAI).
Prompt caching on /model
- On
/v1/messages, putcache_controlon the last block of the part that repeats: everything before it,toolsandsystemincluded, is cached with it. Or put onecache_controlat the top level, and the cache follows the conversation as it grows (Prompt caching). - An entry lasts 5 minutes from when it was last used. For an hour, add
"ttl": "1h"tocache_control; writing it costs twice the channel's input price. - On
/v1/chat/completions, Claude caches long prompts that repeat without being asked, andprompt_tokens_details.cached_tokensshows the tokens read from the cache. - On
/v1/responses,usage.input_tokensincludes the cached tokens, whichusage.input_tokens_details.cached_tokenscounts. - Each channel's cache prices are on the pricing page.
Where it applies on /model
Questions
Why is nothing read from the cache?
Something near the start changes every time, such as a date or an id: move it after the part you cache. The prompt may also be too short, as several models cache only from 1,024 tokens.
Does Claude Code use the cache on /model?
Yes. Claude Code sends its long context again on every turn, and on Claude models the repeated part is read from the cache and billed at the cache price (Claude Code guide).
Sources
The makers' own pages, each opened on November 29, 2026.