Skip to Content
Docs

Features

Settlement

Timing, session states, and how to follow a payment channel to its final state on chain.

Each request opens one payment channel. Its life on devnet:

StepTypical time
Miner chosen, channel openeda few seconds
Verified replyabout 15 to 50 s after the request, sometimes longer
Settlement final on chain2 to 4 minutes after the reply, in the background

When the call returns

A non-streaming call returns as soon as the reply is verified, with flop.status: "settling". The settlement continues in the background.

To wait for the settlement instead, send "flop": {"wait_for_settlement": true}. The call then returns once the settlement is final, with miner_paid set, but only up to the response deadline below.

The response deadline

Some proxies drop responses that stay idle for long. So a non-streaming call answers within a fixed deadline (85 s on this server). If no verified reply has arrived by then, it returns 202 instead of failing:

JSON
{
  "id": "gen-...",
  "object": "chat.completion.pending",
  "status": "pending",
  "message": "no verified reply within 85 s; the session continues. Poll GET /v1/sessions/gen-... until reply is set, or use stream: true.",
  "poll": "/v1/sessions/gen-...",
  "flop": {"session_id": "gen-...", "status": "running"}
}

The session keeps running. Poll GET /v1/sessions/{id} with the same key until reply is set. Streaming avoids this case entirely.

Following a session

Shell
curl https://api.floprouter.com/v1/sessions/<session_id>
statusMeaning
runningThe request is in progress.
settlingThe reply was delivered. The settlement is not final yet.
settledThe miner was paid on chain. miner_paid and on_chain.outcome_tx are set.
refundedThe escrow went back to the payer.
recoveringThe miner went silent after the channel opened. The router is closing the channel on chain.
failedNo attempt produced output.
fraud, voidedFinal outcomes decided on chain.

on_chain holds the open block, the outcome, the outcome block and the transaction. With the key that made the request, the record also carries reply: the verified reply, once there is one. Look the channel up on the explorer: https://explorer.devnet.flop.network/channels/<channel_id>.

When a miner goes silent

The router watches every channel it opened. If a channel stays open past its deadlines, the router sends the matching recovery call on chain (expire_force_open, timeout, force_settle or finalize). These calls are open to anyone on FLOP; the router pays their transaction fees. The session's attempts[].recovery lists what was sent.

One channel per request

A multi-turn conversation is one request per turn, each with its own channel. Send the whole history in messages each time, as with any chat API.