Conversation Cost Calculator

Multi-turn chat cost is non-obvious — history grows quadratically. Compare full history, sliding window, summarization, and caching strategies to find the cheapest approach for your chatbot.

Conversation Cost Simulator
Conversation Shape
Model & Scale
Strategy Parameters
Strategy comparison at T=20 turns
$0.0360
Full history
$0.0255
Window K=5
$0.0277
Summarize M=10
$0.0317
Cached prefix
Sliding window saves 29.2% vs full history. Summarize saves 23.1%.
Full history / conv
$0.0360
Window K=5 / conv
$0.0255
Monthly (full history)
$360.0000
Monthly (window K=5)
$255.0000
StrategyCost / convMonthly (10,000)vs fullQuality trade-off
Full history$0.0360$360.0000baselineNo trade-off — full context
Sliding window (K=5)$0.0255$255.000029.2%Loses early context after turn 5
Summarize (M=10)$0.0277$276.750023.1%Loses precise detail in summaries
Cached prefix$0.0317$317.250011.9%No trade-off — only system prompt cached

Prices verified 2026-08-20 · Caching Calculator · Agent Cost Calculator

How to Use

Set conversation structure

Enter system prompt size, average user message and assistant response sizes, and the number of turns in a typical conversation.

Choose your model

Select from 30+ live-priced models. Caching-enabled models unlock the prompt caching strategy estimate.

Tune strategy parameters

For sliding window: how many turns to keep. For summarization: how often to summarize (every M turns). Adjust to see quality vs cost tradeoffs.

Compare strategies

The bar chart shows all 4 strategies side-by-side at your conversation length. The table shows cost at 10, 25, 50, and 100 turns.

Full history vs sliding window — the math

FULL HISTORY (naive):
  Total_input = T·S + (U+A)·T·(T−1)/2   ← quadratic!

SLIDING WINDOW (last K turns, T > K):
  Total_input = T·S + (U+A)·[ K(K−1)/2 + (T−K)·K ]

At T=20, K=5, S=1000, U=100, A=300:
  Full history: 80,500 input tokens
  Sliding window: 25,500 input tokens  (68% less)

SUMMARIZE EVERY M TURNS:
  Resets history to ~150 token summary
  + extra API call per summarization event

CACHING on S:
  Turn 1: full S price
  Turns 2+: cache-read price for S (10% on Anthropic)

How to Cut This Cost

Up to 85%

Use a sliding window (K=5–10) instead of full history. Most conversations need only recent context.

Up to 70%

Summarize every 10 turns. Inject the summary as a compact history — pays a small summary cost but cuts input by 60–80%.

Up to 80%

Cache your system prompt. A 5,000-token system prompt sent over 20 turns is 95,000 tokens — caching drops that to ~14,500 tokens total.

Up to 90%

Use a cheap model for history turns and a capable model only for the final response — route within your conversation pipeline.

FAQ

Have more questions? Contact us

Last verified: 2026-08-20 · methodology · data sources