v1
latestOpenAPI 3.1.02026-07-2219165126.1 KBChat Completions
Create a chat completion
Generate an OpenAI-compatible chat completion from conversation messages. Supports streaming, multimodal content, structured outputs, and tool calling.
post/v1/chat/completions
Request body
Example request
{
"messages": [
{
"content": "You are a concise assistant.",
"role": "system"
},
{
"content": "Summarize vector databases in 2 sentences.",
"role": "user"
}
],
"model": "gpt-4o-mini",
"temperature": 0.3
}Response
JSON response when stream=false, or Server-Sent Events when stream=true.
Example response
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Tokyo is Japan's capital and one of the world's largest metropolitan areas. It blends dense modern districts with historic neighborhoods, food, and culture.",
"role": "assistant"
}
}
],
"created": 1743393600,
"id": "chatcmpl_123",
"model": "gpt-4o-mini",
"object": "chat.completion",
"usage": {
"completion_tokens": 30,
"completion_tokens_details": {
"image_tokens": 0
},
"prompt_tokens": 15,
"total_tokens": 45
}
}