OpenAI-compatible
POST
/v1/chat/completions/v1/chat/completions
| Field | Type | Description |
|---|---|---|
| model | string · required | 來自 GET /v1/models 的 model id。 |
| messages | array · required | 對話訊息,每則為 { role, content }。 |
| max_tokens | integer | 最大輸出 token 數。reasoning 模型的思考也吃這個額度——設太低會拿到內容為空的 `200`(見[錯誤](/docs/errors))。 |
| temperature | number | 取樣溫度,0–2。 |
| stream | boolean | 以 SSE chunk 串流回應。 |
| tools | array | Tool/function 定義(OpenAI tool schema)。 |