v1

latestOpenAPI 3.1.0Apache-2.02026-07-17111932.3 KB
Chat Completions

Create chat completion

Creates a chat completion for the provided messages. OpenAI-compatible endpoint. Messages are converted to a prompt internally; responses use object "chat.completion" and choices[].message with role and content.

post/v1/chat/completions

Request body

modelstring

Model identifier

max_tokensinteger

Maximum number of tokens to generate

streamboolean

Whether to stream the response as SSE

temperaturenumber

Sampling temperature

top_pnumber

Nucleus sampling probability

presence_penaltynumber
frequency_penaltynumber
seedinteger
userstring
enable_reasoningboolean

When false, reasoning models (e.g. DeepSeek-R1) skip chain-of-thought and respond directly. Has no effect on non-reasoning models.

Example request

{
  "model": "test-model"
}

Response

Successful chat completion (JSON) or streaming (text/event-stream)

idstring required

Unique chat completion identifier

object'chat.completion' required

Object type

createdinteger required

Unix timestamp of creation

modelstring

Model used for completion

Example response

{
  "id": "chatcmpl-abc123def456"
}
All 11 operations