See what your AI agent really costs

Does Prompt Caching Actually Save Money for AI Agents?

Updated 2026-10-25. Prices from models.json, checked against official pricing pages on 2026-10-25.

Short answer: yes, usually by a lot, but only when your agent reuses the same prompt prefix again before the cache expires. If it doesn't, caching can cost you more than not caching at all. This guide walks through how caching is billed, when it pays for itself, and worked examples using current list prices.

Why agents are a perfect fit for caching

An agent loop resends almost the same prompt on every step: the system prompt, tool definitions, examples, and the conversation so far. Only the newest tool result or user message changes. A 30-step coding or research task can send the same 20,000-token prefix 30 times. Without caching you pay full input price for every copy.

Prompt caching lets the provider store that processed prefix. On later requests that start with the exact same tokens, you pay a much lower "cache read" rate for the reused part.

How caching is billed

Caching has three input prices, not one:

Token typeAnthropic (Claude)OpenAI (GPT-5.6 and later)
Uncached input1x base input1x base input
Cache write1.25x (5-minute TTL) or 2x (1-hour TTL)1.25x (30-minute default) or 2.5x (12-hour, Responses API only)
Cache read0.1x on most models; 0.05x on Opus 5.5 and Sonnet 5.5; 0.025x on Fable 5.1 / Mythos 5.10.1x on most models; 0.05x on GPT-6.1 Sol

Two details that people miss:

  1. Writes cost extra. The first time a prefix gets cached, you pay a premium over normal input. OpenAI notes that the write rate replaces the normal input rate instead of adding on top of it, but it's still more than an uncached request.
  2. Output is never discounted. Caching only touches input. If your agent's bill is mostly output or reasoning tokens, caching won't move it much.

OpenAI caches automatically on supported models. On Anthropic you turn it on with cache_control, either automatically at the top level of the request or with explicit breakpoints.

Current prices for popular agent models

Per 1M tokens, standard tier, short context (from TokenTab's models.json, checked against official pages on 2026-10-25):

ModelInputCache write (shortest TTL)Cache readOutput
Claude Sonnet 5.5$2.00$2.50$0.10$10.00
Claude Opus 5.5$4.00$5.00$0.20$20.00
Claude Haiku 5.5 (≤100K prompt)$0.10$0.125$0.01$0.50
GPT-6.1 Sol$2.00$2.50$0.10$10.00
GPT-6 Luna$0.10$0.125$0.01$0.50

Break-even: how many reads before caching pays?

Take a prefix whose uncached cost is 1 unit per request. On Sonnet 5.5 with the 5-minute cache, writing once costs 1.25 and every read after that costs 0.05.

That fits Anthropic's own guidance: with the 0.1x read rate, a 5-minute write pays for itself after one read, and a 1-hour write (2x) after two. OpenAI's docs do the same math for their 0.1x models: one write plus nine reads costs 2.15x the base price, compared with 10x without caching.

Worked example: a 30-step agent task

Assume a 20,000-token stable prefix (system prompt plus tools) that the agent sends on each of 30 steps in one session, with the cache staying warm the whole time. This counts the prefix only, not the growing history or output.

Claude Sonnet 5.5

GPT-6.1 Sol has the same list prices, so it comes out the same: $1.20 down to about $0.11.

Claude Haiku 5.5

The percentage is similar on every model. The dollar savings grow with the base input price, which is why caching matters most on frontier models and in long sessions.

When caching does NOT save money

1. Cold starts after the cache expires. If your agent wakes up on a timer every 10 minutes and the cache lasts 5, every wake-up pays the write premium (1.25x) and never gets a read. That's 25% more than not caching. Fixes: use a longer TTL (Anthropic's 1-hour write, or OpenAI's 12-hour write in the Responses API), or batch the work into fewer, denser sessions. Builders on r/AI_Agents have described the same pattern: a high token hit rate can still hide a large bill when cold starts keep paying for writes.

2. Something dynamic near the top of the prompt. Caching matches on an exact prefix. A timestamp, session ID, or recalled memory placed in the system prompt changes the prefix on every call, so each request becomes a write. Put static content (instructions, tool schemas, examples) first and anything that changes last. Check cache_read_input_tokens (Anthropic) or cached_tokens (OpenAI) in the usage object. If reads sit near zero while writes match your prompt size, something is rewriting your prefix.

3. Output-heavy workloads. If most of your spend is output or reasoning tokens, a 90% cut on input only trims a small part of the bill.

4. Long-context surcharges still apply. On Claude Haiku 5.5, a prompt over 100K tokens is billed at the higher tier ($0.50 input, $0.05 cache read), even when much of it is cached.

Stacking with batch discounts

Anthropic says caching multipliers stack with the 50% Batch API discount. Batch jobs can take longer than 5 minutes, though, so Anthropic suggests the 1-hour cache for batches that share context. Batch works well for agent side jobs like evals and summaries, but not for the live loop, where every step waits on the one before it.

Estimate your own numbers

The real savings depend on three things: how big your stable prefix is, how many steps reuse it per session, and how often sessions start cold. Model your own prefix size, reuse and cache hit rate in the TokenTab prompt caching calculator, or put your step count, tokens per step, and model into the TokenTab AI agent cost calculator to compare monthly cost across providers before you refactor your prompts. For when to batch non-urgent work, see Is the Batch API worth it for AI agents?

Sources

Prices retrieved 2026-10-25.

Get the TokenTab newsletter

Model price changes and agent cost tips, straight to your inbox. Unsubscribe anytime; we only use your email for this newsletter.