OpenAI announced 12-hour prompt caching for its API on October 20, 2026, giving developers an option to keep shared prompt content cached for longer between requests. The change is aimed at workloads that repeatedly send the same instructions, tools, and context, but do not necessarily make another request within a short interval.
The announcement appears in the official OpenAI API changelog under the Responses API. OpenAI says the longer retention window can help developers benefit from lower cached-input pricing even when requests are hours apart. There is an important trade-off: 12-hour cache writes cost 2.5 times the standard input-token price. Longer retention therefore does not automatically mean a lower bill; the economics depend on how often a cached prefix is reused.
What changed in OpenAI prompt caching?
Prompt caching allows supported API requests to reuse an eligible prefix of a prompt instead of processing every repeated input as entirely new input. A prefix may include stable instructions, tool definitions, and shared context. When a later request matches the cached prefix and meets the platform’s caching requirements, eligible input tokens can receive cached-input pricing.
The October 20 update adds a 12-hour retention choice. This is useful for applications where requests may be separated by long pauses: an assistant used intermittently throughout a workday, an AI agent that resumes a task later, or an internal tool that repeatedly uses the same long system instructions and tool schemas.
The update is an API feature, not a claim that every model or endpoint automatically uses a 12-hour cache. Developers should verify the supported model, endpoint, retention setting, and account requirements in the official prompt caching documentation before enabling it in production.
Why the 12-hour cache window matters
A short-lived cache can be less useful when a workflow has long gaps between requests. Consider an internal support assistant with a large set of shared policies and tool definitions. If an employee asks a question, leaves the task for several hours, and then returns, an extended cache window may give the application another opportunity to reuse the same prefix.
Potential use cases include:
- AI agents and multi-step workflows: shared system instructions and tool definitions reused across steps that are hours apart.
- Customer-support assistants: stable policy context reused across intermittent conversations, where the product’s architecture and privacy rules permit it.
- Developer assistants: repeated repository guidance, coding standards, or tool schemas that form a stable prompt prefix.
- Research and document workflows: long shared instructions reused across follow-up requests, provided the requests satisfy cache-matching requirements.
- Enterprise applications: recurring prompts with substantial shared context, where usage patterns can be measured and audited.
Caching is not a substitute for conversation-state management, and it does not mean every part of a request is cached. Dynamic content, changes to the prefix, model support, and other cache rules can affect reuse. Read the official guide rather than assuming that two similar-looking prompts will always produce a cache hit.
Understand the price: cache writes cost 2.5x
The main cost detail in the announcement is easy to miss. OpenAI says 12-hour cache writes are priced at 2.5 times the regular input-token price. Cached input tokens are priced below ordinary input tokens under the applicable model pricing, but a more expensive cache write can offset those savings if the prefix is not reused enough.
A simplified way to assess the decision is to compare two scenarios:
- Without extended caching: repeated requests pay the applicable regular input price for the shared prefix when it is not served from cache.
- With 12-hour caching: the initial cache write costs more, while eligible subsequent cache reads may cost less than regular input tokens.
The result depends on the size of the shared prefix, the number and timing of later requests, the model’s regular and cached input rates, and whether those requests actually hit the cache. There is no universal break-even number that applies to every model and workload.
For example, a workflow with a large stable prefix and several follow-up requests within the retention period may justify testing extended caching. A workflow that sends the prefix once and rarely reuses it may simply pay the higher write cost without gaining enough cached reads to compensate.
Before rolling the setting out broadly, estimate the expected cache-write cost, the number of likely cache reads, and the cost of uncached input. Then compare those estimates with observed API usage after a small controlled test.
For related cost-control practices, see our guide to managing AI agent API budgets and rate limits and our guide to migrating OpenAI API models.
How developers should evaluate 12-hour prompt caching
The safest approach is to measure the feature on a workload that has a repeatable prompt structure.
1. Identify the stable prompt prefix
Separate instructions and tool definitions that remain the same across requests from dynamic information such as the current user message, timestamps, retrieved documents, or task-specific data. Keep the reusable prefix consistent where the application design allows it.
2. Confirm endpoint and model support
The October 20 changelog entry specifically identifies the Responses API. Check the current OpenAI prompt caching guide and API pricing page for the exact model, endpoint, retention option, and rates that apply to your account. Do not assume all models or endpoints share identical support.
3. Enable the documented retention setting
Use the current API reference and SDK documentation to set the supported retention option for your request. The API’s accepted parameter names and values should be taken directly from the current documentation rather than copied from an older example. Keep API keys on the server and avoid placing credentials in client-side code or public repositories.
4. Measure cache reads and misses
Test requests that repeat the same prefix at realistic intervals, including a gap of several hours. Inspect usage information returned by the API and compare cached versus uncached input tokens. If the expected reuse does not appear, check whether the prefix changed, whether the selected model supports the feature, and whether requests follow the documented caching rules.
5. Compare total cost, not just cache-hit rate
A high cache-hit rate alone does not prove the setting is economical. Include the 2.5x cache-write price, the volume of cached reads, and the normal input cost in the calculation. Repeat the test with representative traffic before making the setting a default.
Does 12-hour prompt caching make AI agents cheaper?
It can, but only under the right usage pattern. Agents often reuse system instructions, tool schemas, and other stable context over multiple calls. If these calls are spread across several hours, a longer retention window may improve the chance that the shared prefix remains available for reuse.
However, agents can also generate large amounts of changing context. Tool results, appended conversation history, and newly retrieved documents may alter the prompt prefix or reduce the portion that can be reused. Developers should measure actual cached-token usage rather than assuming the entire agent context will be cached.
Teams building agents should also monitor total token usage, tool-call frequency, latency, failure rates, and task completion quality. Prompt caching is one optimization among several; it does not replace prompt design, retrieval optimization, model selection, or budget controls.
For background on the API model landscape, read our article on OpenAI’s coding and legacy-software migration results. For broader prompt-design improvements, see how to write better ChatGPT prompts.
Availability and limitations
OpenAI’s changelog lists the 12-hour prompt-caching option on October 20, 2026, under the Responses API. The feature should be treated as documented for the relevant supported API configurations, not as universally available to every model, account, and endpoint without qualification.
The announced pricing condition is clear: 12-hour cache writes cost 2.5 times the standard input-token price. Actual savings are workload-dependent. Developers should check current documentation for supported models and request settings, and confirm behavior in their own API usage data before relying on it in production.
Bottom line
OpenAI’s 12-hour prompt caching option gives API developers a longer window for reusing stable prompt content across requests separated by hours. It may help applications with large, repeated prefixes, including AI agents and enterprise assistants, but the higher cache-write price means the right choice depends on real reuse patterns.
The practical next step is to run a small benchmark against the existing configuration, measure cached input tokens and cache misses, and compare the full cost. Treat the 12-hour setting as a workload-specific optimization—not a guaranteed cost reduction.
Official sources
- OpenAI API changelog — October 20, 2026 update
- OpenAI prompt caching documentation
- OpenAI API pricing