cd /news/large-language-models/the-user-typed-thanks-2-tokens-my-ch… · home › topics › large-language-models › article
[ARTICLE · art-174669] src=dev.to ↗ pub= topic=large-language-models verified=true sentiment=· neutral

The user typed "thanks!" — 2 tokens. My chatbot sent the model 588.

A developer measured token costs in a synthetic support chat and found that a two-token "thanks!" message triggers a 588-token input call, the largest of the conversation, because stateless chat APIs resend the full history each turn. On gpt-5.6's list price of $2 per million input and $12 per million output, the thank-you cost $0.00132, 9% more than the first question and 20-22% of the four real answers combined. The developer proposes a regex-based is_closer function that strips punctuation and emoji and matches a fixed set of closing phrases, answering such messages without calling the model.

recommendation

Intercept short closing messages like "thanks!" with a normalized phrase match and reply without calling the model, since each such turn resends the full history and can cost more than the first real question.

more in playbook: Controlling LLM cost
by read5 min views2 publishedNov 23, 2026

You build a support chatbot. A user asks four questions, gets four good answers, and writes "thanks!". Your bot sends that to the model like any other message, the model replies "You're welcome!", and the conversation ends politely.

That last exchange carried no information in either direction, and it was billed like a real question. In my test chat it cost more than the user's first one.

A token is a chunk of text the model reads; APIs bill per million of them. I counted with tiktoken and o200k_base, the tokenizer OpenAI's current models use. Input tokens are what you send, output tokens are what the model writes back. A system prompt is the block of instructions you put at the start of every conversation. A chat API is stateless: it remembers nothing between calls, so to continue a conversation you send the whole conversation again. A list price is the vendor's official price per million tokens, before any discount.

I wrote a synthetic support chat for a made-up shipping-label service: a 241-token system prompt, four questions about refunding an unused label, and four answers of two to five sentences, the length the prompt asks for. Then the user writes "thanks!" (2 tokens) and the bot answers "You're welcome! If anything else comes up, just ask." (12 tokens).

Every call sends the system prompt, every earlier message, and the new one. I counted only the message text, not the few formatting tokens the chat format adds per message, so the real numbers are slightly higher.

Call Input tokens Output tokens Cost on gpt-5.6
Question 1 264 57 $0.00121
Question 2 338 76 $0.00159
Question 3 426 93 $0.00197
Question 4 534 52 $0.00169
"thanks!" 588 12 $0.00132

To read two tokens of gratitude, the model read 588. That is the largest input of the whole conversation, because "thanks!" comes last and carries everything before it. The prices are gpt-5.6's list price, $2 per million input and $12 per million output, from the catalog snapshot of the LLM gateway I work on.

The thank-you costs 9% more than the first question. It's cheaper than the later questions only because its reply is short: output is six times more expensive per token, and the long answers to questions 2 and 3 are what make those calls expensive. In the thank-you call, input is 89% of the cost. On claude-haiku-5.5, claude-sonnet-5.5 and gemini-3.8-flash, where output is five times the input price, the thank-you is 18% more expensive than the first question.

The longer the chat, the worse the ratio. After eight exchanges instead of four, the same "thanks!" goes out with 933 tokens of input and costs $0.00201, more than any of the four questions in the table.

In my chat the thank-you is 20 to 22% of what the four real answers cost together, depending on the model. Suppose your bot handles 10,000 conversations a day and 30% of them end with a thank-you; that share is my assumption, so count your own. Then on gpt-5.6 the conversations cost $1,938 a month and the thank-yous add $118.80 on top (+6.1%). On gpt-5.6-mini it's $11.88, on claude-haiku-5.5 $5.83, on claude-sonnet-5.5 $116.64.

That's not a disaster, but it's money spent on nothing, and it is the easiest line on the bill to remove. A message like "thanks!" doesn't need a model. You can answer it yourself:

import re
import unicodedata

CLOSERS = {"thanks", "thank you", "thx", "ty", "thanks a lot", "ok thanks",
           "great thanks", "cheers", "thank you so much"}

def is_closer(text):
    t = unicodedata.normalize("NFKC", text).lower()
    t = re.sub(r"[^\w\s]", " ", t)  # drop punctuation and emoji
    return " ".join(t.split()) in CLOSERS

for msg in ["Thank you 🙏", "ok, thanks!!", "thanks, but it still doesn't work"]:
    print(msg, "->", is_closer(msg))

The function lowercases the message, removes punctuation and emoji, and checks whether what's left is exactly one of the known phrases. If it is, your code shows a fixed reply like "You're welcome!" and makes no API call. "Thank you 🙏" and "ok, thanks!!" match; "thanks, but it still doesn't work" doesn't, because it's not an exact match, so it goes to the model as it should. The exact match is deliberate: a looser rule like "contains thanks" would also catch "no thanks" and "thanks! one more question".

It removes one call per conversation, not the reason that call was expensive. Every real question still goes out with the whole history attached. If your chats are long, trimming old messages or summarizing them saves far more than skipping the thank-you.

A fixed reply is the same every time, and some users will notice. If your product's tone matters, keep a few variants and pick one at random, or accept the model call as the price of sounding human.

The phrase list is English and will miss things. Users write "thank u", "tysm", "спасибо", or "thanks, that fixed it". Every miss just falls through to the model, so the cost of a short list is a smaller saving, not a broken bot. Log the messages your bot answers itself and check them once in a while, to make sure no real question got a "You're welcome!".

Finally, the chat is synthetic and counted with one tokenizer. Claude and Gemini tokenize text differently, and if your provider caches repeated prompt prefixes, the history in each call can be billed at a lower rate. Your system prompt and answer length also change the numbers. To check your own bot, find a conversation that ended with a thank-you and look at the input token count of that last call.

── more in #large-language-models 4 stories · sorted by recency
── more on @openai 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/the-user-typed-thank…] indexed:0 read:5min 2026-11-23 · —