Estimate your support chatbot's monthly token bill with 40 lines of Python
Every client who asks us for a customer service chatbot asks the same follow-up question: "What will it cost each month once it's live?" The honest answer depends on four numbers you can estimate before a single line of
Every client who asks us for a customer service chatbot asks the same follow-up question: "What will it cost each month once it's live?" The honest answer depends on four numbers you can estimate before a single line of the chatbot is written. This post turns them into a tiny Python calculator you can drop into a notebook or a pricing spreadsheet export.
It covers the AI model bill only. Hosting, a vector store, logging and the people who maintain the bot come on top, and we'll get to those at the end.
The four numbers that drive the bill
- Conversations per month. Pull this from your help desk or live chat history, not from a guess.
- Messages per conversation. Most support chats are 3 to 6 user turns. Each turn is a separate model call.
- Input tokens per call. This is the big one, because every call re-sends the system prompt, the retrieved help content and the conversation so far. A typical retrieval-augmented support bot sends 2,000 to 6,000 tokens per call.
- Output tokens per call. Support answers are short: 150 to 400 tokens.
A token is roughly three-quarters of an English word, so 4,000 tokens is around 3,000 words of context.
The calculator
# token_bill.py: rough monthly LLM cost for a support chatbot
from dataclasses import dataclass
@dataclass
class Model:
name: str
input_per_m: float # USD per 1M input tokens
cached_input_per_m: float # USD per 1M cached input tokens
output_per_m: float # USD per 1M output tokens
# Published list prices checked on 17 Nov 2026. Re-check before you budget.
MODELS = [
Model("GPT-6 Luna", 0.10, 0.01, 0.50),
Model("GPT-6.1 Sol", 2.00, 0.10, 10.00),
Model("Claude Haiku 5.5", 0.10, 0.01, 0.50),
Model("Claude Sonnet 5.5", 2.00, 0.10, 10.00),
]
def monthly_cost(m: Model, convos: int, turns: int, tokens_in: int,
tokens_out: int, cached_share: float = 0.0) -> float:
calls = convos * turns
tin = calls * tokens_in
cached = tin * cached_share
fresh = tin - cached
return (fresh * m.input_per_m + cached * m.cached_input_per_m
+ calls * tokens_out * m.output_per_m) / 1_000_000
if __name__ == "__main__":
scenario = dict(convos=5_000, turns=4, tokens_in=4_000, tokens_out=300)
for cache in (0.0, 0.5):
print(f"\ncached share of input: {cache:.0%}")
for m in MODELS:
cost = monthly_cost(m, **scenario, cached_share=cache)
print(f" {m.name:<18} ${cost:>8,.2f} / month")
Running it for 5,000 conversations a month, 4 turns each, 4,000 tokens in and 300 out:
cached share of input: 0%
GPT-6 Luna $ 11.00 / month
GPT-6.1 Sol $ 220.00 / month
Claude Haiku 5.5 $ 11.00 / month
Claude Sonnet 5.5 $ 220.00 / month
cached share of input: 50%
GPT-6 Luna $ 7.40 / month
GPT-6.1 Sol $ 144.00 / month
Claude Haiku 5.5 $ 7.40 / month
Claude Sonnet 5.5 $ 144.00 / month
Two things jump out. First, the model choice moves the bill by 20×. Second, input dominates: 80 million input tokens against 6 million output tokens. That's where optimisation pays.
A caveat on the cached rows: providers price cache writes and cache reads differently, and the cached share you actually get depends on how stable the start of your prompt is. Treat 50% as an optimistic what-if, not a promise. Anthropic also charges more for prompts above 100,000 tokens on Haiku 5.5, which a support bot shouldn't hit.
Where the input tokens come from (and how to cut them)
Log one real call and count the parts. In most bots we review, it splits roughly like this:
- System prompt and rules: 600–1,500 tokens. Stable across calls, so it's the ideal candidate for prompt caching. Keep it at the very start of the prompt.
- Retrieved passages: 1,500–4,000 tokens. Retrieving 8 long chunks "to be safe" is the most common waste. Try 3–4 shorter chunks and measure answer quality on your regression set before and after.
- Conversation history: grows every turn. Summarise or trim older turns after the third or fourth message.
Route by difficulty
Most support questions ("Where's my order?", "What's your returns window?") don't need a large model. A simple pattern:
def pick_model(question: str, retrieval_score: float) -> str:
if retrieval_score > 0.8 and len(question) < 300:
return "small" # e.g. Haiku-class or Luna-class model
return "large" # e.g. Sonnet-class or Sol-class model
If 85% of calls go to the small model, the 5,000-conversation example drops from $220 to about $42 a month on the AI bill. Validate it: run your saved test questions through both paths and compare answers before you ship the router.
What the calculator doesn't include
- Hosting: an API service plus a database or vector store.
- Monitoring: logging conversations, reviewing failed answers, alerts on spend.
- Maintenance: updating content when policies change, and re-testing when a provider retires a model.
- The build itself: content clean-up, retrieval, integrations, hand-over to humans and testing.
And compare against the alternative honestly. Per-resolution tools such as Intercom Fin list $0.99 per outcome, which at 3,000 resolved conversations is about $2,970 a month, but you don't build or maintain anything. At low volume that's often the better deal.
FAQ
Is the token bill the main cost of running a chatbot?
Usually not at small volumes. With an efficient model, people's time (content updates, reviews and fixes) costs more than tokens.
How do I measure tokens per call accurately?
Both OpenAI and Anthropic return token usage with every API response. Log it for a week of real or replayed traffic and use the median, not a guess.
Should I always use the cheapest model?
No. Use the cheapest model that passes your regression test set, and route hard questions to a larger one.
If you're scoping a support chatbot and want a second pair of eyes on the numbers, our AI chatbot development team builds them for businesses in the USA, UK, Canada and Australia.
Prices are from the OpenAI and Anthropic pricing pages and Intercom's pricing page, checked on 17 November 2026.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.