Streaming
Receive tokens as Server-Sent Events as they are generated.
Set "stream": true to receive the reply incrementally over Server-Sent Events
(SSE). Use streaming for any generation that may take a while, because a
non-streaming request whose full answer takes longer than 4 minutes fails.
curl https://blaze.e2enetworks.net/v1/chat/completions \
-H "Authorization: Bearer $BLAZE_API_KEY" \
-H "Content-Type: application/json" \
-N \
-d '{
"model": "qwen/qwen3.8-27b",
"messages": [{"role": "user", "content": "Count from 1 to 10."}],
"stream": true
}'The final usage chunk
BlazeInfer adds a final usage chunk only when the request has no
stream_options. If you send stream_options yourself, set
include_usage: true; otherwise no usage chunk is sent.
That chunk has an empty choices array, so make sure your code handles it
(see the guard in the Python tab above).
finish_reason (for example stop or tool_calls) arrives in its own chunk
with an empty delta. Read it to know why generation ended.
Reasoning models stream their reasoning in a separate delta field. The Python
and TypeScript examples above print only content. See
Reasoning models.
Handle truncated streams
If a stream fails after it has started, the HTTP response is already 200 and
the stream simply stops. Treat a stream that ends without a finish_reason as a
failed request and retry.