Response
A non-streaming response returns a chat.completion object:
Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1707436800,
"model": "glm-4.7",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 9,
"total_tokens": 33
}
}Response Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Required | Unique identifier for the completion (format: "chatcmpl-..."). |
object | string | Required | Always "chat.completion". |
created | integer | Required | Unix timestamp of when the completion was created. |
model | string | Required | The model that generated the completion. |
choices | array | Required | List of completion choices. Typically contains one choice. |
→message | object | Required | The assistant's response message with role, content, and optional reasoning. |
→message.reasoning | string | null | Optional | Reasoning text emitted before final content for reasoning-capable models. Usually empty when reasoning is disabled. |
→finish_reason | string | Required | "stop" (natural end), "length" (max_tokens reached), "tool_calls" (tool call requested), or "content_filter". |
usage | object | Required | Token usage statistics: prompt_tokens, completion_tokens, total_tokens. |
Reasoning Response
OpenRouter-style responses can return both content and reasoning in the same completion object. If you only want final user output, ignore the reasoning field.
Response with reasoning
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1707436800,
"model": "minimax-m2.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is the answer.",
"reasoning": "First, I computed the pieces and confirmed..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 24,
"total_tokens": 48
}
}