v4
latestOpenAPI 3.1.02026-07-31155218294.8 KBOpenai Chat Completions
Headers
Request body
If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
model name
whether to stream the output via SSE or return the full response
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
Sample from the best k (number of) tokens. 0 means off
The maximum number of tokens to generate in the chat completion.
The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 65536, whichever is smaller.
Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments.
number of sequences to return
Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers.
Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed.
Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the content of message.
Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports.
A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key.
Chat template kwargs.
If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message.
Example request
{
"model": "meta-llama/Llama-2-70b-chat-hf"
}Response
Successful Response