Prompt Caching
Also called context caching, prefix caching.
Prompt caching stores the model's processed state for a reused prompt prefix, such as a long system prompt or document, so later requests sharing that prefix are cheaper and faster.
Description
Because caches match on an exact prefix, prompts are structured with stable content first and variable content last. In Anthropic's API, developers mark cache breakpoints explicitly or let the API place one automatically and move it forward as a conversation grows. Cache entries expire after five minutes without use by default, with a one-hour option, and cached input is billed at a fraction of the normal input price. OpenAI added a 12-hour cache option to its API in October 2026, with cache writes billed at 2.5 times the input price.
Sources
- Anthropic (2024). Prompt caching.
- OpenAI (2026). Changelog.
Cite this entry
Protologue. (2026). Prompt Caching. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.7.0, PTL-0081). https://protologue.com/t/prompt-caching/
BibTeX
@misc{protologue_prompt_caching,
title = {Prompt Caching},
author = {{Protologue}},
year = {2026},
howpublished = {Protologue: A Taxonomy of Prompting and LLM Techniques, v1.7.0},
note = {Entry PTL-0081},
url = {https://protologue.com/t/prompt-caching/}
}New terms, as they're coined
One email a week with the newest techniques, each defined and sourced like this entry.
Delivered through Beehiiv. Unsubscribe from any issue.