LLM Models
OpenAI-compatible chat completions and responses. Use Saudi-hosted and global models through one interface.
- Path
- /v1/chat/completions
- Key scope
- models
OpenAI Compatible Use the official OpenAI SDK with our base URL. Drop-in replacement for existing applications.
POSTChat Completions
Create Chat Completion
Creates a model response for the given chat conversation
Endpoint:
https://alapi.deep.sa/v1/chat/completions
Request Body:
{
"model": "llama-3.3-70b-versatile",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"max_tokens": 1024,
"stream": false
}
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | ID of the model to use |
messages |
array | Yes | Array of message objects with role and content |
temperature |
number | No | Sampling temperature (0-2). Default: 1 |
max_tokens |
integer | No | Maximum tokens to generate |
stream |
boolean | No | If true, returns a stream of events |
top_p |
number | No | Nucleus sampling parameter. Default: 1 |
Response (200 OK):
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1706745000,
"model": "llama-3.3-70b-versatile",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}
Code Examples:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://alapi.deep.sa/v1"
)
response = client.chat.completions.create(
model="llama-3.3-70b-versatile",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of Saudi Arabia?"}
],
temperature=0.7,
max_tokens=1024
)
print(response.choices[0].message.content)
POSTStreaming Responses
Server-Sent Events (SSE)
Stream responses token by token for real-time output
How it works: Set stream: true in your request. The response will be sent as Server-Sent Events, with each chunk containing a delta of the response content.
Code Examples:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://alapi.deep.sa/v1"
)
stream = client.chat.completions.create(
model="llama-3.3-70b-versatile",
messages=[
{"role": "user", "content": "Write a short poem about coding"}
],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
GETAvailable Models
List Models
Returns the list of currently available models
Endpoint:
https://alapi.deep.sa/v1/models
Required Scope:
This endpoint requires an API key with the
models or alembedding
Response (200 OK):
{
"object": "list",
"data": [
{
"id": "qwen/qwen3.8-27b",
"object": "model",
"created": 1767225600,
"owned_by": "qwen",
"type": "llm",
"pricing": { "currency": "SAR", "input_per_1m": 1.41, "output_per_1m": 14.37 },
"hosted_in": "saudi",
"context_length": 131072,
"max_completion_tokens": 16384,
"supports_tools": true,
"supports_vision": true,
"supports_reasoning": true
},
{
"id": "google/gemini-3.8-flash",
"object": "model",
"created": 1791277200,
"owned_by": "google",
"type": "llm",
"pricing": { "currency": "SAR", "input_per_1m": 3.52, "output_per_1m": 17.58 },
"hosted_in": "global",
"context_length": 1048576,
"max_completion_tokens": 65536,
"supports_tools": true,
"supports_vision": true,
"supports_reasoning": true
}
],
"deprecated": [
{
"id": "qwen/qwen3.6-27b",
"replacement": "qwen/qwen3.8-27b",
"sunset": "2026-12-05T00:00:00+03:00",
"message": "qwen/qwen3.6-27b is retired. Requests are served by qwen/qwen3.8-27b until 2026-12-05; update your model name."
}
]
}
Model fields:
| Field | Description |
|---|---|
pricing | The pay-as-you-go price in SAR per 1M tokens, for input and output. An embedding model has no output price. A plan pays a share of this price: see the pricing page. null when the model is not sold by tokens. |
hosted_in | saudi for models hosted in Saudi Arabia, global for the rest. |
context_length | The most tokens the model handles in one call, or null when unknown. |
max_completion_tokens | The most tokens one reply may hold, reasoning included, or null when unknown. Ask for no more than this in max_completion_tokens. |
supports_tools | true when the model accepts tools (function calling). |
supports_vision | true when the model accepts images in messages. |
supports_reasoning | true when the model reasons before it answers; reasoning tokens count as output. |
deprecated | A top-level list of retired model names that still work, each with its replacement, sunset date and message. |
GET/v1/models/{name}
Returns one model in the same shape. A retired name that still works returns its replacement with a deprecated object; an unknown name returns 404 model_not_found.
{
"id": "qwen/qwen3.8-27b",
"object": "model",
"created": 1767225600,
"owned_by": "qwen",
"type": "llm",
"pricing": { "currency": "SAR", "input_per_1m": 1.41, "output_per_1m": 14.37 },
"hosted_in": "saudi",
"context_length": 131072,
"max_completion_tokens": 16384,
"supports_tools": true,
"supports_vision": true,
"supports_reasoning": true,
"deprecated": {
"replacement": "qwen/qwen3.8-27b",
"sunset": "2026-12-05T00:00:00+03:00",
"message": "qwen/qwen3.6-27b is retired. Requests are served by qwen/qwen3.8-27b until 2026-12-05; update your model name."
}
}
Code Examples:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://alapi.deep.sa/v1"
)
models = client.models.list()
for model in models.data:
print(f"{model.id} ({model.type})")
The following models are currently available through alAPI. Use the model name in your API requests.
| Model Name | Type | Avg Latency |
|---|---|---|
anthropic/claude-sonnet-5.5
9.38 / 46.88 SAR per 1M tokens
|
llm | ~2841ms |
deep-sa/alEmbedding
0.19 SAR per 1M input tokens
|
embedding | ~1901ms |
deep-sa/alEmbedding-2.0
0.19 SAR per 1M input tokens
|
embedding | ~116ms |
google/gemini-3.1-pro
9.38 / 56.25 SAR per 1M tokens
|
llm | ~5977ms |
google/gemini-3.8-flash
3.52 / 17.58 SAR per 1M tokens
|
llm | ~5353ms |
gpt-oss-120b
0.84 / 3.37 SAR per 1M tokens
|
llm | ~1042ms |
gpt-oss-20b
0.42 / 1.69 SAR per 1M tokens
|
llm | ~1301ms |
llama-3.3-70b
0.56 / 1.80 SAR per 1M tokens
|
llm | ~615ms |
minimaxai/minimax-m2.7
1.18 / 4.72 SAR per 1M tokens
|
llm | ~1764ms |
openai/gpt-6-luna
0.47 / 2.34 SAR per 1M tokens
|
llm | ~2920ms |
qwen/qwen3.8-27b
1.41 / 14.37 SAR per 1M tokens
|
llm | ~3272ms |
z-ai/glm-5.3-flash
0.70 / 2.34 SAR per 1M tokens
|
llm | ~1137ms |
Ready to Get Started?
Generate an API key from your dashboard and start building