Requesty
Back|NOV '26AI MODELS / COST OPTIMIZATION
9 MIN READ|

OpenAI prompt caching: prompt_cache_key, pricing and hit rates

Last updated

OpenAI prompt caching is automatic on supported models. GPT-5.6 and later have a minimum cacheable prompt length of 1,024 tokens, and November 2026 cached input prices are 5% or 10% of the ordinary input price. In our October 2026 traffic, OpenAI served 77.73% of input tokens from cache.

How does OpenAI prompt caching work?

A prompt prefix is the beginning of the rendered request. OpenAI checks that prefix for a match and can reuse it across requests. The prefix can include OpenAI-provided instructions, developer messages, tool definitions and conversation history.

OpenAI's guide sets a 1,024-token minimum cacheable prompt length on GPT-5.6 and later. For earlier models, the minimum varies with request settings. Caches are separate across organizations and regional processing boundaries, and cached tokens still count toward tokens-per-minute limits.

Put content that stays the same at the beginning of the request, followed by the content that changes. A timestamp near the start of the prompt changes the prefix on every request, so the match breaks from that point onward and only the content before it can be reused; OpenAI's cookbook suggests moving it to metadata.

For GPT-5.6 and later in the Responses API, a static developer message followed by a changing user message may not reuse the shared prefix under implicit caching alone. The shared prefix can be reused when a matching cache entry ending at that boundary is available. Place an explicit prompt_cache_breakpoint after the reusable content in both requests, as described in OpenAI's guide.

Tip
Keep the prefix stable

Keep reusable instructions and tool definitions in the same order across requests. Put request-specific content after the shared prefix.

For GPT-6.2 models in the Responses API, OpenAI appends top-level instructions after the input and bills those instruction tokens at the uncached rate on every request. Put reusable instructions in the first developer message instead, as described in the prompt caching guide.

What does prompt_cache_key do?

