Resources

What is prompt caching, and when should you use it?

Prompt caching is a feature of the Claude API that lets you reuse a large, repeated part of a prompt at a lower cost. Instead of paying full price to send the same long context every time, cached input can cost up to 90% less, and the responses still come back immediately. Use it when many real-time requests share the same big block of content, such as a long policy document, a product manual or a detailed set of instructions.

The problem prompt caching solves

Many business applications send the same material with every request. A customer-support assistant might include a 40-page product manual so Claude can answer accurately. A review tool might include the company style guide every time. Each request pays to process that identical text again, even though only the user's question is new.

Prompt caching lets the platform remember the repeated part. When a later request begins with the same cached content, that portion is billed at the reduced cached rate instead of the full input rate. The new, changing part of the prompt, such as the customer's question, is handled as usual.

How it works in plain terms

Think of it as a bookmark. You mark the stable beginning of your prompt as something to keep. The first request processes it normally. Later requests that start with exactly the same content can reuse it. Two practical consequences follow:

  • Order matters. Put the stable material first (instructions, reference documents, examples) and the changing material last (the user's question). If the repeated part changes, the saving is lost.
  • Cached content does not last forever. It is kept for a limited time, so caching pays off when requests arrive close together rather than once a week. Check Anthropic's current documentation for the exact behaviour, as details change.

When prompt caching is a good fit

  • A long, fixed context reused across many requests. Manuals, policies, knowledge bases and long system instructions are typical examples.
  • Multi-turn conversations. The earlier part of a conversation is repeated as the chat grows, so it can be reused.
  • Few-shot prompts with many examples. A large block of worked examples that never changes is a natural candidate.
  • Real-time use. Because the response is still immediate, caching suits live chat, internal assistants and anything a person is waiting on.

When it is not worth using

  • Short prompts. If there is little repeated text, there is little to save.
  • Content that changes every time. Without a stable beginning, nothing can be reused.
  • Rare, one-off requests. If the same context is not reused soon, the saving may never arrive.

Prompt caching vs Message Batches

These two features are often confused because both reduce cost, but they solve different problems.

FeatureSavingTimingBest when
Prompt cachingUp to 90% off cached inputImmediateThe same large context is reused in real-time calls
Message Batches API50% cheaperUp to 24 hours, no fixed turnaround timeLarge volumes of work that can wait

The deciding question is whether anyone is waiting for the answer. A live support chat cannot wait a day, so batch processing is out; if it reuses the same large context, caching is the right tool. A nightly job that summarises thousands of documents can wait, so batch processing fits. The two address different needs, and choosing between them is a typical judgement call in architecture decisions.

A simple example

Imagine a Malaysian company that builds an internal HR assistant. Every request includes the full staff handbook so answers stay consistent with company policy. Employees ask questions throughout the day, so requests arrive close together. The handbook is the stable part and goes first; the employee's question goes last. With caching, the handbook is not paid for at full price on every question. Without it, the company pays to reprocess the whole handbook each time.

Whatever you build, check the answers for accuracy and keep sensitive data in mind; see our guide on how to check if AI output is accurate.

Where this appears in Claude certification

For the Claude Certified Architect exam (CCAR-F), you only need the idea at a decision level: caching reduces the cost of reused context without delaying responses, and it is the right choice over batch processing when requests are real-time. You do not need the internals. The six core concepts and the cheat sheet place it alongside the other cost and architecture choices, and the glossary has a short definition.

Agmo Studio, a Select Partner of the Anthropic Claude Partner Network, runs exam-preparation workshops through Agmo Academy. Certifications themselves are issued by Anthropic. See the Claude Certified Architect program for details.

Common Questions

FAQ

What is prompt caching in simple terms?
It lets Claude reuse a large, repeated part of a prompt at a lower cost instead of processing it in full every time. Cached input can cost up to 90% less.
Does prompt caching slow down responses?
No. Responses are still immediate, which is why it suits real-time use. This is the key difference from the Message Batches API, which can take up to 24 hours.
Should I use prompt caching or the Message Batches API?
If requests are real-time and reuse the same large context, use prompt caching. If the work can wait and you have large volumes, the Message Batches API is 50% cheaper.

Questions about AI training for your team?

Message us on WhatsApp or email — we'll point you to the right program.

Chat With Us on WhatsApp Email Us