Chat Completions
Create text, multimodal, and tool-enabled responses with the OpenAI-compatible Chat Completions API.
Chat Completions generates a model response from a list of messages. Depending on the selected model, the endpoint can support text chat, multimodal input, streaming output, structured output, and function tools.
/v1/chat/completionsGenerate a model response from the supplied messages. The endpoint supports standard and SSE streaming responses. Advanced capabilities such as image or audio input, tool calling, and structured output depend on the selected model.
When switching models, start with a minimal text request, then enable advanced parameters one at a time.
Authorization
bearerAuth Use Bearer your-api-key in the Authorization header.
In: header
Request Body
Choose a request structure based on the model input modality. All three views use the same Chat Completions endpoint and shared generation parameters.
application/jsonUse this mode for chat, content generation, and text reasoning. Message content can be a string.
- model
- A text model ID available to the current account.
- messages[].role
- The message role, such as user, system, or assistant.
- messages[].content
- The text message as a string.
{
"model": "MODEL_ID",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
]
}Text chat request. User messages can be strings or content arrays containing only text.
Image and audio inputs are available only for models that support the corresponding modality. Check the models available to the current account and the actual API capabilities.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json