← Back to the A-Z glossary
AI glossary · P1

Prompt caching

Prompt caching reuses the stable part of your context so the model runs faster and costs less.

Performance 4 min read Updated 2026-05-22
— Definition

Prompt caching, in plain words

Prompt caching reuses the stable part of your context so the model runs faster and costs less.

Present prompt caching as short-term memory on the provider's side, not as some magic trick.

A concrete example

My agent resends the same 4,000-token CLAUDE.md on every call. With caching, I pay about 10% of the usual cost on the cached part.

Why it matters

On an agent that loops, prompt caching cuts costs by 5 to 10x. It's the most profitable optimization out there.

You'll see it in OpenAI, Anthropic, Gemini, Claude Code, and any agent that keeps resending the same big documents.

Don't mix it up with

Token: A token is a small chunk of text the AI counts to measure what it reads, writes, and bills.

API key: An API key is a technical password that lets a tool call an AI service on your behalf.

Common mistakes

  • Forgetting that the cache has a lifespan (often 5 minutes).
  • Breaking the cache by changing even a single comma at the start of the prompt.
  • Thinking caching works on the output too (it doesn't — only on the input).

Quick checklist

  • First I check whether the word names a concept, a tool, a risk, or a metric.
  • I tie it to a concrete case: My agent resends the same 4,000-token CLAUDE.md on every call. With caching, I pay about 10% of the usual cost on the cached part.
  • I keep the main trap in mind: Forgetting that the cache has a lifespan (often 5 minutes).

Quick questions

What is Prompt caching in AI?

Prompt caching reuses the stable part of your context so the model runs faster and costs less.

Where will I run into Prompt caching?

You'll see it in OpenAI, Anthropic, Gemini, Claude Code, and any agent that keeps resending the same big documents.

Which word should I read next?

Start with Token, API key, Context window.

Want to keep going in order?

Head back to the full glossary, search a word, then open only the pages that deserve more than a short definition.

Open the AI glossary