v1

latestOpenAPI 3.1.02026-07-2332014.2 KB
Chat Completions

Create a chat completion

post/v1/chat/completions

Request body

modelstring required
temperaturenumber nullable
top_pnumber nullable
ninteger nullable
streamboolean nullable
stopobject nullable
max_tokensinteger nullable
presence_penaltynumber nullable
frequency_penaltynumber nullable
logit_biasobject nullable
userstring nullable
seedinteger nullable
tool_choice'auto' | 'none' | 'required'

Controls whether the model calls a tool. auto lets the model decide, none disables tool calls, required forces the model to call a tool.

logprobsboolean nullable
top_logprobsinteger nullable
functionsstring[] nullable
function_callstring nullable

Response

Chat completion result. When stream: true, the response is returned as text/event-stream instead of JSON, with OpenAI-style data: {chunk}\n\n framing terminated by data: [DONE]\n\n.

ChatCompletionResponse required

OpenAI-compatible chat completion response. Standard fields (id, object, created, model, choices, usage) are returned; provider-specific extras are stripped before responding.

All 3 operations