What Is Prompt Caching and How Does It Cut Costs?

One Two Three AI — in your inbox

AI news, practical tips and how-to guides. One useful idea a day.

What Is Prompt Caching and How Does It Cut Costs?
Image generated with AI

If you’re using AI APIs like Claude or GPT-4 for work, you’ve probably noticed that costs add up fast—especially when you’re sending the same instructions, documents, or context over and over. Prompt caching is a feature that helps cut those costs by letting the model remember and reuse parts of your requests instead of processing them from scratch every time.

It’s not magic, and it’s not available everywhere. But if you’re running repetitive tasks with AI—like analyzing multiple documents against the same guidelines, or querying a large codebase—understanding how caching works can make a real difference to your bill.

How Prompt Caching Works

When you send a prompt to an AI model, the system processes every token—your instructions, any files you’ve attached, and the conversation history. That processing costs money, and the longer your prompt, the more you pay.

Prompt caching allows the model to store part of your prompt in memory for a short period (usually five to ten minutes). If you send another request soon after and part of it is identical—say, the same 50-page PDF or the same system instructions—the model can reuse the cached version instead of reprocessing those tokens.

The result: you only pay full price for the new or changed parts of your prompt. Cached tokens typically cost about 90% less than regular input tokens.

This works best when you have a large, stable block of content—like a style guide, a dataset, or a code repository—that you reference repeatedly in a short time window. If your prompts change completely each time, or if you space them out by hours, caching won’t help much.

Which Models Support It

As of November 2026, Anthropic offers prompt caching on Claude 3.5 Sonnet, Claude 3.5 Haiku, and Claude 3 Opus through their API. OpenAI has not yet released a public caching feature for GPT-4 or GPT-4o, though the company has hinted at similar optimizations in the background.

Google’s Gemini API includes a feature called “context caching” for Gemini 1.5 Pro and Gemini 1.5 Flash, which works similarly: you can cache up to 32,000 tokens for reuse across multiple requests within a limited time window.

If you’re using consumer chat interfaces like ChatGPT, Claude.ai, or Gemini, caching happens automatically in the background as part of conversation memory—you don’t control it directly or see itemized savings. The API version gives you more control and transparency about what gets cached and how much you save.

When Caching Actually Saves Money

Prompt caching makes the most sense in a few specific scenarios:

  • Batch processing with shared context. You’re running 50 customer support tickets through the same internal policy document, or analyzing 20 blog posts against the same style guide.
  • Iterative coding or debugging. You’re working with a large codebase and asking the AI multiple questions about it in a short session. The code stays cached while you iterate on different queries.
  • Multi-turn conversations with heavy context. You upload a 100-page research paper and ask a series of follow-up questions. The paper gets cached, so each follow-up costs less.

Caching doesn’t help much if your prompts are short, vary widely, or happen sporadically. And remember: the cache only lasts a few minutes. If you walk away for lunch and come back, you’re starting fresh.

How to Use It (API Users)

For Anthropic’s Claude API, you mark which parts of your prompt should be cached by structuring your request with specific cache control parameters. The documentation recommends placing large, reusable content—like documents or system instructions—early in your prompt, then flagging them for caching.

Google’s Gemini API works similarly: you explicitly pass context to the caching endpoint, then reference that cached context ID in subsequent requests.

If you’re using a wrapper library or no-code tool, check whether it supports caching. Many third-party platforms don’t expose the feature yet, which means you’re paying full price even when the underlying API could save you money.

What It Costs

Pricing varies by provider. For Claude, cached input tokens cost roughly one-tenth the price of standard input tokens. Output tokens (what the model generates) aren’t cached and cost the same as always.

There’s also usually a small fee to write data into the cache initially—so the first request with a large document might cost slightly more than normal, but every subsequent request within the cache window is cheaper.

Google’s context caching for Gemini follows a similar model: reduced rates for cached input, standard rates for new input and all output.

Neither provider charges for cache storage if you stay within the time window. Once the cache expires, you start over.

The Bottom Line

Prompt caching is a practical cost-saving feature for API users who send repetitive or context-heavy requests in quick succession. It won’t revolutionize how you use AI, but if you’re processing batches of documents, working with large codebases, or running iterative analysis sessions, it can cut your input token costs significantly.

If you’re only using consumer chat tools, you don’t need to think about it—caching is handled automatically behind the scenes. But if you’re building workflows or integrations on top of AI APIs, it’s worth checking whether your provider supports caching and whether your use case fits the pattern.

Want one useful AI idea in your inbox every day? Subscribe to the One Two Three AI newsletter and stay sharp on what actually matters.

One Two Three AI — in your inbox

AI news, practical tips and how-to guides. One useful idea a day.

Other newsletters you might like

How To Move To Ireland

A daily newsletter and blog for people moving to Ireland — visas and immigration, finding work, housing, healthcare, cost of living, banking, driving, schools and settling in.

Subscribe

Love Castles

Apart from the fascinating and rich history of castles, people love to visit them for their majestic beauty. From the imposing stone walls to the beautiful architecture, there is something captivating about these grand structures.

Subscribe

Love Italy

Love Italy is a comprehensive online platform and Newsletter that is devoted to showcasing the beauty, charm, and allure of Italy as a premier travel destination.

Subscribe

Irish Rugby Fans

The best Irish rugby updates, straight to your inbox — Six Nations, the Nations Championship and the provinces. Only when there's something worth reading.

Subscribe

Newsletters via the One Two Three Send network.  ·  Want your newsletter featured here? Click here

Scroll to Top