Skip to main content
With stream: true, the reply is a Server-Sent Events stream. The chunk payload is in Delta format.

Headers

The gateway writes 200 immediately, then streams: X-Accel-Buffering: no disables proxy buffering. An initial heartbeat follows the 200.

Frames

The payload is a chat.completion.chunk. Frames are separated by a blank line. Parse each data: line as JSON, except the terminal sentinel.

Heartbeat

Every 15 seconds the gateway emits a comment frame:
SSE clients ignore comment lines; a hand-written parser should skip lines starting with :.

Termination

[DONE] is not JSON. With stream_options.include_usage, a usage chunk precedes it. See Stream termination. Fusion is batched. Encrypted streams as a passthrough of the provider’s encrypted deltas.