Back

Streaming

Use stream: true for server-sent events. Parse events, not transport chunks.

Before output

The gateway may try viable candidate keys before accepting output. A bounded acquisition deadline still applies; do not assume every key is attempted before a timeout.

During output

SSE comments keep accepted streams alive during pauses. Respect backpressure and support cancellation. Heartbeats do not override absolute client deadlines.

Completion and failure

Chat ends with [DONE]; Messages and Responses have their own terminal events. Do not replay a partial response automatically. Preserve the request ID and handle a stream error separately from HTTP status.

Open workspace