Set stream=True to receive tokens as they're generated. Each chunk contains a delta object with partial content.
Delta Object Fields
delta.content— Text token(s)delta.role— Appears in the first chunk onlydelta.tool_calls— Tool call fragments (for function calling)delta.refusal— Refusal message (rare)
The lifecycle, in chunks
The first chunk usually carries delta.role: "assistant" and no content — that's the 'I'm starting' signal. Mid-stream chunks carry delta.content incrementally. The final chunk carries finish_reason and an empty content. Then a literal data: [DONE] line closes the stream.
Tool-calling streams interleave a different shape: delta.tool_calls[i].function.arguments arrives as JSON fragments (not valid JSON individually). Concatenate, then parse at the end — see Function Call Streaming below.