ai-codehow-to

Claude's 5-Minute Prompt Cache: What Pauses Really Cost

An analysis of 30 days of coding-agent traffic found 23% of Claude API spend went to rebuilding expired prompt caches, against 9% on OpenAI. How the caches differ, which fixes saved money, and who is affected.

December 2, 2026

Claude's 5-Minute Prompt Cache: What Pauses Really Cost

If you pay for Claude by the token, a coffee break can cost more than the work around it. A cost analysis published December 1 by Requesty, an AI gateway company, found that 23% of the Claude spend it measured went to rebuilding prompt caches that had expired, against 9% on OpenAI's models. The cause is a five-minute timer. The post reached 380 points on Hacker News, where developers argued about how much it applies to them.

Why a short pause gets expensive

Coding agents resend the whole conversation on every turn, so long sessions depend on prompt caching: the repeated prefix is stored and billed at a fraction of the normal input price. On Claude Opus 5.5, Anthropic's docs list $4 per million input tokens, $0.20 for cache reads, and $5 to write the cache. The cache lives five minutes by default, and each read resets the timer.

Stop for longer than that and the next turn rewrites the whole prefix at the write price. Requesty's example: after an 8-minute break, a 210,000-token Opus 5.5 session pays about $1.05 to rewrite its cache instead of about $0.04 to read it. That is roughly 25 times more for the same turn, and long builds or test runs can trigger it without anyone leaving the desk.

How the three providers compare

  • Anthropic: 5-minute default, or a 1-hour cache you request with "ttl": "1h". Writes cost 1.25x input for 5 minutes and 2x for 1 hour; reads are 0.05x on Opus 5.5 and Sonnet 5.5 and 0.1x on most other models.
  • OpenAI: caching is automatic. On GPT-5.6 and later the docs give a 30-minute minimum lifetime by default (writes at 1.25x) or 12 hours (2.5x) on the Responses API. GPT-6.2 Sol lists $2 input, $0.10 cached input and $2.50 for a 30-minute write on OpenAI's pricing page.
  • Google: Gemini 4 caches implicitly with a 95% discount and no write surcharge, but Google says cache lifetime is best effort, up to 24 hours, and needs at least 4,096 tokens.

Per token, Anthropic and OpenAI now charge similar multipliers. The difference is mostly the clock.

What the data showed

Requesty looked at 30 days of production traffic (October 24 to November 22) from Claude Code, OpenCode, Codex, Pi and Kilo, using only token and billing counters. Pauses of 5 to 30 minutes cost Claude users 15.2% of their bill and GPT users 0.8%. Past 30 minutes the two were about equal, since both caches had expired by then.

It then tested fixes on replayed sessions:

  • Keep-alive pings that touch the cache before it expires saved about 8 to 9% net.
  • Switching to a 1-hour cache after the first pause saved about 5 to 7%.
  • Using 1 hour from the first turn cost more in 87 to 89% of sessions, because most sessions never pause long enough to recoup the 2x write.
  • Upgrading a warm 5-minute cache to 1 hour mid-session saved nothing in its tests.

Two caveats. Requesty sells caching and spend tools, and its dataset is not public, so the percentages cannot be checked independently. And some of its per-pause figures do not quite match the medians it shows.

Who this affects

This is an API billing issue. Commenters on Hacker News noted that Claude Code on a Claude subscription already uses a 1-hour cache for the main conversation and 5 minutes for subagents, and subscription usage is counted against plan limits rather than billed per token. Teams running agents on the Anthropic API, Bedrock or Vertex, or through tools like OpenCode with their own key, are the ones paying for expired caches.

What to do

  1. Leave short tasks and subagents on 5 minutes. They rarely pause long enough for the 1-hour write to pay off.
  2. Move long interactive sessions to 1 hour after the first long pause, not from the start.
  3. Consider a keep-alive around the 4-minute mark while a build or test runs. Pings still bill a cache read, so they only pay off on large prompts.
  4. Check your logs for cache writes after idle gaps before changing anything; the share varies a lot between teams.
  5. Compare on whole workdays, not single prompts. A cheaper per-token model can cost more if your workflow pauses often. Our cost calculator and pricing index show the base rates.

Some links in this article are affiliate links. Learn more.