/chat/completionsCreate a chat completion
Creates a model response for a chat conversation from an ordered list of messages. Supply model and at least one messages item, then use generation, sampling, audio, tool, or response-format options to control the result; set streaming options when you want chat completion chunks.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
Chat completion request containing the model, conversation messages, and optional generation, sampling, audio, storage, moderation, web search, and response-format settings.
One documented failure
slow_downYour request rate increased too quickly. Please reduce the request rate and gradually increase it again.
Traffic increased too quickly
One documented failure
server_is_overloadedThe model is temporarily overloaded. Please retry your request after a brief delay.
The requested model is temporarily overloaded
model and messages are required, and messages must contain at least one item. frequency_penalty and presence_penalty must be between -2 and 2, while top_logprobs must be between 0 and 20; a 429 is returned when the request rate exceeds the limit, and a 503 is returned when the requested model is temporarily overloaded.