Skip to Content
Docs

Features

Payment channels and sessions

What a session is, how its payment channel moves on chain, and how to read both.

Each request is one session. A session opens one payment channel on FLOP Network: an on-chain account between the payer and the miner that holds the escrow for this request. The miner answers through it and is paid from it.

The life of a channel

StageOn chainIn the session record
OpenedThe channel exists with the escrow locked. Opened against the miner's signed offer (via: "offer") or by force-open (via: "force").status: "running", channel_id, on_chain.open_block
AnsweredNothing yet. The reply and the miner's signed receipt travel off chain.status: "settling", usage
SettledThe miner posts the settlement and the escrow is paid out.status: "settled", miner_paid, on_chain.outcome_tx
RecoveredIf the miner goes silent, the router closes the channel with a timeout or force-settle.status: "recovering", then the outcome

Settlement timing and the recovery calls are on the settlement page.

Read a session

Shell
curl https://api.floprouter.com/v1/sessions/<session_id> -H "Authorization: Bearer $FLOPROUTER_API_KEY"

The session id is the id of the chat completion, and flop.session_id. The record carries:

FieldMeaning
statusrunning, settling, settled, refunded, recovering, failed, fraud or voided.
channel_idThe payment channel, 0x plus 64 hex characters.
miner, endpoint, viaWho served it and how the channel was opened.
payeraddress and kind: who paid on chain (see payer modes).
escrow, miner_paidWhat was locked, and what the settlement paid.
router_feePercent, amount and status: pending, charged, not_charged or not_billed.
on_chainopen_block, outcome, outcome_block, outcome_tx.
attemptsEvery try, with the miner, stage, error and any recovery calls.
replyThe verified reply, to the key that made the request, once there is one.

Generation records Not live yet

A generation lookup reads the same session by its id:

Shell
curl "https://api.floprouter.com/v1/generation?id=gen-..." -H "Authorization: Bearer $FLOPROUTER_API_KEY"

It returns tokens, total_cost in FLOP, finish reason, latency and the verified reply, with the full session under flop. Every chat response carries the id in the X-Generation-Id header as well as in id.

Cost in the response

usage.cost is the request's cost in FLOP: escrow plus router fee. It is final when the session settles (usage.cost_details.final), and 0 for a session that is refunded. usage.cost_details.upstream_inference_cost is the escrow, split into prompt and completion by token share.

List your sessions

Shell
curl "https://api.floprouter.com/v1/sessions?limit=20" -H "Authorization: Bearer $FLOPROUTER_API_KEY"

On the explorer

  • A channel: https://explorer.devnet.flop.network/channels/<channel_id>
  • A transaction: https://explorer.devnet.flop.network/transactions/<outcome_tx>
  • A payer or miner: https://explorer.devnet.flop.network/account/<address>

In grant mode the explorer shows your address as the payer of the channel.