What is a token?
A token is a piece of text the model reads or writes: a short word, part of a word or a sign.
In French or English, a million tokens is about 750,000 words. Arabic and mixed text use a bit more. An image counts as a few hundred to a few thousand tokens depending on its size.
How to compute the cost of a chatbot?
Start from a typical conversation: the question, instructions and context sent, then the answer.
- Example: 1,500 tokens sent (instructions, short catalog, question) and 300 answer tokens
- On Qwen3 30B (1.200 TND input, 3.400 TND output per million): about 0.003 TND per answer
- 1,000 answers a month: about 3 TND
Premium models cost 2 to 20 times more: keep them for tasks where quality really makes the difference.
A question about your case? We answer on WhatsApp, with no commitment.
Request a quoteHow to pay less?
Three settings make most of the savings.
- Cache: put the fixed part (instructions, catalog) at the start of each request, tokens read again are half price
- The right model: a small or medium model is enough to classify, summarize or answer an FAQ
- max_tokens: limit answer length, it is also what holds credit
How to avoid a surprise bill?
With prepaid credit you cannot spend more than you bought.
At XAB AI each key can have its own monthly budget, and the /v1/balance route gives your app the balance, so it can warn before reaching zero.