On models before GPT-5.6, prompt_cache_key helps OpenAI route requests that share a reusable prefix toward the same cache. Use a stable key for that group of requests (see OpenAI's prompt_cache_key example). The key influences routing, but it does not pin a request to a machine or guarantee a hit.

For busy groups, OpenAI recommends aiming for about 15 requests per minute across all prefixes using each key. Above that, partition traffic across multiple keys using a stable, deterministic mapping.

On GPT-5.6 and later, OpenAI handles cache routing automatically. Separate keys can still provide separate cache accounting per customer or user and help prevent cache-hit probing across users. Requests with different keys keep separate caches even when their prefixes match.

The examples below send two requests through Requesty's OpenAI-compatible endpoint with the same prefix. They print the cached input tokens reported in each response. The first request can write the prefix; a later request may read it from cache. When we ran the Python version in November 2026, the first request reported 0 cached tokens and the second reported 2,404 of 2,417 input tokens.

Python
import os
from openai import OpenAI
 
client = OpenAI(
    base_url="https://router.requesty.ai/v1",
    api_key=os.environ["REQUESTY_API_KEY"],
)
 
prefix = "Keep answers concise and follow these instructions. " * 300
 
for question in ["What is a cache?", "What is a cache hit?"]:
    response = client.chat.completions.create(
        model="openai/gpt-6.1-sol",
        messages=[
            {"role": "system", "content": prefix},
            {"role": "user", "content": question},
        ],
    )
    details = response.usage.prompt_tokens_details
    print("Cached tokens:", details.cached_tokens if details else 0)

What does cached input cost?

The table uses November 2026 OpenAI Standard tier list prices for short-context text, in US dollars per million tokens. Requests through Requesty are billed at the provider's model cost plus Requesty's 5% fee.

The write prices use OpenAI's 1.25 times and 2.5 times multipliers for 30-minute and 12-hour writes respectively. The 12-hour minimum lifetime is an option in the Responses API.

ModelInputCached read30-minute write12-hour writeOutput
GPT-6.2 Astra$8.00$0.40$10.00$20.00$40.00
GPT-6.2 Sol$2.00$0.10$2.50$5.00$10.00
GPT-6.1 Sol$2.00$0.10$2.50$5.00$10.00
GPT-6.1 Terra$1.00$0.05$1.25$2.50$5.00
GPT-6 Astra$10.00$1.00$12.50$25.00$50.00
GPT-6 Luna$0.10$0.01$0.125$0.25$0.50

Sources: OpenAI's pricing page, GPT-6.2 Astra page and GPT-6.1 Sol page and GPT-6.1 Sol page.

A cache write is billed at the write rate, with no extra charge on top of the ordinary input rate. Reads are billed at the cached rate.

For GPT-6.1 Sol, prompts over 272,000 input tokens cost twice the listed input and cache rates, and 1.5 times the listed output rate for the full request. Batch and Flex are 50% below Standard; Fast is twice Standard.

When does a cache write pay off?

Take GPT-6.1 Sol at November 2026 OpenAI Standard prices: $2.00 per million ordinary input tokens, $2.50 per million tokens for a 30-minute write and $0.10 per million cached tokens.

Take a shared prefix of 100,000 tokens used in 20 requests within the cache window. The first request writes the full prefix, and the next 19 read it in full. The changing suffix and output cost the same in each case, so we leave them out.

CalculationPrefix input cost
20 requests: 20 x 0.1 million x $2.00$4.00
One 30-minute write: 0.1 million x $2.50$0.25
19 cached reads: 19 x 0.1 million x $0.10$0.19
Write plus reads$0.44

That is an 89% reduction against the ordinary input price for the prefix. If the prefix is never read again, the write costs more: $0.25 against $0.20 at the ordinary input rate, or 25% more.

A 12-hour write costs $0.50 for the same prefix. With one read, the write and read total $0.51, against $0.40 for two ordinary inputs. With two reads, they total $0.52, against $0.60 for three ordinary inputs.

The choice between cache lifetimes depends on when requests arrive. In the Responses API, OpenAI's prompt_cache_options.ttl selects a minimum cache lifetime of 30m or 12h (guide). For example, say three requests arrive over three hours, with gaps longer than 30 minutes, and each gap requires a new 30-minute write. Three short writes cost $0.75; one 12-hour write plus two reads costs $0.52.

In this example, the 12-hour write saves money once it replaces at least two 30-minute rewrites after the first write.

How does OpenAI's hit rate compare?

In our October 2026 provider data, 77.73% of OpenAI input tokens came from cache, below the 80.4% median for major providers.

The table shows a selection of providers:

ProviderCached share of input tokens
Fireworks94.04%
DeepSeek88.53%
Bedrock82.41%
Vertex (Claude)82.28%
Anthropic80.36%
OpenAI77.73%
Azure72.39%
Vertex (Gemini)51.06%

The measure is cached input tokens divided by input tokens, not the share of requests with a hit. Workload changes the result: long agent sessions with stable prefixes tend to reuse more input than one-off requests. Some providers also count only explicit cache reads.

What does that difference mean for a bill? Take one billion input tokens per month on GPT-6.1 Sol, with misses charged at the ordinary $2.00 rate and hits at $0.10 per million. We exclude write charges for this estimate, so the result is an optimistic input cost.

Hit rateEstimated input cost
0%$2,000
77.73%About $523
80.4%About $472

The calculation is 1,000 times [(1 - hit rate) x $2.00 + hit rate x $0.10]. Moving from OpenAI's October rate to the major-provider median saves about $51 per billion input tokens, before write charges.

How do you diagnose cache misses?

Start with the rendered prefix. A changed tool definition can break reuse even if the text of the user request looks familiar. In its GPT-6 launch post, OpenAI shows a diagnostic response with reason: tools_changed and 5,629 missed tokens.

OpenAI's Prompt Caching Dashboard shows cache read hit rates. For supported GPT-5.6 and later models, the Responses API also has Prompt Cache Diagnostics. Setting comparison_response_id requests diagnostics; it does not load the earlier conversation or change caching behavior.

Check a falling cache hit rate

0 of 5 done

For GPT-5.6 and later, cached_tokens counts billed reads and excludes writes. The cache_write_tokens_details field separates 30-minute and 12-hour write tokens, which helps explain a bill where a high read rate still comes with substantial write cost (source).

OpenAI also supports explicit cache breakpoints in a developer message. In the Responses API, prompt_cache_breakpoint marks an explicit boundary on an input_text block. Implicit mode also reuses earlier eligible message endings (guide).

In one OpenAI customer example, moving to explicit breakpoints raised eval cache hit rates from 83% to 91%, reduced cache writes by roughly two thirds and cut inference costs by 36%.

Compare your own traffic

Start with your largest repeated prompts and measure cached tokens, writes and input cost together. A high hit rate is useful, but the write bill tells you whether the cache is being rebuilt too often. For a wider price comparison, see our cache read price comparison across providers.

OpenAI manages its own caching when you call it through Requesty. Cache hits appear in Requesty cache analytics without setting auto_cache (docs). Requesty reports cache savings by model and team; its cost tracking also breaks down spend by provider, user and API key. Our OpenAI API pricing guide has the model price comparison.

If your fallback chain includes a provider that requires explicit breakpoints, Requesty's auto caching can add them. A different model or provider has a separate cache, so include the cost of warming that cache when comparing fallback and load-balancing choices. Our Anthropic prompt caching guide covers its cache controls.

Pick one high-volume workload, record its current read and write tokens, then move changing content out of its shared prefix. Compare the next set of requests against that baseline before changing cache retention or splitting traffic across keys.

Frequently asked questions
Is OpenAI prompt caching automatic?
OpenAI prompt caching is enabled by default on supported models. For GPT-5.6 and later, the minimum cacheable prompt length is 1,024 tokens, and reuse requires a matching prefix.
What does prompt_cache_key do on OpenAI models?
Before GPT-5.6, a stable prompt_cache_key helps route requests with a shared prefix toward the same cache. On GPT-5.6 and later, routing is automatic, while separate keys provide separate cache accounting.
How much does OpenAI cached input cost?
In November 2026, GPT-6.1 Sol cached input costs $0.10 per million tokens on the OpenAI Standard tier, compared with $2.00 for ordinary input. A 30-minute cache write costs $2.50 per million tokens.
Does OpenAI charge for cache writes?
GPT-5.6 and later charge 1.25 times the ordinary input rate for a 30-minute cache write. A 12-hour minimum lifetime is available in the Responses API at 2.5 times the input rate.
What is a typical OpenAI prompt cache hit rate?
In October 2026, 77.73% of OpenAI input tokens on Requesty came from cache. Hit rates depend on the workload, so a long agent session and a one-off request can produce different results.
Do cached OpenAI tokens count toward rate limits?
Cached OpenAI input tokens still count toward tokens-per-minute limits, even when they are billed at the lower cached input rate.
Related reading

Start building with Requesty

One line of code. 600+ models. Full control.

Speak to founders