XAB AI is an OpenAI-compatible AI API, prepaid in Tunisian dinars. If your code works with OpenAI, it works with XAB AI: change the address, the key and the model name. Beta service: models, prices and limits may still change, we tell clients before any change.
Start in one minute
- Buy a pack (50 TND minimum, by bank transfer or bank deposit). We open your account in the client area.
- In Client area, IA, create a key. It starts with
xab-and is shown once. - Call the API:
curl https://cloud.xab.tn/v1/chat/completions \
-H "Authorization: Bearer $XAB_AI_KEY" -H "Content-Type: application/json" \
-d '{"model": "qwen/qwen3-30b-a3b-instruct-2507", "messages": [{"role": "user", "content": "Hello"}]}'
With the OpenAI library: OpenAI(base_url="https://cloud.xab.tn/v1", api_key=...). The Test Request button on each route lets you try with your key.
Keys and security
Send the key in Authorization: Bearer xab-..., always from your server, never in a mobile app or website code. Up to 10 keys per account. Each key can have a monthly budget, allowed models, allowed IPs and an expiry date. A revoked key stops working at once.
Credit and prices
Price of a request = input tokens × input price + output tokens × output price of the model (VAT included, per million tokens), rounded up to the millime. Before each request we hold the maximum cost (from max_tokens) and bill only the real cost. At zero, requests are refused (402): never a surprise bill. Credit is valid 12 months after the last purchase. Price of every model: GET /pricing or the XAB AI page.
Cache at half price
When requests start with the same text (instructions, catalog, document, history), tokens read back from the cache are billed at half price (tokens written to the cache, when the model asks for it, 25% more once). Automatic on GPT, DeepSeek and Gemini: put the fixed part first. On Claude and some Qwen models, add "cache_control": {"type": "ephemeral"} on the block to keep. Send the same session_id for every request of a conversation. Cached tokens are in usage.prompt_tokens_details.cached_tokens.
Agents and tools
Describe your functions in tools: the model answers with tool_calls, your code runs the function and sends the result back in a role: "tool" message. response_format with json_schema forces JSON in an exact format. reasoning: {"effort": "low" | "medium" | "high"} sets the thinking of reasoning models (counted as output: allow enough max_tokens). Images: image_url parts (https link or base64) on models that read images.
Fallback models
"models": [...] with up to 3 models from our catalog: if the first is down, the next one answers. You pay for the model that answered.
From Ollama
Replace the Ollama address with https://cloud.xab.tn/v1 and add the key. Common Ollama names are accepted: qwen2.5:7b, qwen3:30b, qwen3:32b, llama3.1:8b, llama3.3:70b, gemma3:27b, gpt-oss:20b, gpt-oss:120b, mistral-small.
Integrations
Any tool that accepts OpenAI with a custom address: n8n (OpenAI credentials, Base URL), Flowise (ChatOpenAI, Base Path), LangChain (ChatOpenAI(base_url=...)), LlamaIndex (OpenAILike(api_base=...)), Vercel AI SDK (createOpenAI({ baseURL })), Open WebUI (OpenAI API connection), Continue (provider: openai, apiBase). Import this OpenAPI file into Postman or Insomnia: openapi.json.
Limits
60 requests per minute per key, 4 in parallel per account, 16,384 answer tokens, 8 MB per request. Need more: write to us.
Privacy
We keep neither your requests nor the answers: only date, model, tokens, price and duration. Illegal content, spam and fraud are forbidden: a key used that way is suspended.
Support
WhatsApp +216 54 166 821, contact@xab.tn.
Routes
POST /v1/chat/completionsPOST /v1/responsesPOST /v1/embeddingsGET /v1/modelsGET /v1/balanceGET /v1/usageGET /v1/pricing