cd /news/large-language-models/why-message-50-of-your-chatbot-costs… · home › topics › large-language-models › article
[ARTICLE · art-171310] src=dev.to ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Why message 50 of your chatbot costs 19x more than message 1

A developer's cost analysis shows that a chatbot's 50th message can send roughly 19 times more input tokens than its first, because the app re-sends the full conversation history with every turn. The worked example puts message 1 at 540 tokens and message 50 at 10,340 tokens, illustrating how per-token input billing compounds as a chat grows. The piece argues that a larger context window only delays the problem, since cost and latency scale with what is sent.

read2 min views4 publishedNov 17, 2026

You build a chatbot and quote the cost of one short message. The real bill arrives, and it is far higher. The reason is two ideas: tokens, and the context window. Here is the arithmetic.

All numbers below are made up for illustration.

A model does not read whole words. It reads tokens: a short word, part of a long word, a piece of a number, or a punctuation mark. A tokenizer cuts your text into these pieces before the model sees it.

Think of it as the model's desk, counted in tokens. Everything for one request must fit on it at once:

If the total is too big, the request fails with a length error. The model also keeps nothing between requests, so the app fills the desk again every time.

Because the app re-sends the history with each new message, a long chat gets heavier with every turn. Assume:

Message 1 sends:

500 + 40 = 540 tokens

Before message 50 there are 49 old turns:

49 x 200 = 9,800 tokens

Message 50 sends:

500 + 9,800 + 40 = 10,340 tokens

Compare them:

10,340 / 540 = about 19

The customer types about the same amount each time. The same short question sends about 19 times more input, and input is billed per token on every request.

The same pattern at other points in the chat: 2,340 tokens at message 10, and 5,340 at message 25.

A bigger window only delays the problem, because cost and waiting time grow with the size of what you send. Send less, but better:

This article is a short version of Chapter 7 of Deployed Lab. The interactive chapter has a tokenizer you can type into, a slider tool to spend a 32,000-token window across five parts, and a short quiz. It is free with no signup: Tokens and context windows. Deployed Lab is a course on AI engineering and the forward deployed engineer role.

── more in #large-language-models 4 stories · sorted by recency
── more on @deployed lab 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/why-message-50-of-yo…] indexed:0 read:2min 2026-11-17 · —