OpenAI 12-hour prompt caching arrived on October 20, 2026, as a new option in the Responses API. Until then, the newest models offered a minimum cache lifetime of 30 minutes. If your app sent the same long instructions at 7 AM and again at 9 AM, the first entry had usually expired, so it paid to write them to the cache twice.
There is a catch in the price. A 12-hour write costs 2.5 times the normal input price, double the 30-minute write, so for some usage patterns it costs more, not less. Below are the prices, a test run on October 26 with a 40-minute gap between calls, and a short rule (plus a small calculator) for picking the right setting.
Quick summary (TL;DR)
- What changed: in the Responses API you can now set
prompt_cache_options.ttlto"12h"instead of the default"30m".- Price: a 12-hour cache write costs 2.5× the normal input price; a 30-minute write costs 1.25×. Reading from the cache costs the same for both: 0.1× on most new models and 0.05× on
gpt-6.1-sol.- The rule: if the same long prompt is reused 3 or more times in a day with gaps longer than 30 minutes, 12 hours is cheaper. If calls come every few minutes, keep 30 minutes. If it is used only twice, hours apart, skip caching.
- The test: with a 1,163-token school handbook on
gpt-6-luna, the 12-hour copy was still read from the cache after a 40-minute gap, and the 30-minute copy had expired and was written again at full write price.- Watch out: cached data is kept up to 24 hours at most, so keep student names and ID numbers out of anything you cache for long.
What prompt caching does, in one paragraph
Many apps start every request with the same block of text: instructions, a policy document, tool definitions. Prompt caching lets OpenAI save the model’s internal work on that shared beginning (the “prefix”) so later requests that start with the exact same text don’t pay full price to process it again. The prefix has to be at least 1,024 tokens on GPT-5.6 and later models, and it has to match exactly. Change one word near the top and everything after it is a miss.
On these newer models, writing to the cache is not free. You pay a write rate the first time, then a much cheaper read rate on every hit. So how long an entry stays valid decides how often you pay that write.
30 minutes or 12 hours: the numbers
OpenAI’s caching guide lists two lifetimes for GPT-5.6 and later in the Responses API:
| Setting | Minimum lifetime | Write price | Read price |
|---|---|---|---|
"30m" (default) |
30 minutes | 1.25× normal input | 0.1× normal input (0.05× on gpt-6.1-sol) |
"12h" |
12 hours | 2.5× normal input | Same as above |
These multipliers replace the normal input price for those tokens; they are not added on top. In dollars per million tokens, for two current models on the standard tier, OpenAI’s pricing page lists these prices (riyal amounts use the fixed rate of 3.75 SAR per dollar):
| Per 1M tokens (standard, short context) | gpt-6.1-sol |
gpt-6-luna |
|---|---|---|
| Normal input | $2.00 (SAR 7.50) | $0.10 (SAR 0.375) |
| Cache read | $0.10 | $0.01 |
| 30-minute write | $2.50 | $0.125 |
| 12-hour write | $5.00 (SAR 18.75) | $0.25 |
Two details in the guide affect the math. First, a read refreshes 30-minute coverage to at least 30 minutes after that read, so a busy app that calls every few minutes keeps its entry warm at the cheap rate. Second, a read does not restart the 12-hour clock, so the 12 hours run from the write.
How to turn it on
The setting goes in prompt_cache_options. This is the request shape used in the test below, with an explicit breakpoint at the end of the shared handbook:
{
"model": "gpt-6-luna",
"prompt_cache_options": {
"mode": "explicit"
},
"input": [{
"role": "developer",
"content": [{
"type": "input_text",
"text": "[Handbook...]",
"prompt_cache_breakpoint": {
"mode": "explicit",
"ttl": "12h"
}
}]
}, {
"role": "user",
"content": "Club hours?"
}]
}
With "mode": "explicit", only the text up to your breakpoint is written to the cache. The question after it is billed at the normal rate with no write charge, since the question changes every time. You can also set "ttl" once at the request level instead of on the breakpoint.
The test: one handbook, two lifetimes, a 40-minute gap
For the test, a fictional handbook for a secondary school was written, covering school hours, attendance, exams, guidance, library rules, clinic, clubs and so on. It came to 1,163 tokens, just above the 1,024-token minimum. Two copies were prepared that differed only in the title line, so they would be cached as two separate prefixes:
- Copy A was cached with
"ttl": "12h". - Copy B was cached with
"ttl": "30m".
Both ran on gpt-6-luna through the Responses API from a test server, starting at 1:55 PM Riyadh time on October 26, 2026.
Round 1: write, then read
Each copy got two questions, a few seconds apart:

