Authentication
All API requests require a valid API key sent via the Authorization header.
HTTP Header
Authorization: Bearer ak-your-api-key-here
Get your API key from the API Portal. Free tier includes 10,000 tokens.
Chat Completions
POST /v1/chat/completions
Create a chat completion. Fully compatible with the OpenAI Chat API format.
Request Body
| Parameter | Type | Required | Description |
model | string | Yes | aion-v3 or aion-v3-tools |
messages | array | Yes | Array of message objects with role and content |
temperature | float | No | Sampling temperature (0.0–1.0, default: 0.7) |
max_tokens | int | No | Maximum tokens to generate (default: 4096) |
session_id | string | No | Persist conversation context across requests |
Example Request
curl
curl -X POST https://api.dialogix.ch/v1/chat/completions \
-H "Authorization: Bearer ak-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "aion-v3",
"messages": [
{"role": "user", "content": "Explain quantum computing in 3 sentences."}
],
"temperature": 0.7
}'
Example Response
JSON
{
"id": "chatcmpl-7f3a2b1c0d4e",
"object": "chat.completion",
"created": 1711234567,
"model": "aion-v3",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses qubits..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 48,
"total_tokens": 60
}
}
Models
GET /v1/models
List all available models.
| Model ID | Description | Tier Required |
aion-v3 | Standard inference (72B parameters) | Free+ |
aion-v3-tools | Agentic mode with tool execution | Pro+ |
Usage
GET /v1/usage
Check your current token usage and remaining balance.
Response
{
"user": "your-name",
"tier": "free",
"tokens_used": 3240,
"tokens_limit": 10000,
"tokens_remaining": 6760,
"daily_stats": [...]
}
Error Codes
| Code | Meaning | Resolution |
401 | Invalid or missing API key | Check your Authorization header |
429 | Rate limit exceeded | Wait or upgrade your tier |
503 | Engine not ready | GPU is loading model, retry in 30s |
Code Examples
Python (OpenAI SDK)
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.dialogix.ch/v1",
api_key="ak-your-key"
)
response = client.chat.completions.create(
model="aion-v3",
messages=[
{"role": "user", "content": "Hello AION!"}
]
)
print(response.choices[0].message.content)
JavaScript (fetch)
JavaScript
const response = await fetch('https://api.dialogix.ch/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer ak-your-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'aion-v3',
messages: [{ role: 'user', content: 'Hello AION!' }]
})
});
const data = await response.json();
console.log(data.choices[0].message.content);