OpenAI-compatible
POST/v1/chat/completions

Use this endpoint with any OpenAI SDK client. The request body follows OpenAI's chat completions schema unchanged. The model field must be a value returned by GET /v1/models.

FieldTypeDescription
modelstring · requiredA model id from GET /v1/models.
messagesarray · requiredChat messages, each { role, content }.
max_tokensintegerMax output tokens. Reasoning models spend their thinking inside this budget — set it too low and you get a `200` with empty content (see [Errors](/docs/errors)).
temperaturenumberSampling temperature, 0–2.
streambooleanStream the response as SSE chunks.
toolsarrayTool/function definitions (OpenAI tool schema).

Response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "<model>",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "..." },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21 }
}