POST /v1/chat/completions accepts the same request body as the OpenAI Chat Completions API. Parameters we do not support are rejected with a 400 rather than silently ignored.
Request parameters
| Field | Type | Required | Notes |
|---|---|---|---|
| model | string | yes | Any model id from GET /v1/models |
| messages | array | yes | Roles: system, user, assistant, tool |
| stream | boolean | no | When true, returns text/event-stream |
| temperature | number | no | 0–2, provider default when omitted |
| max_tokens | integer | no | Clamped to the model max output |
| tools | array | no | Function calling, OpenAI schema |
| tool_choice | string | object | no | auto, none, required or a named tool |
| response_format | object | no | {"type":"json_object"} on supported models |
| seed | integer | no | Best-effort determinism |
Response shape
{
"id": "chatcmpl-bs-9f2c1a",
"object": "chat.completion",
"created": 1761523200,
"model": "gpt-5-mini",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Edge computing processes data near its source." },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 18, "completion_tokens": 11, "total_tokens": 29 }
}
Compatibility notes
- The response is passed through from the upstream provider with the model field normalized to the id you requested.
- usage is always present, including on streamed responses, so you can reconcile cost locally.
- Legacy /v1/completions (text completion) is not offered. Use chat completions with a single user message.
- Embeddings are available at POST /v1/embeddings for embedding models only.
التوثيق التقني متوفر باللغة الإنجليزية.