In a multi-turn conversation you pay the entire history as input on every turn, so cumulative cost grows with the square of the number of turns — not linearly. Output is never cached. Prompt caching serves the stable prefix at roughly 0.1× the input rate, cutting total input cost 70–90%.
§1 · Why a conversation is not "input + output, once"
An LLM API is stateless — it remembers nothing between calls. To continue a conversation, your client has to resend the entire history as input on every single turn: the system prompt and tool definitions (fixed, but resent each time), plus the full transcript of every previous user message and model response, plus the new message.
So the naive mental model — "price one prompt, that's the cost" — is wrong for anything conversational. A chatbot, a copilot, or an autonomous agent bills the same early tokens again and again. The single-prompt figure can be several times too low.
§2 · The math, made simple
Let the fixed per-turn pieces be: S = system prompt, T = tool definitions, U = a user message, A = an assistant reply. On turn t, the input you send is everything stable plus every prior exchange plus the new user message:
That per-turn input grows linearly with the turn number — each new turn adds one more (U+A) block that must be resent forever after. Now add it up across N turns. Summing a linearly growing quantity is the classic 1 + 2 + 3 + … + N pattern, which equals N(N+1)/2:
The history term carries an N². Double the turns and the history you resend roughly quadruples. Meanwhile output is different: you generate exactly one new reply per turn, so total output cost grows only linearly with N — and output is never cached by any provider. It is the resent input that quietly explodes; output just rides along.
Want this for your own numbers? Set turns and token sizes, watch the cost curve, and read the caching savings live.
Open the conversation cost simulator →§3 · A worked example — 10 turns on Claude Opus 4.8
Concrete beats abstract. Take a realistic assistant with a decent system prompt and a tool block, on Claude Opus 4.8 (July 2026 list price: $5 / 1M input, $25 / 1M output). Per-turn sizes:
- System (
S) = 2,000 tokens · Tools (T) = 1,000 tokens - User (
U) = 200 tokens · Assistant (A) = 500 tokens
Turn 1 sends 2000 + 1000 + 200 = 3,200 input tokens. Turn 10 sends 2000 + 1000 + 9×700 + 200 = 9,500 — the same conversation, now three times heavier on input, entirely because of resent history.
| Turn | Input tok | Turn cost · no cache | Cumulative · no cache | Turn cost · cached | Cumulative · cached |
|---|---|---|---|---|---|
| 1 | 3,200 | $0.0285 | $0.0285 | $0.0325 | $0.0325 |
| 2 | 3,900 | $0.0320 | $0.0605 | $0.0185 | $0.0510 |
| 3 | 4,600 | $0.0355 | $0.0960 | $0.0188 | $0.0698 |
| 4 | 5,300 | $0.0390 | $0.1350 | $0.0192 | $0.0890 |
| 5 | 6,000 | $0.0425 | $0.1775 | $0.0195 | $0.1085 |
| 6 | 6,700 | $0.0460 | $0.2235 | $0.0199 | $0.1284 |
| 7 | 7,400 | $0.0495 | $0.2730 | $0.0202 | $0.1486 |
| 8 | 8,100 | $0.0530 | $0.3260 | $0.0206 | $0.1692 |
| 9 | 8,800 | $0.0565 | $0.3825 | $0.0209 | $0.1901 |
| 10 | 9,500 | $0.0600 | $0.4425 | $0.0213 | $0.2114 |
| Total | 63,500 | $0.4425 | $0.2114 |
Turn 10 costs 2.1× turn 1 — same task, all history resent. The "cached" columns assume every turn hits the cache within its TTL (see §4). Numbers computed with the exact model behind the conversation cost simulator.
The same result, laid out plainly
Without caching
Input tokens resent, turn 1 = 2,000 + 1,000 + 200 = 3,200
Input tokens resent, turn 10 = 2,000 + 1,000 + 9x700 + 200 = 9,500
Total input over 10 turns = 63,500 tok -> $0.3175 (@ $5 / 1M in)
Total output over 10 turns = 5,000 tok -> $0.1250 (@ $25 / 1M out)
Total conversation cost = $0.4425
With prompt caching (read 0.1x input, write 1.25x input)
Cache reads over 10 turns = 54,000 tok -> $0.0270
Cache writes over 10 turns = 9,500 tok -> $0.0594
Total input with caching = $0.0864 (vs $0.3175 -> input down 73%)
Total output (never cached) = $0.1250
Total conversation cost = $0.2114
Saved by caching = $0.2311 = 52% of total cost
(73% of input cost; output dilutes the total)
Two things to internalize from these numbers. First, the input side is where the money hides: input is 72% of the uncached bill even though each reply is longer than each question, purely because the prefix is resent ten times. Second, caching attacks exactly that side — it collapses $0.3175 of input to $0.0864, but can do nothing about the $0.1250 of output, which is why the total saving (52%) is smaller than the input saving (73%).
§4 · Prompt caching — the lever, and how it works
Prompt caching lets you mark the stable prefix — system prompt, tool definitions, and the already-seen transcript — so on repeat turns it is served from a cache at a fraction of the input price instead of full price. The mechanics that matter for cost:
- Reads are cheap. A cached prefix token costs about 0.1× the normal input rate on Anthropic and OpenAI's current models. That is the whole game — the huge resent prefix reprices to a tenth.
- Writes cost a small premium, once. New content entering the cache pays roughly 1.25× input. In a conversation, only the fresh
(U+A)from the previous turn is written each time — tiny next to the prefix being read. - Output is never cached — anywhere. Correct across all providers. Generation is always billed at the full output rate.
- Caching has a TTL. Anthropic's default is 5 minutes. Turns within that window hit the cache; an idle gap longer than the TTL forces a fresh (full-price) write on the next turn. Real interactive traffic usually stays warm; overnight agents may not.
Put it together and the payoff scales with the conversation: the longer it runs and the larger the fixed prefix relative to each new message, the more of your cost is repeated prefix — and the more caching claws back. On short exchanges with a tiny system prompt there is little to cache; on a 25-turn agent with a 4,000-token tool block it is the difference between a sane invoice and a shocking one.
§5 · Prompt caching rates by provider (verified July 2026)
Rates are expressed as a multiple of each model's normal input price. "Read" is a cached-prefix token; "write" is a token entering the cache.
| Provider · family | Cache read | Cache write | TTL / notes |
|---|---|---|---|
| Anthropic (Claude Fable 5 / Opus 4.8 / Sonnet 5 / Haiku 4.5) | 0.1× | 1.25× | 5-min default TTL (1-hr option at higher write cost) |
| OpenAI · GPT-5.6 (Sol / Terra / Luna) | 0.1× | 1.25× | Automatic cached-input discount |
| OpenAI · GPT-4.1 family | 0.25× | 1.00× | Cached input discounted; no separate write fee |
| Google · Gemini 3 context caching | 0.1× | 0.25× | Plus a per-hour storage fee (not modeled here) |
Snapshot verified 2026-07-13 against provider pricing/caching docs. Caching rates and the exact placement rules change more often than base prices — confirm against your provider the week you ship, then plug current numbers into the simulator.
§6 · Four things that make it worse (or better)
- Big tool blocks are resent every turn too. Agents often carry 2,000–4,000 tokens of tool schemas in
T. That block rides in the prefix on every single turn — a prime caching target, and a brutal cost if left uncached. - Reasoning/thinking tokens bill as output. On reasoning models, the model's internal thinking is billed at the output rate and cannot be cached. A "cheap input" model with heavy hidden reasoning may not be cheap at all.
- Context editing and compaction cut the history term. Trimming or summarizing old turns shrinks the
(t−1)·(U+A)that dominates late-conversation cost — the structural fix when caching alone is not enough. - Model routing still applies. The blended per-token gap between a budget and a frontier model is large; classify or draft with a cheap model and reserve the frontier tier for turns that need it.
§7 · FAQ
How much does a multi-turn conversation cost vs a single call?
Much more than the naive single-call estimate. Because the API is stateless, every turn resends the entire history as input, so the same system prompt and early messages are billed repeatedly. Input cost per turn climbs linearly with the turn number, making cumulative input cost grow with the square of the turn count. A 10-turn chat can cost 3–5× what pricing one turn suggests; long-running agents with large tool blocks are worse.
Why does the cost grow quadratically instead of linearly?
The input on turn t is system + tools + (t−1) previous turns + new user message, which grows linearly with t. Summing a linearly growing per-turn input across N turns follows the 1 + 2 + … + N pattern, whose total is proportional to N². Output cost per turn stays roughly flat because you generate only one new reply per turn — so it is the resent input, not the output, that explodes.
Does prompt caching actually reduce conversation cost?
Yes, and conversations are where it pays off most. The stable prefix — system prompt, tool block, already-seen history — is served from cache at roughly one tenth of the input price on Anthropic and OpenAI's newer models, instead of full price every turn. You pay a one-time ~1.25× write premium for new content, but the repeated reads dominate. On a typical long conversation, caching cuts total input cost by 70–90%.
How much did caching save in the worked example?
It cut input cost from $0.3175 to $0.0864 — a 73% reduction on the input side. Because output tokens are never cached, total conversation cost fell less: from $0.4425 to $0.2114, a 52% saving overall. The longer the conversation and the larger the fixed prefix relative to each new message, the higher the percentage saved.
What are the current caching rates per provider?
As of July 2026: Anthropic ≈ 0.1× input for a read, ≈ 1.25× for a write, 5-minute default TTL. OpenAI GPT-5.6 ≈ 0.1× read / 1.25× write; the older GPT-4.1 family ≈ 0.25× cached input with no separate write fee. Google Gemini context caching ≈ 0.1× read / 0.25× write plus a per-hour storage fee. Every provider discounts only the repeated input prefix, never generated output.
Is output ever cached?
No. Every provider caches only the repeated input prefix. Generated tokens are always billed at the full output rate — typically 4–6× the input rate. That is exactly why caching slashes input cost but reduces total cost less: the uncacheable output side dilutes the percentage saved.