Cost
A reused prefix can be billed at a lower input rate than processing that text again. A cache hit is not guaranteed, and each provider sets its own size rule and time limit.
Map · Foundations · 04 · Prompt Caching
Concept card · Foundations
Prompt caching reuses an unchanged prefix of a prompt so a later request can skip processing that part again.
Reusing an unchanged prefix so a repeated prompt can cost less than sending it from scratch.
Oct 17: First card. The picture compares an unchanged prefix with a prefix that changed. Sources are the OpenAI, Anthropic, and Gemini caching guides.
A prompt often starts with the same instructions or the same document, then ends with a new question. Prompt caching keeps that shared beginning, the prefix, so a later request can reuse it instead of processing those tokens from scratch.
A reused prefix can be billed at a lower input rate than processing that text again. A cache hit is not guaranteed, and each provider sets its own size rule and time limit.
The new question is still processed. Caching does not answer it for you.
The prefix is still sent to the provider. A change to the prefix, the model, or the tool list can mean the earlier prefix is not reused.
Take one prompt you send often. Put the stable instructions and the stable document first, and the part that changes last. Send it twice and look for a cached-input count in the usage report.
Editing the start of the prompt, or switching the model or the tools, and expecting the previous prefix to be reused.
The instructions and the document stay the same. Only the question changes. What can be reused?
Coming soon. One prompt you already send, with the stable part moved to the front.
Coming soon. How OpenAI, Anthropic, and Gemini each decide that a prefix matches.