Represents a streamed chunk of a chat completion response returned by Claude models.

Object Fields

id
string
A unique identifier for the chat completion. Each chunk has the same ID.
choices
array
A list of chat completion choices.Each choice object contains:
  • index (integer): The index of the choice
  • delta (object): The delta content generated by the model
    • role (string): The role (only in first chunk)
    • content (string): The content fragment
  • finish_reason (string | null): null if still streaming
created
integer
The Unix timestamp (in seconds). Each chunk has the same timestamp.
model
string
The model that generated the completion.
object
string
The object type, which is always chat.completion.chunk.

Example

{
  "id": "chatcmpl-claude-123",
  "object": "chat.completion.chunk",
  "created": 1677652288,
  "model": "claude-sonnet-4-20250514",
  "choices": [
    {
      "index": 0,
      "delta": {
        "content": "Hello"
      },
      "finish_reason": null
    }
  ]
}

Streaming Format

data: {"id":"chatcmpl-claude-123","object":"chat.completion.chunk","created":1677652288,"model":"claude-sonnet-4-20250514","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-claude-123","object":"chat.completion.chunk","created":1677652288,"model":"claude-sonnet-4-20250514","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}

data: {"id":"chatcmpl-claude-123","object":"chat.completion.chunk","created":1677652288,"model":"claude-sonnet-4-20250514","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: [DONE]