Chat Conversation Cost Calculator
A 50-turn chat on Claude Sonnet 5.5 with a 2,000-token system prompt, 200-token messages and 500-token replies resends the history each turn for 967,500 input tokens in total, costing $2.19 without caching and $0.43 with it; the last turn sends 36,500 tokens and a 1M context window would run out at turn 1,426 (prices checked 2026-10-16).
How to use
- Pick a model. The context window fills in from official model pages where known, and you can change it.
- Enter the system prompt tokens, the tokens of each user message and of each reply, and the number of turns.
- Read the total cost, the cost with prompt caching, the input of the last turn and the turn where input plus reply exceeds the context window. The chart shows how the two totals grow.
How it works
Input of turn k = system + k × user + (k − 1) × reply, because every earlier message is sent again. Output of each turn = reply tokens.
Cumulative input over T turns = T × system + user × T(T + 1) ÷ 2 + reply × T(T − 1) ÷ 2, so cost grows roughly with the square of the number of turns.
With caching, turn k reads the whole previous turn input from the cache and writes only the new part (last reply + new message). Turn 1 writes everything. Writes use the cache write price, reads the cache read price.
Context limit turn = the first k with system + k × (user + reply) > context window. Prices are US dollars per million tokens.
FAQ
Why does a long chat get expensive?
The model has no memory between calls, so the app sends the full history every turn. Turn 50 pays for all 49 earlier exchanges again, and the total grows much faster than the number of turns.
How much does caching help?
With caching the repeated history is billed at the cache read price, a small fraction of normal input. The page assumes the cache stays warm between turns. Pauses longer than the cache lifetime mean the history is written again.
What happens at the context limit?
The request fails or the app must drop or summarise old messages. The page marks the turn where input plus the reply no longer fits, and the chart draws a line there.
Does this include reasoning or tool tokens?
No. Add hidden reasoning or tool output to the reply tokens if your app sends them back in the history. Minimum cacheable lengths and long-prompt price tiers are not modelled.