nsfwllms.comGuide
AI Chatbot Cost: What Running One Really Costs
The ai chatbot cost for a text bot on this API is a fraction of a cent per message, and you can compute it exactly. This page shows the math per message, per user and per month, and what changes it.
Updated
Key points
- Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens.
- A message with 2,000 input and 300 output tokens costs $0.00045.
- At 600 messages a month, one user costs about $0.27.
- Long chat history is the main cost driver; summarize old turns.


The formula
Text APIs charge by tokens, which are small pieces of words. A rough rule is that one token is about three quarters of an English word, but your own counts come from the usage field returned with every reply. The cost of one request is:
cost = (input_tokens x 0.15 + output_tokens x 0.50) / 1,000,000
Input is everything you send: the system prompt, the chat history and the new message. Output is the reply. Output tokens cost over three times as much as input tokens, but chatbots send far more input than output because the history is resent on every turn. That is why history length, not reply length, usually decides the bill.
Cost per message
Take a typical chat turn: a 600-token system prompt, 1,200 tokens of recent history, a 200-token user message (2,000 input tokens in total), and a 300-token reply.
| Part | Math | Cost |
|---|---|---|
| Input | 2,000 x 0.15 / 1,000,000 | $0.00030 |
| Output | 300 x 0.50 / 1,000,000 | $0.00015 |
| Message | sum | $0.00045 |
So 1,000 messages cost $0.45. Failed or refused requests are not charged, so errors on your side do not add to this. You can find the latest numbers on the pricing page.
Cost per user per month
Now multiply by how much your users chat. Three profiles show the range:
| Profile | Messages per month | Size per message | Cost per user |
|---|---|---|---|
| Casual | 150 | 2,000 in, 300 out ($0.00045) | $0.0675 |
| Regular | 600 (about 20 a day) | 2,000 in, 300 out ($0.00045) | $0.27 |
| Heavy | 3,000 (about 100 a day) | 6,000 in, 400 out ($0.0011) | $3.30 |
The heavy row uses bigger messages because heavy users run long conversations with a lot of history. Check the arithmetic for it: 6,000 x 0.15 / 1,000,000 = $0.0009, 400 x 0.50 / 1,000,000 = $0.0002, together $0.0011, and 3,000 x $0.0011 = $3.30.
Cost for a whole user base
With a mix of 1,000 regular users at $0.27 each, the monthly API bill is $270. At 10,000 such users it is $2,700. If 5 percent of your users are heavy and 95 percent are casual, the average is 0.05 x $3.30 + 0.95 x $0.0675 = $0.165 + $0.0641 = about $0.229 per user, so 10,000 users cost roughly $2,290.
Your real costs also include things this API does not touch: your own server, storage, payment fees and your time. Count the API as one line in the budget, and add the others before you set a price for your own users. If you charge per message or per month, use the heavy-user figure to check that your worst customers still leave a margin. What matters is that it scales linearly. Double the messages and the API cost doubles. There is no minimum fee, subscription or seat price, and credit never expires.
Why long chats get expensive
Because the model has no memory, each turn resends the history. Suppose a conversation has a 500-token system prompt, and each turn adds 150 tokens from the user and 300 from the bot. Input at turn k is 650 + 450 x (k - 1) tokens. Over 20 turns:
- Total input: 20 x 650 + 450 x (0 + 1 + ... + 19) = 13,000 + 450 x 190 = 98,500 tokens
- Total output: 20 x 300 = 6,000 tokens
- Cost: 98,500 x 0.15 / 1,000,000 + 6,000 x 0.50 / 1,000,000 = $0.014775 + $0.003 = $0.0178
Input grows with the square of the turn count, so a 100-turn chat costs much more than five 20-turn chats. That is the main reason to manage history, which the next section covers. To see the gap, run the same arithmetic for a 100-turn chat: total input is 100 x 650 + 450 x 4,950 = 2,292,500 tokens, or about $0.34 for input alone, against roughly $0.09 for five separate 20-turn chats. Same number of messages, nearly four times the cost, purely from resending history. A rolling summary flattens that curve, because the input per turn stops growing once the summary and the last few turns reach a fixed size. The model's context window is 100,000 tokens, so the limit is rarely the problem. Cost is. See context window for LLMs for how windows work.
Ways to keep the bill down
- Summarize old turns. Replace everything older than the last eight turns with a 150-word summary. A chat that would otherwise send 20,000 input tokens per turn can stay near 3,000.
- Keep the system prompt tight. It is paid for on every call. Cutting 300 tokens from it saves 300 x 0.15 / 1,000,000 = $0.000045 per message, which is $45 across a million messages.
- Set a length rule. A "reply in 150 words or fewer" instruction cuts output tokens, the expensive side.
- Use
max_tokensas a safety cap. It is optional, but a cap guards against runaway replies. - Log usage. Store
usagefrom each response and sum by user, so you can spot the few accounts that cost most. TheX-Balance-USDheader shows your remaining credit after each call.
Throughput and limits
Cost is one question and capacity is another. A full key allows 8 concurrent requests and 300 requests per minute. A streamed reply holds its slot until it ends. If a reply takes 10 seconds, 8 slots finish about 48 requests per minute, so for a busy bot the concurrency limit is reached before the per-minute cap. Measure your own reply time and do the same division. Going over a limit returns HTTP 429 with the code concurrency or rate_limited, so queue requests and retry. The docs list the headers that report your limits.
Paying and starting small
You pay with prepaid credit, by crypto (USDT on TRC20 or USDC on Base), with any whole top-up from $20 to $500. Bonuses add +5% from $50, +10% from $100 and +15% from $200, so a $200 top-up becomes $230 of credit. New accounts can claim a $0.50 trial with one click, no payment needed, valid 7 days, which covers about 1,111 messages at the $0.00045 size. Create a key on the API key page, run your real bot for a day on trial credit, and measure your own average tokens per message before you plan a budget. Averages from a real day beat any estimate in this article, including the ones above.
More guides
Questions and answers
How much does it cost to run an AI chatbot per month?
It depends on messages and history size. At 600 messages a month and 2,000 input plus 300 output tokens each, one user costs about $0.27.
Is there a monthly fee?
No. You pay per token from prepaid credit, with no subscription, and credit does not expire.
Are failed requests billed?
No. Failed or refused requests are not charged.
How can I check what I have spent?
Read the X-Balance-USD response header or call GET /v1/balance, and log the usage field of each reply.