قQabasAPI Docs
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/completions

Send requests to https://api.qabas.ae/v1/chat/completions.

HeaderWhat to sendWhy
AuthorizationBearer YOUR_KEYConfirms which Qabas key is making the request.
Content-Typeapplication/jsonTells the API that the request body is JSON.

Request body

JSON
{
  "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
}
FieldRequired?Plain-English meaning
modelYesThe model name. Use qwen-2.5-7b today.
messagesYesThe conversation so far, in order.
temperatureNoLower is more predictable. Higher allows more variety.
top_pNoAnother way to control answer variety. Usually change this or temperature, not both.
max_tokensNoThe maximum number of tokens the answer may use.
stopNoOne or more text sequences that end generation.
seedNoHelps make repeated tests more consistent, but exact repeatability is not guaranteed.
presence_penaltyNoEncourages the answer to introduce new topics.
frequency_penaltyNoDiscourages repeated words and phrases.
streamNoUse true to receive the answer a piece at a time.

Response body

Shortened response
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "مرحباً بكم..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 28,
    "completion_tokens": 17,
    "total_tokens": 45
  }
}
  • choices[0].message.content is the answer.
  • finish_reason says why generation stopped.
  • usage shows 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
curl https://api.qabas.ae/v1/models \
  -H "Authorization: Bearer $QABAS_API_KEY"