Skip to content
Unified AI

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.

http
Authorization: Bearer YOUR_KEY

Base URL

All endpoints below are relative to this base URL:

text
https://unified-ai.dev-store.info/api/v1

Quick 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:

ParameterTypeDescription
modelstringRequired. A model ID from GET /models, e.g. openai/gpt-6-luna.
messagesarrayRequired. Messages with role system, user or assistant and text content. At least one user message.
streambooleanStream the response as server-sent events. Default false.
max_tokensintegerMaximum output tokens (also max_completion_tokens). Capped at the model's limit; lowers the reservation.
temperaturenumberSampling temperature from 0 to 2.
top_pnumberNucleus sampling from 0 to 1.
stopstring | string[]Up to 4 sequences where generation stops.
nintegerOnly 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
  }'
text/event-stream
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:

bash
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" } }.

json
{
  "error": {
    "message": "Insufficient balance: this request requires up to €0.164000, available €0.050000.",
    "type": "invalid_request_error",
    "code": "insufficient_balance"
  }
}
StatusCodeMeaning
400invalid_request_errorThe body is not valid JSON or a parameter is invalid or unsupported.
401invalid_api_keyThe Authorization header is missing or the key is invalid.
402insufficient_balanceYour balance can't cover the reservation for this request. Top up and retry.
404model_not_foundThe model ID doesn't exist or is disabled.
429rate_limitedThe upstream provider is rate limiting. Retry with backoff.
502upstream_errorThe 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.