01Services02AI03Sectors04Servers05AI API06Contact
Discuss your project

Or on WhatsApp: +216 54 166 821

Guide

AI prices in dinars: understanding tokens

An AI API is paid per token, not by subscription. With three simple numbers you can estimate the cost of a chatbot or an agent before building it.

By , senior full-stack developer, XAB Solutions · Updated November 3, 2026

In short

A token is about three quarters of a word. The price of a request is the tokens sent times the input price of the model, plus the answer tokens times the output price. At XAB AI, prices go from 0.500 TND to 16 TND including VAT per million input tokens depending on the model, and tokens read back from the cache are billed at half price.

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 quote

How 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.

Frequently asked questions

Your other questions.

How much is a million tokens in dinars?

At XAB AI, from 0.500 TND (Qwen3.7 Flash, GPT-OSS 20B) to 16 TND (Claude Sonnet, Gemini Pro) on input, VAT included. Output costs more than input on most models.

Are reasoning tokens billed?

Yes, reasoning models count their thinking as output tokens. Allow enough max_tokens and pick the reasoning effort for the task.

What is prompt caching?

When several requests start with the same text, the model keeps it for a few minutes. Tokens read from that cache are billed at half price at XAB AI.

How much does an AI agent cost per month?

It depends on the number of conversations and the model. For a small business, a few dinars to a few tens of dinars a month on a medium model, plus building the agent.

A project, an idea, a problem with your website?

Describe it in a few lines. You receive a clear quote within 24 hours.