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

ParameterTypeRequiredDescription
modelstringYesaion-v3 or aion-v3-tools
messagesarrayYesArray of message objects with role and content
temperaturefloatNoSampling temperature (0.0–1.0, default: 0.7)
max_tokensintNoMaximum tokens to generate (default: 4096)
session_idstringNoPersist 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 IDDescriptionTier Required
aion-v3Standard inference (72B parameters)Free+
aion-v3-toolsAgentic mode with tool executionPro+

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

CodeMeaningResolution
401Invalid or missing API keyCheck your Authorization header
429Rate limit exceededWait or upgrade your tier
503Engine not readyGPU 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);