Frontier Foundry

Prompt Caching

The Library · Context Engineering & Memory

Reusing computation for repeated prompt prefixes to cut cost and latency.

Also called: context caching, cache hit, cached input. In the glossary.

Prompt Caching is cooling this week (×0.26 against the eight weeks before). What is moving.

How it works, as a machineThe Cold Store · requests

Follow one request from a loose draft to its first token back, in a cold-chain depot: receiving dock, frozen aisles and a prefill line.

  1. Stack stable first
  2. Set the cache breakpoint
  3. Match the prefix
  4. Read the cached prefix
  5. Cook the new tail
  6. Send the first token
Play Prompt Caching

Prompt Caching in plain words

Prompt caching saves the work a model did on the start of a prompt so it can be reused when the next request begins the same way. Long instructions and documents are then processed once and not on every call. Repeated requests get cheaper and faster, as long as the shared start does not change.

An analogy

A stage crew that leaves the set standing between performances. Tonight's show opens on the same room as last night's, so only the props for the new scene are carried in. Move one wall at the back and everything in front of it has to be built again.

How Prompt Caching connects

6 typed relations in the knowledge graph

Builds on

  • Context Engineering: What goes into the prompt and in what order is context engineering; the cache rewards a layout that stays still.
  • Token Economics & Pricing: The write premium, the read discount and the hit rate are what turn the price of a token into the price of a task.

Built on by

  • Agent Harness: A byte-identical prefix is what makes long sessions affordable.
  • Context Engineering: The stamp press is the prompt cache: a strict prefix match billed at a fraction of normal.
  • Token Economics & Pricing: The prompt cache vault is prompt caching: the repeated prefix is read from a cache at a fraction of the input price.

Makes possible

Often in the same sources

Token Economics & Pricing

See Prompt Caching in the knowledge graph

Who is behind Prompt Caching

people, labs, products and models

Named in its facts

What the sources say

3 parts · 12 sources · updated 2026-11-27

Prompt caching reuses the computed state of the front of a prompt, so that a turn which repeats the instructions, tools and history of the last one only pays full price for its new tail. It works only on an exact prefix match, so layout decides the bill; it needs a write at a premium and a limited life. In agent work, where each turn resends everything, the cache hit share is the biggest cost lever the sources name.

How the prompt is laid out

A prompt cache reuses only the front of a prompt, and only if every byte of that front is the same as last time. So the layout decides everything: what never changes goes first, what changes each turn goes last, and the reusable front can be cut off with an explicit mark.

  1. The pallet bay stacks the prompt: what never changes goes first, what changes every turn goes last.
  2. The cut-line stamp marks where the reusable front ends; a change before the line makes a new front.
28% less uncached input
Cut in uncached input after one startup added cache breakpoints and workspace-specific keys to a shared 29,000-token prompt; the startup's own report in a vendor guide OpenAI
  • A prompt cache is a strict prefix match: a change of even one byte in the prefix invalidates it, so a multi-turn app must take care not to break it. Lance Martin
  • A cache-friendly layout runs from what all sessions share (system instructions, tools) to what one project shares (a project file, memory) to session state, then to the messages that grow every turn. Lance Martin
  • When an agent's tools change, keep the tool definitions, their schemas and their order the same, and switch tools on or off with an allowed-tools setting instead of removing them. OpenAI

How the stored front is found

The cache is not one shelf: stored state lives on particular machines and in tiers, so a request has to be matched to a stored front and sent to where it is. A hit costs about a tenth and comes back sooner; a miss is served at full price.

  1. The prefix board matches the prompt, from its first byte, to a stored front and sends it to the aisle that holds it.
  2. The chilled rack hands back the stored front at about a tenth of the price, so only the new tail needs work.
about 3 s, then about 1 s
Time for a request in a routing demo: the first request, which fills the cache, takes about 3 seconds; the next with the same system prompt takes about 1 second; shown on stage by the speakers Yuchen Fama
  • Cached input is billed at about a tenth of the base rate and is also much faster, which is why multi-turn apps should lean on it. Lance Martin
  • A router can send each request to the pod with the lowest load and the best chance of a cache hit, by scoring running and waiting requests, KV cache use and prefix cache availability. Yuchen Fama
  • Cached state sits in hot, warm and cold tiers; work is under way to offload to NVMe SSD and file systems and to evict by session, with sessions pinned where they need to stay. Yuchen Fama

