gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna) upgrades the caching mechanism: cache writes are now billed separately (1.25x the input rate), cache reads are billed at 0.1x the input rate, caches are retained for at least 30 minutes, and the family adds prompt_cache_key for more reliable cache matching along with explicit cache breakpoint parameters.
Caching behavior across the two generations at a glance:
| Before GPT-5.6 | GPT-5.6 and later | |
|---|---|---|
| Caching mode | Automatic | Automatic + explicit breakpoints |
| Minimum cacheable length | 1,024 tokens | 1,024 tokens |
| Cache write billing | No additional fee | 1.25x base input rate |
| Cache read billing | Model’s cached-input rate | 0.1x base input rate |
| Cache retention | Cleared after 5–10 minutes of inactivity, up to 1 hour | Retained for at least 30 minutes |
prompt_cache_key | Optional, improves hit rates | Required by OpenAI to enable more reliable cache matching |
| 24-hour extended retention | Supported on some models (prompt_cache_retention) | Replaced by prompt_cache_options.ttl, currently only "30m" |
Quick start
Prompt caching requires no extra configuration: send two consecutive requests with the same long prefix, and ausage.prompt_tokens_details.cached_tokens value greater than 0 in the second response indicates a cache hit. For GPT-5.6 models, also set prompt_cache_key:
gpt-5.6-sol):
Cache pricing
Cache billing rules for the GPT-5.6 family:| Billing item | Rate |
|---|---|
| Regular input tokens | Platform pricing |
| Cache write tokens | 1.25x base input rate |
| Cache read tokens | 0.1x base input rate |
| Output tokens | Platform pricing |
The GPT-5.6 family has separate short- and long-context pricing tiers: when a single request’s input exceeds 272K tokens, the entire request is billed at the long-context tier (2x input, 1.5x output). The 1.25x cache write and 0.1x cache read multipliers still apply in the long-context tier, based on the long-context input rate.
How caching is applied automatically
When you send a request, the system checks whether the prompt prefix (in serialized order of messages, tools, and so on) exactly matches the prefix of a recent request:- If the prefix reaches 1,024 tokens and a matching cached prefix is found, the matched portion is billed at the cache read rate and time-to-first-token latency is reduced;
- Otherwise the prefix is processed as regular input and written to the cache (billed at 1.25x on GPT-5.6 and later);
- A cache hit requires the prefix to be byte-for-byte identical; any change within the prefix invalidates all cached content from that point onward.
- Static long system instructions or large sets of few-shot examples
- Long reference material repeatedly included in RAG workloads
- Agent workflows carrying large tool definitions (tools)
- Long multi-turn conversations that only append messages
GPT-5.6 caching parameters
The GPT-5.6 family adds three caching-related parameters (shared by the Chat Completions and Responses APIs):| Parameter | Type / location | Values | Default |
|---|---|---|---|
prompt_cache_key | string, request body top level | A stable custom identifier, ideally scoped per workload or tenant; keep total traffic per key to roughly 15 requests per minute | None |
prompt_cache_options | object, request body top level | mode: "implicit" / "explicit"; ttl: only "30m" supported | mode: "implicit", ttl: "30m" |
prompt_cache_breakpoint | object, inside a content block | {"mode": "explicit"}, marks the end of the cached prefix | No breakpoint |
prompt_cache_options or prompt_cache_breakpoint, and such requests are rejected; the older 24-hour extended retention parameter prompt_cache_retention ("24h" / "in_memory") is replaced by prompt_cache_options.ttl on GPT-5.6 and later.
How the three caching controls relate:
- Default (implicit mode): caching happens automatically even with no caching parameters — the system places an automatic breakpoint at the latest message. On GPT-5.6 and later, these automatic cache writes are also billed at 1.25x.
- Implicit mode + explicit breakpoints: in addition to the automatic breakpoint, you can set
prompt_cache_breakpointon a content block to pin the cache boundary at the end of stable content; changes after the breakpoint do not invalidate the cached prefix before it. - Explicit mode: with
prompt_cache_options.modeset to"explicit", only manual breakpoints are used; if no breakpoints are set at all, the request neither uses the cache nor incurs cache write charges. Official wording: “If the conversation contains no explicit breakpoints, the request does not use prompt caching or incur cache-write charges.”
- Each request can create at most 4 new cache writes; in implicit mode, the automatic breakpoint uses 1 of them;
- The prefix before a breakpoint must still reach 1,024 tokens to be cached;
- On reads, the longest matching prefix is selected from the 50 most recent breakpoints;
- Setting a breakpoint on an unsupported content block returns
400 invalid_request_error. Chat Completions supportstext/image_url/input_audio/file/refusalblocks; the Responses API supportsinput_text/input_image/input_fileblocks.
AIHubMix support for
prompt_cache_breakpoint content-block breakpoints and for Responses API cache hits is being finalized. For now, we recommend using automatic caching through Chat Completions with prompt_cache_key set (the quick start example on this page, verified to hit the cache); the explicit mode of prompt_cache_options works as expected for disabling caching. This page will be updated as support progresses.Why the cache is not being hit
A hit requires everything before the breakpoint position to be byte-for-byte identical. Ifcached_tokens is still 0 on the second request, work through this checklist:
- Prefix under 1,024 tokens: requests below the minimum cacheable length are processed as regular input;
- Changing content mixed into the prefix: timestamps, session IDs, per-user variables, and similar values should go after the static content; any change within the prefix invalidates all cached content after that point;
- Tool definitions or ordering changed: the tool list is part of the prefix; definitions and their order must match exactly;
- Inconsistent image detail parameter:
detailaffects how images are tokenized and must stay the same; - Structured output schema changed: the
response_formatJSON Schema is part of the system message prefix for caching purposes; a schema change is a prefix change; reasoning_effortchanged: officially listed as a common cause of lower cache hit rates (“Changes to reasoning effort”);- Cache retention expired: before GPT-5.6, caches are cleared after 5–10 minutes of inactivity; GPT-5.6 and later retain caches for at least 30 minutes;
prompt_cache_keynot set (GPT-5.6): automatic hits are still possible without it, but the more reliable matching mechanism is not used.
Best practices
- Put static content (system instructions, examples, reference material, tool definitions) at the very front of the request, and content that changes each turn at the end;
- Use one stable
prompt_cache_keyfor traffic sharing the same prefix, keep total traffic per key to roughly 15 requests per minute, and split into more keys per workload when exceeding that; - In multi-turn conversations, only append messages and avoid editing earlier messages;
- Keep steady traffic on requests with the same prefix to reduce cache eviction;
- For one-off long requests whose prefix will not be reused, use explicit mode to avoid cache write fees (GPT-5.6 and later);
- Monitor hits continuously via
usage.prompt_tokens_details.cached_tokens.
FAQ
Does GPT prompt caching need to be enabled manually?
No manual setup is required: prefixes of 1,024 tokens or more are cached automatically. On GPT-5.6 and later, also setprompt_cache_key for more reliable cache matching.
How are GPT-5.6 cache write fees calculated, and how do I avoid unnecessary write fees?
Cache writes are billed at 1.25x the base input rate and reads at 0.1x; a prefix reused even once produces a net saving. For one-off long requests whose prefix will not be reused, setprompt_cache_options.mode to "explicit" without setting any breakpoints, and the request neither uses the cache nor incurs write fees.
How long is the cache retained?
GPT-5.6 and later retain caches for at least 30 minutes (ttl currently only supports "30m"; actual retention may be longer). Models before GPT-5.6 clear caches after 5–10 minutes of inactivity, up to 1 hour, and some older models support extended retention via prompt_cache_retention: "24h".
How do GPT-5.6 explicit breakpoints differ from Claude’s cache_control?
Both pin the cache boundary at the end of stable content. The main differences: GPT-5.6 caches automatically with no parameters required, and breakpoints are optional fine-grained control, while Claude requires caching to be enabled in the request (a top-levelcache_control automatic breakpoint or content-block-level explicit breakpoints); GPT-5.6 retains caches for at least 30 minutes, while Claude defaults to 5 minutes with an optional 1 hour; cache reads on both are billed at 0.1x the input rate. For Claude usage, see Claude Prompt Caching.
Does caching affect output content?
No. Official position: prompt caching only affects input-side processing and billing; the model generates output exactly as it would without caching.Official references
The mechanisms, rates, and parameter definitions on this page come from these official OpenAI sources:- GPT-5.6 announcement: the 1.25x cache write / 90% cache read discount billing rule
- Prompt caching guide: mechanism, parameters, usage fields, and limits
- OpenAI Pricing: official list prices per model
- GPT-5.6 model documentation: context window and long-context billing threshold
Last updated: 2026-07-10