Skip to main content
"stream": true returns server-sent events of chat.completion.chunk objects, ending with data: [DONE]. Live The stream carries:
  1. the first bytes once the router’s own checks pass (payer, balance, grant, miner availability), or after 8 s,
  2. 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,
  3. text deltas, forwarded as the miner streams them,
  4. a last chunk with usage and the flop session record (it repeats finish_reason in choices),
  5. data: [DONE].
The router forwards text as soon as the miner sends it. Miners on devnet today (worker 0.1.418) send the reply in one piece at the end of the turn, so for now a stream shows keep-alives and then the whole reply at once. When workers stream as they decode, the same requests show text as it is produced; nothing changes on your side.

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:
Once text has reached you, the router does not fail over to another miner, so you never get two answers for one request.

Errors after the stream started Not live yet

A mid-stream error arrives as one chunk with a top-level error (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 202 with a pending body and you poll for the reply (see settlement). A stream has no such deadline.
Streams never wait for the settlement. Read it from GET /v1/sessions/{id} with the flop.session_id from the last chunk.