The usage report shows exactly what was billed. Copy A’s first call wrote 1,163 tokens under ttl_12h_tokens; copy B’s first call wrote 1,166 under ttl_30m_tokens (the 3 extra tokens come from the changed title line, which adds “copy B”). The second call on each copy read every one of those tokens from the cache with no new write. All four answers matched the handbook: the first lesson at 7:00 AM, two library books for up to fourteen days.
Round 2: after 40 minutes of silence
Then nothing was sent for 40 minutes. That is longer than the 30-minute minimum for copy B and well inside the 12 hours for copy A. At 2:35 PM, one new question went to each copy: “When do clubs meet?”

Copy A came back with cached_tokens: 1163 and nothing written, so it was billed at the read price. Copy B showed cached_tokens: 0 and wrote all 1,166 tokens again under ttl_30m_tokens. Its entry had expired during the gap, so it paid the 1.25× write a second time. Both answers were correct and identical (clubs meet on Thursday during the last two lessons). Only the bill differed.
What the test cost
All six calls together cost about $0.00067 (well under a tenth of a cent), almost all of it input tokens. Testing on gpt-6-luna first keeps mistakes cheap. The same usage fields apply to other GPT-5.6 and later models in the Responses API, at their own prices.
When OpenAI 12-hour prompt caching pays off: a worked example
The handbook in the test was small. A more realistic case is a school or company assistant that starts every request with 20,000 tokens of policies and examples, running on gpt-6.1-sol. Here is the input cost of that shared prefix in four usage patterns, using the prices above:
Pattern (20,000-token prefix, gpt-6.1-sol) |
No caching | 30-minute cache | 12-hour cache | Cheapest |
|---|---|---|---|---|
| 2 questions, 1 hour apart | $0.080 | $0.100 | $0.102 | No caching |
| 3 questions, 1 hour apart | $0.120 | $0.150 | $0.104 | 12 hours |
| 8 questions across the school day, 50 minutes apart | $0.320 | $0.400 | $0.114 | 12 hours |
| 20 questions, 20 minutes apart | $0.800 | $0.088 | $0.138 | 30 minutes |

