Chat Completion streaming chunk
Streaming chunk returned by the Chat Completion API.
Attributes
idstring
Generated chat response ID.objectstring
Response object type, alwayschat.completion.chunk.createdtimestamp
Unix timestamp (seconds) when the chunk was generated.modelstring
Model name.choicesobject array
List of streamed response alternatives. Eachchoiceobject:Expand/Collapse
finish_reasonstring
Why generation stopped.indexint
Choice index.deltaobject
Incremental response chunk.
Expand/Collapse
rolestring
Message role, alwaysassistant.contentstring
Message text content.reasoningstring
Reasoning content (only for step reasoning models).tool_callsobject arrayoptional
Toolcall content.
Expand/Collapse
idstring
Function call ID generated by the model; unique in context.typestring
Toolcall type, alwaysfunction.functionobject
Function payload.
Expand/Collapse
namestring
Function name, usually the name provided in the previous turn’s tools list.argumentsstring
Function arguments as a JSON string.
usageobject
Token usage statistics.Expand/Collapse
prompt_tokensint
Prompt tokens used.cached_tokensintoptional
Prompt tokens served from cache.completion_tokensint
Completion tokens generated.total_tokensint
Total tokens.
Example
data: {"id":"d7ae7c4a-1524-4fe5-9d58-e4d59b89d8f0","object":"chat.completion.chunk","created":1709899323,"model":"step-3.5-flash","choices":[{"index":0,"delta":{"role":"","content":"Hello"},"finish_reason":""}],"usage":{"prompt_tokens":83,"completion_tokens":1,"total_tokens":84}}
...
data: {"id":"d7ae7c4a-1524-4fe5-9d58-e4d59b89d8f0","object":"chat.completion.chunk","created":1709899323,"model":"step-3.5-flash","choices":[{"index":0,"delta":{"role":"","content":"value"},"finish_reason":""}],"usage":{"prompt_tokens":83,"completion_tokens":148,"total_tokens":231}}
data: {"id":"d7ae7c4a-1524-4fe5-9d58-e4d59b89d8f0","object":"chat.completion.chunk","created":1709899323,"model":"step-3.5-flash","choices":[{"index":0,"delta":{"role":"","content":""},"finish_reason":"stop"}],"usage":{"prompt_tokens":83,"completion_tokens":150,"total_tokens":233}}
data: [DONE]Last updated on