API documentation
Everything you need to integrate Unified AI into your application.
Introduction
Unified AI exposes an OpenAI-compatible HTTP API in front of models from OpenAI, Anthropic and Google. You use one API key for all of them and pay from a single EUR balance.
Model IDs follow the 'provider/model' format, for example openai/gpt-6-luna or anthropic/claude-sonnet-5-5.
Authentication
Authenticate every request with your API key in the Authorization header. You'll find the key on your dashboard.
Keep the key secret. If it leaks, regenerate it on the dashboard; the old key stops working immediately.
Authorization: Bearer YOUR_KEYBase URL
All endpoints below are relative to this base URL:
https://unified-ai.dev-store.info/api/v1Quick start
With curl, Python or Node.js. The official OpenAI SDKs work as-is once you set the base URL.
curl https://unified-ai.dev-store.info/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-luna",
"messages": [{"role": "user", "content": "Hello! What can you do?"}]
}'Chat completions
POST /chat/completions — Creates a model response for the given conversation. Supported parameters:
| Parameter | Type | Description |
|---|---|---|
| model | string | Required. A model ID from GET /models, e.g. openai/gpt-6-luna. |
| messages | array | Required. Messages with role system, user or assistant and text content. At least one user message. |
| stream | boolean | Stream the response as server-sent events. Default false. |
| max_tokens | integer | Maximum output tokens (also max_completion_tokens). Capped at the model's limit; lowers the reservation. |
| temperature | number | Sampling temperature from 0 to 2. |
| top_p | number | Nucleus sampling from 0 to 1. |
| stop | string | string[] | Up to 4 sequences where generation stops. |
| n | integer | Only 1 is supported. |
The response has the OpenAI chat.completion shape, including usage.prompt_tokens and usage.completion_tokens.
Streaming
Set "stream": true to receive server-sent events. Each event is a line starting with 'data: ' followed by a chat.completion.chunk JSON object.
The last chunk before 'data: [DONE]' has empty choices and the final usage for the request.
curl https://unified-ai.dev-store.info/api/v1/chat/completions -N \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-luna",
"messages": [{"role": "user", "content": "Hello! What can you do?"}],
"stream": true
}'data: {"id":"chatcmpl-…","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-…","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-…","object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":14,"completion_tokens":42,"total_tokens":56}}
data: [DONE]Models
GET /models — Lists every model you can call, in the OpenAI list format with pricing in EUR. Currently available:
curl https://unified-ai.dev-store.info/api/v1/models \
-H "Authorization: Bearer YOUR_KEY"Errors
Errors use the OpenAI error format: { "error": { "message", "type", "code" } }.
{
"error": {
"message": "Insufficient balance: this request requires up to €0.164000, available €0.050000.",
"type": "invalid_request_error",
"code": "insufficient_balance"
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request_error | The body is not valid JSON or a parameter is invalid or unsupported. |
| 401 | invalid_api_key | The Authorization header is missing or the key is invalid. |
| 402 | insufficient_balance | Your balance can't cover the reservation for this request. Top up and retry. |
| 404 | model_not_found | The model ID doesn't exist or is disabled. |
| 429 | rate_limited | The upstream provider is rate limiting. Retry with backoff. |
| 502 | upstream_error | The upstream provider failed. Retry; you're only charged for delivered tokens. |
Billing & reservation
Before calling the model we reserve the maximum cost: estimated input tokens plus max_tokens (or the model's maximum output) at the model's prices.
When the request completes you're charged the actual cost reported by the provider and the rest of the reservation is released.
If a stream is interrupted, you pay only for the tokens delivered so far. A request is rejected with 402 when the reservation exceeds your balance, so your balance never goes negative.
Limits
- Only text content is supported. Images, audio, tools and function calling are not available yet.
- n must be 1. Unknown parameters are ignored.