chat
Create a chat completion
GoModel API reference for POST /v1/chat/completions: Create a chat completion.
POST
{base_url}
/
v1
/
chat
/
completions
Error
A valid request URL is required to generate request examples{
"choices": [
{
"finish_reason": "<string>",
"index": 123,
"logprobs": {},
"message": {
"content": [
{
"file": {
"file_data": "<string>",
"file_id": "<string>",
"file_url": "<string>",
"filename": "<string>"
},
"image_url": {
"detail": "<string>",
"media_type": "<string>",
"url": "<string>"
},
"input_audio": {
"data": "<string>",
"format": "<string>"
},
"text": "<string>",
"type": "<string>",
"video_url": {
"detail": "<string>",
"url": "<string>"
}
}
],
"role": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "<string>"
}
]
},
"stop_sequence": "<string>"
}
],
"created": 123,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"provider": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens": 123,
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123,
"image_tokens": 123,
"text_tokens": 123
},
"raw_usage": {},
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Chat completion request
Show child attributes
Show child attributes
Gateway routing hint; stripped before upstream execution.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
string or object
Show child attributes
Show child attributes
Last modified on September 23, 2026
Was this page helpful?
⌘I
Error
A valid request URL is required to generate request examples{
"choices": [
{
"finish_reason": "<string>",
"index": 123,
"logprobs": {},
"message": {
"content": [
{
"file": {
"file_data": "<string>",
"file_id": "<string>",
"file_url": "<string>",
"filename": "<string>"
},
"image_url": {
"detail": "<string>",
"media_type": "<string>",
"url": "<string>"
},
"input_audio": {
"data": "<string>",
"format": "<string>"
},
"text": "<string>",
"type": "<string>",
"video_url": {
"detail": "<string>",
"url": "<string>"
}
}
],
"role": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "<string>"
}
]
},
"stop_sequence": "<string>"
}
],
"created": 123,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"provider": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens": 123,
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123,
"image_tokens": 123,
"text_tokens": 123
},
"raw_usage": {},
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "provider_error",
"provider": "<string>"
}
}