POST /v1/chat/completions
OpenAI-compatible chat. Accepts the standard request schema, returns the standard response shape, adds `model` field showing which one it routed to.
/api/v1/chat/completionsStandard OpenAI-compatible completions with smart routing.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
messages | array | yes | OpenAI-format message list |
model | string | no | auto to let Soriku route, worker:<id> (for example worker:sora) to address a Worker, or a specific model id |
stream | boolean | no | Stream tokens via SSE |
temperature | number | no | Sampling temperature |
max_tokens | integer | no | Cap on response length |
x_agent_id | string | no | Attach an agent persona for this request |
Example
Response
Workers and response headers
Address a Worker as a model: worker:sora, worker:tomo, or the URL-safe name of a Worker you made yourself. The Worker's instructions and data zone apply to the request. A Worker that does not exist or is switched off gives a 404 model_not_found. GET /api/v1/models lists the Workers you can use.
Every response carries X-Soriku-Model (the model that answered), X-Soriku-Decision, X-Soriku-Worker (the Worker, or none) and X-Soriku-Route: local on your own hardware, eu at an EU-hosted provider, keys at another provider through API keys. Send X-Soriku-Zone: local, eu or any to tighten the data zone for one request. It can never loosen it.