OpenAI shipped 12-hour prompt caching on October 20, 2026, for GPT-5.6 and later models in the Responses API, but developers shouldn't blindly flip the switch. While the feature promises extended retention for shared instructions and context, the cost structure has fundamentally shifted. A 12-hour cache write now costs 2.5x the input token price, compared to 1.25x for the default 30-minute lifetime. This means a higher cache hit rate on your dashboard does not automatically translate to savings; in fact, for many common traffic patterns, it will increase your inference bill.
The Break-Even Calculation
The decision to switch from 30-minute to 12-hour retention hinges on a specific metric: the number of gaps longer than 30 minutes within a 12-hour window where the same unchanged prefix is reused. Let G represent these gaps. If G is zero or one, the 30-minute option remains cheaper. The 30-minute cost formula is 1.25 Γ (1 + G), while the 12-hour cost is 2.5 + (r Γ G), where r is the read rate (typically 0.1). Only when G reaches two or more does the 12-hour option become financially viable. This mathematical reality contradicts the intuitive assumption that longer retention always equals better efficiency.
Modeled Scenarios Show The Trap
Analysis of modeled scenarios using OpenAI's list prices for gpt-6.1-sol illustrates the danger. In a 'bursty' workload where prefixes remain stable, the 12-hour option can be 23% cheaper. However, in a scenario where the prefix changes before each burstβcommon in deployments with dynamic system prompts or timestampsβthe 12-hour option costs 36% more despite achieving the same 90% hit rate as the 30-minute option. In another case, the 12-hour option raised the hit rate from 90% to 95%, yet still resulted in a higher total cost. These examples prove that hit rate is a misleading metric when write costs are variable.
Technical Constraints And Logging
The 12-hour retention is a minimum lifetime for cache-read pricing eligibility, not a guarantee of lower latency or KV tensor reuse. The cache stores key-value tensors for reusable prefixes, not the tokens themselves, and requires a minimum cacheable prompt of 1,024 tokens. Developers must log specific fields to make informed decisions, including cache_write_tokens_details split into ttl_30m_tokens and ttl_12h_tokens. Without granular logging of prefix versions and gap counts, teams are flying blind, potentially paying double for writes that don't yield sufficient read returns.
Key Takeaways
- 12-hour cache writes cost 2.5x input price, doubling the 1.25x cost of 30-minute writes.
- Switch to 12-hour retention only if your workload has two or more gaps >30 minutes per 12-hour window for the same prefix.
- A higher cache hit rate can result in a higher bill if write costs outweigh read savings.
- The feature is currently exclusive to GPT-5.6+ in the Responses API, not Chat Completions.
- Dynamic prefixes that change frequently should remain on the default 30-minute setting.
The Bottom Line
Don't let vanity metrics like hit rate drive your infrastructure costs. Analyze your actual gap patterns and prefix stability before opting into 12-hour caching, or you'll be paying a premium for efficiency you don't have.