Look at the third row. With calls 50 minutes apart, the 30-minute cache expires before every call, so each request pays the 1.25× write again and the day costs more than sending the prompt uncached. The 12-hour write pays 2.5× once, then reads at 0.05× for the rest of the day, and the bill drops by about two thirds.
The same math gives a simple rule. If the gaps are longer than 30 minutes, 12 hours wins from the third use onward. On gpt-6.1-sol, three uses cost 2.5 + 0.05 + 0.05 = 2.6× the normal input price, against 3.75× with 30-minute writes and 3× with no caching (on models that read at 0.1×, it is 2.7×, still the lowest). With only two uses hours apart, no caching is the cheapest option; if the second use comes within 30 minutes, the default cache still wins. And if your calls arrive every few minutes, the 30-minute cache stays warm on its own and is always cheaper than 12 hours.
A note on “no caching”: on these models caching is on by default in implicit mode, which writes at the 30-minute rate. To truly skip the write, set "mode": "explicit" and add no breakpoint.
A three-question checklist and a small calculator
Before switching anything to 12 hours, answer these three questions about one shared prefix:
- Is it at least 1,024 tokens, and does it stay exactly the same? Dates, user names or a changing greeting at the top will break every match. Move anything that changes below the breakpoint.
- How many times is it used in a day, and how far apart? Three or more uses with gaps over 30 minutes: use
"12h". Steady traffic every few minutes: keep"30m". Two uses, hours apart: no caching. - Does it contain personal data? Keep it general (policies, instructions, examples). Student names, phone numbers and ID numbers belong in the part after the breakpoint, or better, nowhere in the prompt at all.
If you want the numbers for your own case, this short Python function reproduces the table above. Change the prices if you use a different model or tier:
PRICES = { # USD per 1M tokens, standard tier, short context (OpenAI pricing page, Oct 26, 2026)
"gpt-6.1-sol": dict(inp=2.00, read=0.10, w30=2.50, w12=5.00),
"gpt-6-luna": dict(inp=0.10, read=0.01, w30=0.125, w12=0.25),
}
def prefix_cost(model, prefix_tokens, requests, gap_minutes):
p = PRICES[model]
t = prefix_tokens / 1_000_000
no_cache = requests * p["inp"] * t
if gap_minutes <= 30: # each read keeps the 30-minute entry alive
c30 = (p["w30"] + (requests - 1) * p["read"]) * t
else: # the entry expires before the next call
c30 = requests * p["w30"] * t
c12 = (p["w12"] + (requests - 1) * p["read"]) * t
return {"no_cache": round(no_cache, 4), "30m": round(c30, 4), "12h": round(c12, 4)}
print(prefix_cost("gpt-6.1-sol", 20000, 8, 50))
# {'no_cache': 0.32, '30m': 0.4, '12h': 0.114}
The function assumes every call within the 12 hours is a hit. Real traffic is messier, so check the usage report after a day or two.
How to check that it is working
Every Responses API reply includes the cache numbers in usage.input_tokens_details:
cached_tokens: tokens read from the cache, billed at the read price.cache_write_tokens: tokens written this time, split incache_write_tokens_detailsintottl_30m_tokensandttl_12h_tokens.
If ttl_12h_tokens shows up on every call instead of only the first, something in your prefix is changing between calls. A timestamp near the top is the most common reason. OpenAI also offers a Prompt Caching dashboard in the platform’s usage page and a diagnostics tool for finding misses.
Limits and fine print
- Responses API only, newer models only. The
"12h"value applies to GPT-5.6 and later through the Responses API. Older models use a different setting,prompt_cache_retention, with values such as"24h". - “Minimum” lifetime, not a promise of speed. OpenAI says the lifetime decides eligibility for the cheaper read price; it does not guarantee that every request reuses the stored data or gets faster.
- No manual delete. There is currently no way to clear the cache yourself. Entries expire on their own.
- Data retention. The cache stores the model’s internal tensors rather than your text, and OpenAI states a maximum retention of 24 hours. Prompt caching is compatible with Zero Data Retention. Even so, a 12-hour cache is a poor place for student or patient data; follow your school’s and the ministry’s rules and Saudi Arabia’s Personal Data Protection Law. Zero Data Retention support is not a full privacy guarantee on its own.
- Upgrades cost a new write. Switching an entry that is already cached for 30 minutes to 12 hours charges a full 12-hour write, with no credit for the earlier one.
- Small test. The test here used one handbook and six calls. It shows the billing fields behave as documented; it does not measure speed or hit rates under heavy traffic.
Verdict
The 12-hour option is built for apps used in bursts during a working day, like a school office assistant or a help desk that gets a question every hour or so. Those apps were paying to rebuild the same cache again and again, and with 30-minute writes that could cost more than not caching at all. For them, "ttl": "12h" on the stable part of the prompt is a one-line change; in the eight-question example above it cut the prefix cost by about two thirds.
For busy chat apps with constant traffic, nothing changes: the default 30 minutes is still cheaper. And for prompts used once or twice a day, skipping caching is cheaper. Answer the three questions above, then check a day of usage numbers.
AiPlusDaily is independent and is not affiliated with OpenAI. The test calls ran on a regular paid OpenAI API account, and no company sponsored this article or gave free access.
FAQ
Does 12-hour caching cost extra if the cache is never used again?
Yes. The write is billed at 2.5× the normal input price whether or not a later request reads it. A single-use prompt is cheaper without caching.
Does a cache hit change the answer?
No. According to OpenAI’s guide, caching changes how the shared input is processed and billed, not how the answer is generated. Identical requests can still give slightly different replies.
Do cached tokens still count toward rate limits?
Yes. According to OpenAI’s guide, cached input tokens still count toward your tokens-per-minute limit. Caching lowers the bill, not the rate-limit usage.
Sources
- OpenAI API documentation: "Prompt caching" guide (Markdown version of the official page), accessed October 26, 2026. https://developers.openai.com/api/docs/guides/prompt-caching.md
- OpenAI API documentation: "Changelog," entry for October 20, 2026 (Markdown version), accessed October 26, 2026. https://developers.openai.com/api/docs/changelog.md
- OpenAI API documentation: "Pricing," standard tier (Markdown version), accessed October 26, 2026. https://developers.openai.com/api/docs/pricing.md