v1

latestOpenAPI 3.0.32026-07-26451985.7 KB

Chat Completions

Sends a prompt to an OpenAI compatible chat completion model and returns a completion. Provides completions for open source models that are text-generation, chat, audio-text-to-text, image-text-to-text, video-text-to-text, and also supports closed source providers openai, anthropic, mistral, cohere, and google. To send a request to a closed source provider, prefix your model with their provider name, e.g. openai/gpt-4.

post/models/v2/openai/v1/chat/completions

Headers

Authorizationstring required

Token for authentication

Request body

modelstring required

The ID of the model to run (e.g., Qwen/Qwen3-1.7B, openai/gpt-4)

max_completion_tokensinteger

Maximum number of tokens to generate

temperaturenumber

Sampling temperature

streamboolean

Whether to stream responses

top_pnumber

Nucleus sampling parameter

presence_penaltynumber

Penalize new tokens based on whether they appear in the text so far

frequency_penaltynumber

Penalize new tokens based on their existing frequency in the text so far

logprobsboolean

Whether to return log probabilities of output tokens (if supported)

top_logprobsinteger

Number of most likely tokens to return at each position (if logprobs is true)

Response

Successful model completion

idstring

Unique ID for this completion

objectstring

Type of returned object (usually chat.completion)

createdinteger

Unix timestamp of completion