ChatCompletions format.
OpenAI Chat Completions-compatible endpoint. Supports standard chat requests, and can also be used to call image-capable Gemini models via the OpenAI chat format.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.4-nano", "messages": [ { "role": "user", "content": "Write a concise launch note." } ] }'{
"id": "chatcmpl_123",
"object": "chat.completion",
"created": 0,
"model": "string",
"choices": [
{
"index": 0,
"message": {
"role": "system",
"content": "string",
"name": "string",
"tool_call_id": "string",
"tool_calls": [
{}
]
},
"delta": {},
"finish_reason": "string"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string"
}
}