Deutsch

Prompt caching

Checked 26 October 2026 · by A.Frick

In shortPrompt caching lets an AI provider reuse the already processed start of your prompt, so repeated parts are cheaper and faster.

In plain words

Many requests begin with the same long text: a system prompt, tool descriptions, a manual, or the earlier turns of a chat. Processing it again each time wastes work. With prompt caching, the provider keeps the processed form of that fixed start for a short time. If your next request begins with exactly the same text, it reads from the cache and only processes the new part in full.

Request 1 Long fixed start: written to cache New part Request 2 Same start: read from cache New part The start must match exactly. One changed character breaks the match.
Cache reads cost less than normal input; check each provider's terms.

Details differ by provider:

Why it matters

Example

A support bot sends an 8,000-token product manual plus the system prompt with every question. Without caching, each question pays full price for all of it. With caching, questions that arrive within the cache lifetime read the manual from the cache and pay full price only for the customer's short question and the answer.

Common misconceptions

Questions and answers

What is prompt caching?

A feature where the provider keeps the processed start of a prompt for a short time and reuses it, so repeated text costs less and responds faster.

How long does a prompt cache last?

It depends on the provider and the setting. Anthropic's default is 5 minutes, refreshed on each use, with a 1-hour option at extra cost.

How do I get cache hits?

Keep the start of your prompt identical between requests: system prompt, tools and documents first, the changing question last.

Read next

  • Context window

    The context window is the maximum amount of text, counted in tokens, that a model can read and write in one request.

  • Token

    A token is a small chunk of text, often a word piece, that an AI model reads, writes and bills.

  • Rate limit

    A rate limit caps how many requests or tokens you may send to an AI API in a set time; going over returns an error, usually HTTP 429.

  • System prompt

    A system prompt is a block of standing instructions, set by an app or developer, that shapes how a model behaves across a whole conversation.

  • Price per million tokens

    Price per million tokens is the usual way AI APIs state their rates: what you pay for each million tokens sent in or generated.

Sources

  1. Anthropic — Prompt caching
  2. OpenAI — Prompt caching
  3. Google — Context caching (Gemini API)

Was this page helpful?

Ask a question, report an error or suggest a topic

Stored only to answer or improve this page. No newsletter, no sharing. Privacy