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

> Source: <https://dev.to/altrouter/the-user-typed-thanks-2-tokens-my-chatbot-sent-the-model-588-1725>
> Published: 2026-11-23 12:00:02+00:00

**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 the playbook "Controlling LLM cost": <https://wpnews.pro/playbooks/llm-cost>

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:

``` python
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.
