PARAS MADAN
All writing

Latest in AI

OpenAI 12-Hour Prompt Caching: API Pricing and When It Saves Money

Longer cache lifetimes help agents that return hours later, but the higher write price makes reuse patterns more important than the headline discount.

OpenAI added 12-hour prompt caching to the Responses API on October 20, 2026. Developers can keep shared instructions, tools and context eligible for cheaper cached-input pricing across requests hours apart. The tradeoff is an upfront write charge of 2.5 times the ordinary input price.

The official API changelog confirms the release. For an agent that wakes up several times during a working day, this creates a useful option. For a busy conversation already reusing its prompt every few minutes, paying for the longer window can be unnecessary.

OpenAI 12-Hour Cache Pricing

Here is the published pricing for GPT-6.1 Sol at Standard speed with short-context pricing. These are dollars per million input tokens, not the price of an entire request.

Input treatmentPrice per million tokens
Ordinary uncached input$2.00
30-minute cache write$2.50
12-hour cache write$5.00
Cached read with either lifetime$0.10

The write figures are the total token charge for writing the cache, not an extra fee added to the ordinary input price. Output tokens, tool charges and any applicable regional-processing uplift are separate.

The longer lifetime buys a wider opportunity to reuse a prompt, not a cheaper first request. That distinction matters when deciding whether to enable it across an application.

When Does a 12-Hour Cache Save Money?

Consider an illustrative agent with 10,000 unchanged prefix tokens. It runs at 9 a.m., noon and 3 p.m. Assume each three-hour gap produces a fresh write under the 30-minute option, while the 12-hour option produces one write and two reads.

The shorter option costs $0.075 for that prefix: three writes at $0.025 each. The longer option costs $0.052: a $0.05 write followed by two $0.001 reads. That is about 31% less for this repeated prefix, not a 31% reduction in the whole agent bill.

Now remove the third run. Two short-cache writes cost $0.05, while one long-cache write and one read cost $0.051. In that example, the longer setting is slightly more expensive.

Move all three runs into a single active 30-minute window and the comparison changes again. One short-cache write plus two reads costs $0.027, versus $0.052 with the longer write.

These calculations use the rates above and assume the same prefix is eligible for reuse. They are not measured production results. The useful metric is how often an unchanged prefix returns after a short cache would need rewriting. Daily request count alone will not tell you that.

How to Enable 12-Hour Prompt Caching

For a supported Responses API request, add this option to the request body:

{
  "prompt_cache_options": {
    "ttl": "12h"
  }
}

OpenAI's prompt-caching guide documents this for GPT-5.6 and later. The minimum cacheable prompt is 1,024 visible tokens. Omitting the lifetime keeps the 30-minute default.

Explicit breakpoints can use different lifetimes. Put stable shared material first and changing session content later. A later 12-hour breakpoint also covers the preceding prefix, so it can extend the pricing treatment of earlier material.

Check cached-read and cache-write usage separately when comparing costs. Otherwise, a higher read count can hide an expensive pattern of repeated writes.

What the Longer Lifetime Does Not Guarantee

The 12-hour setting establishes a minimum pricing-coverage window, not a deletion deadline. Reads do not restart that full window. Switching an existing 30-minute entry to 12 hours incurs a new long-cache write, without credit for the earlier write.

Pricing coverage also does not guarantee that reusable computation stays on the machine handling the next request. Lower latency is therefore not guaranteed merely because cached-input pricing applies.

For a scheduled agent, start by measuring gaps between runs and how often its shared context changes. A frequently revised reference document may erase the economic advantage of choosing a longer lifetime. A stable instruction set reused across the day is a much stronger candidate.

The practical change is that cache policy now belongs beside scheduling and prompt design. Keeping an agent inexpensive requires understanding when its context returns, not simply making every cache last longer.

I'm Paras. I work at the intersection of AI, engineering and distribution.

I help technical founders turn API changes and product thinking into clear stories that developers can understand and use.

Book a 30-minute call