full conversation
last turn alone
vs flat cost
with window/cache

Cost accelerates with turn count

The per-turn input keeps climbing as history piles up, so the cumulative cost curve bends upward — doubling the turns more than doubles the bill.

At turnThis turn costsCumulative

You pay for the history on every turn

A language model is stateless: it remembers nothing between API calls, so to continue a conversation your application re-sends the entire transcript — system prompt, every past user message and every past reply — as the input of each new request. That means the input grows one exchange at a time, and the cost of the whole conversation grows with roughly the square of the number of turns, not linearly. The last turn of a long chat is the most expensive one because it carries the most history, and the fixed system prompt is billed once per turn on top. Three levers bring it back down: a sliding window that keeps only recent turns (cost becomes linear, at the cost of memory), prompt caching that bills the repeated prefix at a steep discount, and summarising old turns into a short recap. Compare a single window on the context window cost calculator, size the caching win on the prompt caching savings calculator, and cost a full assistant on the chatbot cost calculator.

Host your project:DigitalOcean — $200 free ↗Hostinger VPS
Provisioned Throughput (PTU) CalculatorAI Gateway Markup CalculatorSeat vs Usage Pricing CalculatorAI App Cost EstimatorAI Wrapper Pricing