Skip to content

Streaming

Set stream to true on a chat completion request. The gateway returns Server-Sent Events and forwards provider chunks as they arrive.

bash
curl --no-buffer http://127.0.0.1:4000/v1/chat/completions \
  -H 'Authorization: Bearer local-gateway-key' \
  -H 'Content-Type: application/json' \
  -d '{"model":"gpt-4o-mini","stream":true,"messages":[{"role":"user","content":"Hello"}]}'

The gateway does not retry after a stream has begun. Client cancellation is propagated to the provider request.

Streaming responses include:

http
Content-Type: text/event-stream
Cache-Control: no-cache, no-transform
X-Accel-Buffering: no
Server: Go-Feather-Route
X-Request-ID: <request-id>

The request ID is generated by the gateway when the client does not provide one, forwarded to the provider, and included in structured request logs. The anti-buffering header is understood by common reverse proxies; the deployment proxy must still be configured to flush SSE responses promptly.