Appearance
数据模型: ChatCompletionStreamResponse
ChatCompletionStreamResponse
| 字段 | 类型 | 必选 | 描述 |
|---|---|---|---|
| id | string | 否 | |
| object | string | 否 | |
| created | integer | 否 | |
| model | string | 否 | |
| choices | array of object | 否 | |
| choices[].index | integer | 否 | |
| choices[].delta | object | 否 | |
| choices[].delta.role | string | 否 | |
| choices[].delta.content | string | 否 | |
| choices[].delta.reasoning_content | string | 否 | |
| choices[].delta.tool_calls | array of any | 否 | |
| choices[].finish_reason | string (nullable) | 否 | |
| usage | any | 否 |
数据模型示例
json
{
"id": "string",
"object": "chat.completion.chunk",
"created": 0,
"model": "string",
"choices": [
{
"index": 0,
"delta": {
"role": "string",
"content": "string",
"reasoning_content": "string",
"tool_calls": [
{
"id": "string",
"type": "function",
"function": {
"name": "string",
"arguments": "string"
}
}
]
},
"finish_reason": "string"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
}
}
}ToolCall
| 字段 | 类型 | 必选 | 描述 |
|---|---|---|---|
| id | string | 否 | |
| type | string | 否 | |
| function | object | 否 | |
| function.name | string | 否 | |
| function.arguments | string | 否 |
数据模型示例
json
{
"id": "string",
"type": "function",
"function": {
"name": "string",
"arguments": "string"
}
}Usage
| 字段 | 类型 | 必选 | 描述 |
|---|---|---|---|
| prompt_tokens | integer | 否 | 提示词 Token 数 |
| completion_tokens | integer | 否 | 补全 Token 数 |
| total_tokens | integer | 否 | 总 Token 数 |
| prompt_tokens_details | object | 否 | |
| prompt_tokens_details.cached_tokens | integer | 否 | |
| prompt_tokens_details.text_tokens | integer | 否 | |
| prompt_tokens_details.audio_tokens | integer | 否 | |
| prompt_tokens_details.image_tokens | integer | 否 | |
| completion_tokens_details | object | 否 | |
| completion_tokens_details.text_tokens | integer | 否 | |
| completion_tokens_details.audio_tokens | integer | 否 | |
| completion_tokens_details.reasoning_tokens | integer | 否 |
数据模型示例
json
{
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
}
}