OpenAI's new 12-hour prompt cache costs 2.5x input to write. It beats re-writing the 30-minute cache after two lapses on Astra, Luna and Sol. The math.
On 20 October 2026 OpenAI added a second cache lifetime to the Responses API. Developers can now ask for "12h" instead of the default "30m". A 12-hour write costs 2.5x the ordinary input price, against 1.25x for a 30-minute write. Reads cost 0.1x of the input price on most models and 0.05x on GPT-6.1 Sol, for either lifetime. Anyone running GPT-6 Astra, Luna or Sol with a large, stable prefix (system prompt, tool schemas, a reference document) and traffic that arrives in bursts spread over hours should check whether the premium is worth paying.
The short answer: the 12-hour write beats re-writing the 30-minute cache once it has avoided two re-writes. That holds on all three models. The rest of this piece shows the arithmetic.
What OpenAI changed
The changelog entry reads: "You can now choose 12-hour prompt caching in the API. 12-hour cache writes cost 2.5x the input token price." The caching guide adds the mechanics:
- Set
prompt_cache_options.ttlto"30m"(default) or"12h". A single content block can override it withprompt_cache_breakpoint.ttl. - Pricing is a multiple of the ordinary input rate: 30-minute write 1.25x, 12-hour write 2.5x, read 0.1x (0.05x on GPT-6.1 Sol).
- "Cache-write pricing is not an additive fee." Each input token is billed once, as uncached, cached or write.
- A 30-minute read refreshes coverage to at least 30 minutes after that read. A 30-minute read on a 12-hour entry does not restart the 12-hour clock or add a write charge.
- Switching an existing 30-minute prefix to 12 hours incurs a new 12-hour write, with no credit for the earlier one.
- The minimum cacheable prompt is 1,024 visible input tokens.
The pricing page turns the multiples into per-million-token rates (short context, up to 272K input tokens):
| Model | Input | Cached read | 30m write | 12h write |
|---|---|---|---|---|
| GPT-6 Astra | $10.00 | $1.00 | $12.50 | $25.00 |
| GPT-6 Luna | $0.10 | $0.01 | $0.125 | $0.25 |
| GPT-6.1 Sol | $2.00 | $0.10 | $2.50 | $5.00 |
Each cell checks against the multipliers: Astra $10 x 1.25 = $12.50 and $10 x 2.5 = $25; Luna $0.10 x 1.25 = $0.125 and x 2.5 = $0.25; Sol $2 x 1.25 = $2.50, x 2.5 = $5, and x 0.05 = $0.10. Long-context rows (over 272K tokens) double the input rate with the same multipliers.
The break-even arithmetic
The 30-minute cache is a sliding window, so a prefix hit at least every 30 minutes stays warm for only the 1.25x write. In that case the 12-hour option can only cost more, by exactly 1.25x the input price on one prefix. The 12-hour write earns its premium only when a gap longer than 30 minutes would let the cheap cache expire. Call each such expiry a lapse. On a lapse, the 30-minute cache pays a fresh write (1.25x). The 12-hour cache pays a read (0.1x).
Let p be the input price and m the number of lapses inside the 12-hour window.
- 30-minute cache: 1.25p for the first write, plus 1.25p for each of m re-writes = 1.25p x (m + 1)
- 12-hour cache: 2.5p for the first write, plus 0.1p for each of those m requests = 2.5p + 0.1p x m
The 12-hour option is cheaper when 2.5 + 0.1m < 1.25 + 1.25m, which rearranges to 1.25 < 1.15m, so m > 1.087. The smallest whole number is 2. For Sol the read is 0.05x: 1.25 < 1.20m gives m > 1.042, and again the answer is 2. Reads that happen inside 30 minutes of the previous one cost 0.1x (0.05x on Sol) under both lifetimes and cancel out.
Per million tokens of prefix on Astra, with requests spaced more than 30 minutes apart:
GPT-6 Astra, requests more than 30 minutes apart: the 12-hour cache wins from the second lapse. Source: OpenAI API pricing; TF arithmetic.
- One lapse: 30m = $12.50 + $12.50 = $25.00. 12h = $25.00 + $1.00 = $26.00. The 30-minute cache wins by $1.00.
- Two lapses: 30m = 3 x $12.50 = $37.50. 12h = $25.00 + 2 x $1.00 = $27.00. The 12-hour cache wins by $10.50.
Worked examples: a 50,000-token prefix
Requests arrive one hour apart, so every request after the first is a lapse for the 30-minute cache.
| Model | Write 30m / 12h / read | 1 lapse: 30m vs 12h | 2 lapses: 30m vs 12h |
|---|---|---|---|
| Astra | $0.625 / $1.25 / $0.05 | $1.25 vs $1.30 | $1.875 vs $1.35 |
| Luna | $0.00625 / $0.0125 / $0.0005 | $0.0125 vs $0.0130 | $0.01875 vs $0.0135 |
| Sol | $0.125 / $0.25 / $0.005 | $0.25 vs $0.255 | $0.375 vs $0.26 |
The crossover is the same on all three models: at one lapse the 30-minute cache is ahead by a rounding error, at two the 12-hour cache is ahead by about 28% on Astra and Luna and about 31% on Sol.
A realistic day
A support agent carries a 100,000-token prefix. A request lands every 45 minutes across a 12-hour window: 16 requests from minute 0 to minute 675. Every gap exceeds 30 minutes, so the 30-minute cache never gets a hit.
- Astra: 30m = 16 x $1.25 = $20.00. 12h = $2.50 + 15 x $0.10 = $4.00. Uncached would be 16 x $1.00 = $16.00, so the 30-minute write is a net loss here.
- Luna: 30m = 16 x $0.0125 = $0.20. 12h = $0.025 + 15 x $0.001 = $0.04.
- Sol: 30m = 16 x $0.25 = $4.00. 12h = $0.50 + 15 x $0.01 = $0.65.
These figures count the cached prefix only; the fresh part of each prompt and all output tokens are billed on top.
Against no caching, and where the maths stops
Compared with sending the prefix uncached, a 12-hour write needs 2.5 + 0.1k < 1 + k, so k > 1.67 reads on Astra and Luna and k > 1.58 on Sol: two reads in both cases.
Three caveats from the documentation:
"12h"is a minimum, not a deletion deadline. The guide says it "does not set a deletion deadline or change the maximum data-retention policy," and that the minimum lifetime affects read-pricing eligibility, not guaranteed reuse or lower latency. The guide does not say whether 12-hour caching is available under Zero Data Retention; confirm that before moving regulated workloads.- The guide does not say whether a read extends a 12-hour entry. Treat the window as 12 hours from the write, and budget one new 12-hour write per 12 hours of activity.
- Each request can carry up to four cache writes, and the implicit breakpoint uses one slot.
To check what you were billed, read usage.input_tokens_details.cached_tokens and cache_write_tokens, which splits into ttl_30m_tokens and ttl_12h_tokens. Log those per prefix and count your real lapses before you switch.
How Anthropic prices the same trade
For the general mechanics, see our prompt caching explainer. Anthropic's pricing page lists a 5-minute write at 1.25x, a 1-hour write at 2x and reads at 0.1x of base input (0.05x on Claude Opus 5.5 and Sonnet 5.5, 0.025x on Fable 5.1). Its reads also refresh the cache. Anthropic's page says caching pays off after one read at the 5-minute duration and two at the 1-hour duration. Applying the same lapse arithmetic to those multipliers (2 + 0.1m < 1.25 + 1.25m) puts the 1-hour option ahead after a single lapse, because its premium over the short write is 0.75x rather than OpenAI's 1.25x. That last comparison is our arithmetic on published multipliers, not an Anthropic claim. OpenAI's 12-hour tier buys a much longer window at a higher premium.
What to do
- Measure first. Pull gaps between requests that share a prefix. If they are all under 30 minutes, keep the default.
- Switch prefixes that sit idle for more than 30 minutes at least twice per 12 hours, such as shift-based agents, internal tools and scheduled batch jobs with shared instructions.
- Set the TTL per breakpoint so that only the large, stable block pays 2.5x; leave the volatile tail on 30 minutes.
- Re-run the sums if prices change; the break-even depends only on the multipliers (2.5, 1.25 and the read rate), not on the model.