When it breaksA new system prompt, a cold aisle. In a routing demo the first request filled the cache in about three seconds and the second, with the same system prompt, took about one. On the third turn a new system prompt arrived: the request took about three seconds again and landed on a different pod with no cache hit. Yuchen Fama

How the tail is computed and the front is kept

After a match only the new tail of the prompt is computed. The longer front is then written back to the shelf, at a premium, and kept for a limited time: 30 minutes by default, 12 hours at a higher write price. Agents turn this loop many times, so the share of tokens that hit the cache decides the bill.

  1. The prefill oven computes only the new tail of the prompt, on top of the stored front.
  2. The blast chiller writes the longer front back to the shelf, at a premium, for the next turn.
  3. The serving hatch sends the first token back; the answer joins the history for the next turn.
1.25x write, 90% off read
Price of writing to the cache and of reading from it, against the model's uncached input price, for the 5.6 family and later Simon Willison
30 minutes
Window in which an eligible shared prefix is reused for a cache discount on the GPT-6 family OpenAI
2.5x write for 12 hours
12-hour cache writes against the plain input token price; reads hours later still get the lower cached-input price OpenAI
$21 to over $200 a task
Cost of one agentic knowledge-work task with cached input against the same task with a cache hit rate of zero, from one benchmark firm's cost build-up George Cameron
up to 72% less cost
Cost savings found in internal benchmarks by auditing harnesses that did not use the prompt cache properly, with no meaningful change in performance; the lab's own report Lance Martin
96% input cache hit
Share of input tokens served from cache in one inference provider's production report; first-party claim, not audited AINews
36.6 million cache-read tokens
Cache-read tokens in one 447-turn coding task, which at one frontier price table made cache reads two thirds of the bill; a commenter's own arithmetic k9294
97% of tokens cached
Share of tokens that were cached in a full-history setup on one open model in a tutor-app test, where keeping the whole history was also the cheapest run AI Engineer
50x compression
How far compaction would have to compress the context to pay off when cached tokens cost one fiftieth of new ones AI Engineer
about 100 PiB of SSD
Size of the storage cluster that holds persistent prefix state in one provider's reported design, with retention of three days for agent traffic AINews
0.5 to 1 point of hits
Extra cache hits that the long tail of retention buys, according to one inference engineer's commentary on that design AINews
over 50% fewer fresh tokens
Fall in the share of prompt tokens that need fresh processing across billions of requests, after months of cache improvements; one customer's own report OpenAI
  • Without a cache every follow-up question makes the provider recompute all the previous tokens, so a long chat pays for the same tokens again and again. Louis-François Bouchard
  • With a cache the provider saves the computed state of a prefix and reloads it, so reused tokens are far cheaper and the first answer comes back sooner. Louis-François Bouchard
  • Prewarming prepares known context, such as shared instructions, tool definitions or reference material, at startup, so the model can start answering sooner when the first request arrives. OpenAI

When it breaksHarnesses that never hit the cache. Engineers ran a cache diagnostic command over internal benchmarks that used default harnesses. Some harnesses were not using the prompt cache properly, and fixing the layout showed savings of up to 72% with no meaningful change in performance. Lance Martin

Open questionHow long is it worth keeping a stored front?

  • Pay a higher write price for a 12-hour cache, so that reads still hit when requests are hours apart. OpenAI
  • The long tail of retention buys only a point or so of extra hits for a lot of storage. AINews

Sources

12 in all

More in Context Engineering & Memory

The Library: the whole area
  • Context EngineeringDeciding what goes into a model's limited context window, when, and in what form.
  • Long ContextModels that read very long inputs (hundreds of thousands to millions of tokens).
  • Retrieval-Augmented GenerationFetching relevant documents at question time and putting them in the prompt.
  • EmbeddingsVectors that place similar meanings near each other, used for search and clustering.
  • Agent MemoryLetting agents keep and recall information across sessions.
  • Prompt EngineeringWriting instructions and examples that steer a model's behavior.
  • Knowledge GraphsStoring facts as linked entities so agents can traverse relationships.