v27

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-2193427579.9 KB
Inference

Create chat completions.

Generate an OpenAI-compatible chat completion for the given messages using the specified model.

post/v1/chat/completions

Request body

modelstring required

The identifier of the model to use.

frequency_penaltynumber nullable

The penalty for repeated tokens.

functionsobject[] nullable

List of functions to use.

logit_biasobject nullable

The logit bias to use.

logprobsboolean nullable

The log probabilities to use.

max_completion_tokensinteger nullable

The maximum number of tokens to generate.

max_tokensinteger nullable

The maximum number of tokens to generate.

ninteger nullable

The number of completions to generate.

parallel_tool_callsboolean nullable

Whether to parallelize tool calls.

presence_penaltynumber nullable

The penalty for repeated tokens.

seedinteger nullable

The seed to use.

streamboolean nullable

Whether to stream the response.

stream_optionsobject nullable

The stream options to use.

temperaturenumber nullable

The temperature to use.

toolsobject[] nullable

The tools to use.

top_logprobsinteger nullable

The number of most likely tokens to return at each position.

top_pnumber nullable

The top p to use.

userstring nullable

The user to use.

service_tier'auto' | 'default' | 'flex' | 'priority'

The service tier for the request.

reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' nullable

The effort level for reasoning models.

prompt_cache_keystring nullable

A key to use when reading from or writing to the prompt cache.

Response

An OpenAIChatCompletion. When streaming, returns Server-Sent Events (SSE) with OpenAIChatCompletionChunk objects.

idstring required

The ID of the chat completion.

object'chat.completion'

The object type.

createdinteger required

The Unix timestamp in seconds when the chat completion was created.

modelstring required

The model that was used to generate the chat completion.

service_tierstring nullable

The service tier that was used for this response.

system_fingerprintstring nullable

System fingerprint for this completion.