Chat Completions
POST /v1/chat/completions is an OpenAI-wire-compatible proxy. If you have
code that talks to the OpenAI Chat Completions API, point its base URL at AIUS
and use an aius_… bearer token — it just works. The provider key is held
server-side; you never send one.
The model is server-owned and not selectable. The gateway ignores any
model you send and forces the platform-selected model (resolved from a
server-side catalog), then scrubs the model identity to aius-default on
every response. Any tools you include are stripped before the upstream
call — tools are server-owned too. You do not pick the model or inject tools
over this API.Request
Headers
Body
The body is forwarded to the upstream model in OpenAI Chat Completions shape.| Field | Type | Required | Notes |
|---|---|---|---|
model | string | No | Ignored. The gateway forces the server-selected model and discards whatever you send. SDKs require the field — pass any placeholder (e.g. aius-default). |
messages | array | Yes | OpenAI message objects (role + content). |
stream | boolean | No | true streams Server-Sent Events. Default false. |
max_tokens | integer | No | Upper bound on generated tokens. |
temperature | number | No | Sampling temperature. |
tools | array | No | Stripped before the upstream call — tools are server-owned on AIUS, not client-supplied. |
Standard OpenAI Chat Completions fields (
top_p, stop, tool_choice, etc.)
are forwarded upstream as-is. The two exceptions are model (forced
server-side) and tools (stripped) — see the note above.Non-streaming response
Returns the standard Chat Completions object. Note themodel field is the
scrubbed aius-default label, never the real upstream model id:
x-aius-session-id, x-aius-run-id, x-aius-step-run-id.
Streaming response
Set"stream": true. The response is text/event-stream of OpenAI chunk
objects, terminated by data: [DONE]:
Examples
Non-streaming
Using the OpenAI SDK
Because the wire format matches, the official OpenAI SDKs work directly:Streaming
About GET /v1/models
GET /v1/models is not a list of selectable LLMs — the LLM is server-owned
and forced (see the note at the top). It is the per-client model registry
(the ML/AI model cards your runs produce as deliverables), scoped to an
organization via a required org_id query parameter:
When to use the run loop instead
/v1/chat/completions is a stateless proxy: you own the conversation, the tool
loop, and tool execution. If you want the server to drive the agent loop and
just hand you tool calls to execute locally, use the
run-loop WebSocket instead.