OpenAIChatCompletionChunk
@Serializable
A streaming SSE chunk from the OpenAI chat completion API.
When stream_options with include_usage: true is set on the request, an additional chunk is streamed before the data: [DONE] message whose usage field shows the token usage statistics for the entire request and whose choices field is always an empty array.
Example chunk:
{
"id": "chatcmpl-abc123",
"object": "chat.completion.chunk",
"created": 1699892447,
"model": "gpt-5.6-sol",
"choices": [{ "index": 0, "delta": { "content": "Hello" } }]
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(id: String, obj: String, created: Long, model: String, choices: List<OpenAIChunkChoice>, usage: OpenAIUsage? = null, systemFingerprint: String? = null, serviceTier: OpenAIServiceTier? = null)
Properties
Link copied to clipboard
The streaming choices in this chunk.
Link copied to clipboard
The processing tier actually used to serve the request. null if not included.
Link copied to clipboard
Represents the backend configuration that the model runs with. null if not included.
Link copied to clipboard
Token usage statistics. Only present on the final usage chunk when requested via stream options. null otherwise.