--- title: "ChatStreamChunk" --- Streaming chat completion chunk ## Fields | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `choices` | List[[components.ChatStreamChoice](../components/chatstreamchoice.mdx)] | :heavy_check_mark: | List of streaming chunk choices | | | `created` | *int* | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | | `error` | [Optional[components.ChatStreamChunkError]](../components/chatstreamchunkerror.mdx) | :heavy_minus_sign: | Error information | \{
"code": 429,
"message": "Rate limit exceeded",
"metadata": \{
"error_type": "rate_limit_exceeded"
}
} | | `id` | *str* | :heavy_check_mark: | Unique chunk identifier | chatcmpl-123 | | `model` | *str* | :heavy_check_mark: | Model used for completion | openai/gpt-4 | | `object` | [components.ChatStreamChunkObject](../components/chatstreamchunkobject.mdx) | :heavy_check_mark: | N/A | | | `openrouter_metadata` | [Optional[components.OpenRouterMetadata]](../components/openroutermetadata.mdx) | :heavy_minus_sign: | N/A | \{
"attempt": 1,
"endpoints": \{
"available": [
\{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | | `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | | `system_fingerprint` | *Optional[str]* | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | | `usage` | [Optional[components.ChatUsage]](../components/chatusage.mdx) | :heavy_minus_sign: | Token usage statistics | \{
"completion_tokens": 15,
"completion_tokens_details": \{
"reasoning_tokens": 5
},
"cost": 0.0012,
"cost_details": \{
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"is_byok": false,
"prompt_tokens": 10,
"prompt_tokens_details": \{
"cached_tokens": 2
},
"server_tool_use_details": \{
"tool_calls_executed": 2,
"tool_calls_requested": 2
},
"total_tokens": 25
} |