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)
Ready to Get Started?
Generate an API key from your dashboard and start building