"stream": true returns server-sent events of chat.completion.chunk objects, ending with data: [DONE]. Live
The stream carries:
- the first bytes once the router’s own checks pass (payer, balance, grant, miner availability), or after 8 s,
- keep-alive comments (lines that start with
:, such as: FLOPROUTER PROCESSING) at least every 15 s while the miner works, so proxies and clients do not time out, - text deltas, forwarded as the miner streams them,
- a last chunk with
usageand theflopsession record (it repeatsfinish_reasoninchoices), data: [DONE].
Verification
The streamed text is provisional while it arrives. When the turn ends, the miner’s signed receipt is checked against the whole reply, and the finish chunk follows that check. The receipt commits to the same bytes, so the two match. If they ever did not, the stream ends with an error chunk that carries the verified text:Errors after the stream started Not live yet
A mid-stream error arrives as one chunk with a top-levelerror (code, message, metadata) and choices: [{"delta": {"content": ""}, "finish_reason": "error"}]. The stream ends after it, with no [DONE]. The reason is in error.metadata.reason, and for stream_mismatch the verified text is in error.metadata.verified_content.
Why stream
- You see text within seconds instead of waiting for the whole reply.
- Non-streaming calls have a response deadline. When no verified reply arrives in time, they return
202with a pending body and you poll for the reply (see settlement). A stream has no such deadline.
GET /v1/sessions/{id} with the flop.session_id from the last chunk.