Cost Optimization

The Silent Cost Multiplier in Every Chat Feature: Your Conversation History

July 10, 20268 min readLLMtrack Blog
Quick answer: A 20-turn conversation uses 5,000-10,000 tokens when 500-1,000 would suffice. 100 wasted tokens in turn 1 compounds to 3,000 by turn 30. At Opus pricing, this is roughly $450/month waste across 1,000 sessions/day.

The Math No One Shows You

Most cost estimates are built from a single request: one prompt, one response, one token count. But chat features don't send one request — they re-send the entire conversation history with every single turn. A small amount of waste in turn one doesn't stay small. It gets re-sent on turn two, turn three, and every turn after that, compounding until 100 wasted tokens in turn 1 becomes roughly 3,000 wasted tokens by turn 30.

5-10ktokens for a 20-turn chat
500-1ktokens that would suffice
$450/moest. waste at 1,000 sessions/day

Context Accumulation Visualizer

Click "Send message" to simulate a conversation growing turn by turn and watch tokens, cost, and efficiency move in real time.

User message Assistant reply Re-sent history
0turn
0tokens this turn
$0.00running cost
100%efficiency
Efficiency typically falls off a cliff around turn 5–7 as history overhead starts to dominate.

The Quality Cliff

This isn't only a cost problem. The RULER benchmark found that GPT-4o accuracy drops into the high-60% range once context length reaches roughly 32K tokens — long context windows don't just cost more, they measurably degrade answer quality. Sending unnecessary history is both more expensive and worse for the user.

Warning: A longer context window does not mean a smarter model. Past a certain length, accuracy drops even as cost keeps climbing.

Trim vs Full Calculator

Compare the cost of sending full conversation history every turn against trimming to only the last 6 turns.

$0Full history / month
$0Last 6 turns only / month
Savings: 0%

Three Strategies Ranked

  1. RAG / retrieval-based context (best, ~80-90% savings) — only pull in the specific prior content relevant to the current turn instead of the full transcript.
  2. Summarize older turns (~60-80% savings) — replace older history with a compact running summary, keeping recent turns verbatim.
  3. Trim to last N turns (~40-60% savings) — simplest to implement, drop everything beyond a fixed recent window.

All three beat sending full, unbounded history by a wide margin, and all three can be implemented incrementally without rearchitecting a chat feature.

Tip: Track total tokens per turn over the life of a conversation, not just per request. A conversation-level view is the only way to see compounding waste, since any single request looks fine in isolation.
// Track per-turn token growth across a conversation
fetch('https://llm-track.com/api/ingest', {
  method: 'POST',
  headers: { 'x-api-key': process.env.LLMTRACK_KEY },
  body: JSON.stringify({
    provider: 'anthropic',
    model: response.model,
    feature_name: 'chat-completion',
    conversation_id: sessionId,
    turn_number: turnCount,
    total_tokens: response.usage.input_tokens + response.usage.output_tokens,
    status: 'success'
  })
}).catch(() => {})
See where your conversations bloat.

Track tokens per turn and find the inflection point for your own chat feature.

Start tracking free →

FAQ

Because each turn re-sends the full prior history, not just the new message. Token usage compounds across the conversation rather than staying flat per turn.

Trimming to a recent window can lose long-range context, but the RULER benchmark shows that very long, untrimmed context already degrades accuracy on its own — so trimming combined with summarization or RAG often improves quality while cutting cost.

Start with trimming to the last 6–10 turns since it requires no infrastructure changes, then move to summarization or RAG for features where conversations regularly run long.

Stop paying for history you don't need

Measure tokens per turn across full conversations, then trim, summarize, or retrieve only what each turn actually needs.

Start free →