siati.ai docs

API reference

Chat completions

POST /v1/chat/completions — OpenAI-compatible, with extras for tier routing and priority.

Last updated: 2026-05-19

Chat completions

POST https://api.siati.ai/v1/chat/completions

Drop-in compatible with the OpenAI chat completions endpoint. Same request schema, same response schema, plus our additions for sovereignty (tier, priority).

Request

bash
curl https://api.siati.ai/v1/chat/completions \
  -H "Authorization: Bearer $SIATI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Siati-Tier: medium" \
  -d '{
    "model": "apertus-70b-instruct",
    "messages": [
      {"role": "system", "content": "You are a helpful Swiss assistant."},
      {"role": "user",   "content": "Spiegami il principio di sovranità in 3 frasi."}
    ],
    "temperature": 0.7,
    "max_tokens": 400,
    "top_p": 0.9,
    "stream": false
  }'

Parameters

Param Type Required Description
model string Model ID. See Models catalog.
messages array List of {role, content} objects. Roles: system, user, assistant, tool.
temperature float 0–2, default 1.0. Lower = more deterministic.
top_p float Nucleus sampling, 0–1.
max_tokens int Cap on completion length.
stream bool If true, returns SSE stream. See Streaming.
stop array Stop sequences.
presence_penalty / frequency_penalty float OpenAI-compatible.
response_format object { "type": "json_object" } for structured output.
tools / tool_choice array / string Function calling, OpenAI shape.

Headers (siati-specific)

Header Description
X-Siati-Tier: slow|medium|fast|ludicrous Override the default tier of your key for this request.
X-Request-Id: <uuid> Idempotency key for billing. Retry safe.
X-Siati-User: <opaque-id> Optional end-user identifier for multi-tenant logs.

Response

json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1779203245,
  "model": "apertus-70b-instruct",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 91,
    "completion_tokens": 67,
    "total_tokens": 158
  }
}

Errors

Standard codes from Errors. The most common:

  • 400 invalid_request_error — bad shape, unknown role, etc.
  • 401 invalid_api_key — see Authentication.
  • 429 rate_limit_exceeded — see Rate limits. Includes Retry-After.

Tips