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.
POST
/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, 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
curl -X POST http://localhost:8765/api/v1/chat/completions \
-H "Authorization: Bearer soriku-local" \
-H "Content-Type: application/json" \
-d '{"model":"auto","messages":[{"role":"user","content":"Hello"}]}'
Response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "qwen2.5-coder:7b",
"choices": [{
"message": {"role": "assistant", "content": "..."},
"finish_reason": "stop"
}]
}