SalpXXAPI News
Model Guides 3 min read

Caching is not a discount: the real cost structure of Claude and GPT prompt caching

Caching splits a prompt prefix into three prices — normal input, cache write, cache read. You only start saving on the second reuse, and one channel switch on a gateway can reset your hit rate to zero.

Caching is repricing, not a discount

Prompt caching is not free acceleration. It splits a prefix into three prices:

  • Normal input — standard input price when nothing hits.
  • Cache write — Anthropic: 1.25x for the 5-minute tier, 2x for 1 hour1; OpenAI: 1.25x for 30 minutes, 2.5x for 12 hours2.
  • Cache read — 0.1x on most models, lower on a few newer ones12.

The rule is blunt: a prefix starts paying off on its second use. Turn caching on for a one-shot request and you simply pay 25% more.

Do the math first

Take the prefix price as 1, one write plus N reads:

  • No cache: cost = 1 + N
  • With cache: cost = 1.25 + 0.1N

At N=1 that is 2.0 down to 1.35 — 32% saved. At N=9 it is 10 down to 2.15 — 78% saved. The curve steepens with reuse.

Two hidden costs eat into that:

  • One changed character invalidates everything. Adding or removing an image, editing tool definitions, changing thinking parameters — all void the cache and you still paid the write1.
  • Anything shorter than the minimum is not cached at all. Anthropic's thresholds run from 512 to 4,096 tokens depending on model1; OpenAI uses 1,024 visible tokens from GPT-5.6 onward, while earlier models vary with tools, images and reasoning effort2.

Two very different mechanisms

  • Anthropic is explicit. You mark cache_control on content blocks, up to four breakpoints; the full prefix before a breakpoint becomes one cache record; the hierarchy is tools → system → messages, so changing an upper layer invalidates everything below it1.
  • OpenAI is automatic by default. Implicit caching places a breakpoint at the latest message with no configuration; from GPT-5.6 you can use an explicit prompt_cache_breakpoint, and in explicit mode a missing breakpoint means nothing is cached at all2.

One asks you to draw the line; the other draws it for you. In practice: Anthropic's payoff depends on breakpoint placement, OpenAI's on prefix stability.

Three traps on a gateway

  1. Switching channels switches cache domains. Caches are scoped per organization or workspace and are not shared across them12. When a gateway load-balances by health onto a different upstream, an identical prefix still misses — visible on the bill as "same traffic, wildly different cost".
  1. Dynamic content inside the prefix. Timestamps, usernames, "today is the 13th" — put them in the system prompt and every hash changes, so you never hit while still paying writes.
  1. Multilingual prompts sharing one cache line. Chinese, English and Japanese system prompts competing for the same breakpoints split the prefix into three cold caches. Either route by language group or accept three writes.

How to confirm you actually hit

Do not read the invoice, read the response fields:

u = resp.usage
print(u.cache_creation_input_tokens, u.cache_read_input_tokens)

A persistently zero cache_read_input_tokens means no hit at all: below the minimum length, unstable prefix, or routed to an upstream that holds no cache1. On OpenAI, check usage.prompt_tokens_details.cached_tokens2. Hit rate is the only cache metric worth watching; the rest is estimation.

Checklist

  • Stable content first (system prompt, tool definitions, knowledge summaries), dynamic content last.
  • Put the breakpoint on the last block that never changes across requests, never after a timestamp.
  • Reuse intervals under five minutes: default TTL. Offline batch jobs: the 1-hour tier pays better, at double the write cost1.
  • Every tool-definition edit is a full invalidation — align release cadence with cache strategy.
  • Ignore "up to 95% off": that is the 0.05x read tier on a few models, and writes still cost 1.25x–2.5x2.

Bottom line

The savings come from a prefix that is long enough, stable enough and reused often enough — not from "having caching on". Miss any one of the three and writes plus recomputation will eat the gain.

Sources & attribution

This article references the public materials listed below. Analysis and wording are SalpX's own; quoted material remains the property of its original authors and publishers.

  1. Prompt caching — Claude API documentation — Anthropic · accessed 2026-11-13Note:The 1.25x (5-minute) / 2x (1-hour) write multipliers, 0.1x reads, 512–4096-token minimums, the four-breakpoint limit and tools→system→messages invalidation order all come from this document.
  2. Prompt caching — OpenAI API guide — OpenAI · accessed 2026-11-13Note:Automatic caching, the 1,024-visible-token minimum from GPT-5.6 onward, 0.1x reads, 1.25x (30-minute) / 2.5x (12-hour) writes and the no-cross-organization rule are from this guide.

One key for Claude, GPT and 50+ models

The SalpX gateway is OpenAI-SDK compatible. Point base_url at https://www.salpx.com/v1 and you are done.