API reference
One chat endpoint. Clear fields.
Qabas uses the familiar OpenAI chat-completions format. This page shows what you can send and what comes back.
Address and headers
POST
/chat/completionsSend requests to https://api.qabas.ae/v1/chat/completions.
| Header | What to send | Why |
|---|---|---|
Authorization | Bearer YOUR_KEY | Confirms which Qabas key is making the request. |
Content-Type | application/json | Tells the API that the request body is JSON. |
Request body
{
"model": "qwen-2.5-7b",
"messages": [
{"role": "system", "content": "Answer clearly and briefly."},
{"role": "user", "content": "Write a welcome message in Arabic."}
],
"temperature": 0.7,
"max_tokens": 200,
"stream": false
}| Field | Required? | Plain-English meaning |
|---|---|---|
model | Yes | The model name. Use qwen-2.5-7b today. |
messages | Yes | The conversation so far, in order. |
temperature | No | Lower is more predictable. Higher allows more variety. |
top_p | No | Another way to control answer variety. Usually change this or temperature, not both. |
max_tokens | No | The maximum number of tokens the answer may use. |
stop | No | One or more text sequences that end generation. |
seed | No | Helps make repeated tests more consistent, but exact repeatability is not guaranteed. |
presence_penalty | No | Encourages the answer to introduce new topics. |
frequency_penalty | No | Discourages repeated words and phrases. |
stream | No | Use true to receive the answer a piece at a time. |
Response body
{
"choices": [
{
"message": {
"role": "assistant",
"content": "مرحباً بكم..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 17,
"total_tokens": 45
}
}choices[0].message.contentis the answer.finish_reasonsays why generation stopped.usageshows the input, output and total token counts.
List the models your key can use
Ask the API instead of hard-coding a catalogue in your app.
curl https://api.qabas.ae/v1/models \
-H "Authorization: Bearer $QABAS_API_KEY"