> ## Documentation Index
> Fetch the complete documentation index at: https://docs.floprouter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync state of the registry, event index, endpoint registry, sources and payer

> Sync state of every part. Never requires the origin header. `event_index.last_error` is the last error seen; `consecutive_failures` and `last_ok_at` say whether it is current. `status` is `degraded` while finality lags more than `api.maxFinalityLagBlocks` blocks behind the best block (`finality`).



## OpenAPI

````yaml /openapi.json get /health
openapi: 3.1.0
info:
  title: floprouter API
  version: 1.0.0
  description: >-
    The floprouter API routes chat requests to FLOP Network miners and settles
    each one on chain. One request format covers every model: chat completions
    with `provider` preferences and a `models` fallback list, model objects, a
    generation lookup, one error format and one streaming format. FLOP's own
    concepts have their own routes: miners, sessions on payment channels,
    session-key grants, the prepaid FLOP balance, settlement and on-chain
    attribution. **Base paths**: `/api/v1/...` and `/v1/...` serve the same
    routes; this document lists them under `/v1`. **Payer modes** (per key,
    overridable per request with `flop.payer`):

    - `grant`: the caller's wallet is the on-chain payer (channel `agent`) of
    every session. The wallet signs one `flopSessionKeys.createSession` grant to
    the router's delegate (`GET /v1/grants/params` returns the exact call data);
    the router then opens channels within the grant's caps. The escrow is paid
    on chain from the wallet; only the router fee comes from the prepaid
    balance. - `credit`: the router's wallet pays the session on chain; escrow
    and router fee are taken from the prepaid balance. **Balance**: fund it with
    a plain FLOP transfer from your wallet to `deposit_address` (`GET
    /v1/balance`); it is credited once the block is finalized. Withdraw with
    `POST /v1/balance/withdraw` (to the owning wallet only). Every balance can
    be recomputed from finalized chain state: billed sessions carry an encrypted
    ledger tag on chain, and the service checks its ledger against the chain
    continuously. The router fee is `fee_percent` of the session's escrow,
    charged only when the channel settles paid. **One request shape for every
    model**: the router chooses the chat envelope, template version, token
    limits and parameter support per model from what the chain and the miner's
    signed info say. Parameters a model does not support (see its
    `supported_parameters`) are ignored and named in
    `X-Floprouter-Ignored-Parameters`; `provider.require_parameters` refuses
    them instead. **Cost** (`usage.cost`, in FLOP): the escrow (prompt plus
    `max_tokens` at the model's price, paid in full on a cooperative settle)
    plus the router fee. Final once the session settles; a refunded session
    costs 0. **Timing**: a proxy in front closes responses idle for 100 s.
    Non-streaming calls answer within about 85 s: with the verified reply, or
    with HTTP 202 and the generation id to poll (`GET /v1/generation?id=`).
    Streams send `: FLOPROUTER PROCESSING` comments at least every 15 s.
    **Streaming**: chat completion chunks ending in a usage chunk (one choice
    repeating `finish_reason`) and `data: [DONE]`. Text is forwarded as the
    miner streams it and is provisional until the turn's signed receipt is
    verified at the end of the turn. A mid-stream error is one chunk with a
    top-level `error` and `finish_reason: "error"`. **Errors**: `{"error":
    {"code": <HTTP status>, "message", "metadata": {"reason", ...}}}`; 429 and
    503 carry `Retry-After`. **Miner score**: computed by the router from
    on-chain facts only (settlement history, volume, stake, slashing record,
    calibration state). The raw facts are returned beside it. **Client
    libraries**: the chat endpoint uses the widely used chat completions request
    and response format, so any client library for that format works with
    `baseURL` set to `https://api.floprouter.com/api/v1` and a floprouter key.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.floprouter.com
    description: API used by this site
security: []
tags:
  - name: Inference
    description: Chat completions and sessions.
  - name: Models
    description: >-
      Models, with their prices, limits and supported parameters, and the miners
      serving each.
  - name: Auth
    description: Wallet-signed API keys.
  - name: Grants
    description: 'Grant payer mode: the wallet stays the on-chain payer.'
  - name: Balance
    description: Prepaid balance and ledger.
  - name: Directory
    description: No key needed.
  - name: Service
    description: Health and this document.
paths:
  /health:
    get:
      tags:
        - Service
      summary: >-
        Sync state of the registry, event index, endpoint registry, sources and
        payer
      description: >-
        Sync state of every part. Never requires the origin header.
        `event_index.last_error` is the last error seen; `consecutive_failures`
        and `last_ok_at` say whether it is current. `status` is `degraded` while
        finality lags more than `api.maxFinalityLagBlocks` blocks behind the
        best block (`finality`).
      operationId: health
      responses:
        '200':
          description: Health
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  status:
                    enum:
                      - ok
                      - degraded
                  network:
                    type: string
                  finalized_block:
                    type:
                      - integer
                      - 'null'
              example:
                status: ok
                network: devnet
                genesis_hash: >-
                  0x99c172c095340ace980631f9123544c6bebd4839f3437e463533422d8be2d631
                rpc:
                  - wss://rpc.devnet.flop.network
                indexer_url: https://explorer.devnet.flop.network
                uptime_s: 266
                finalized_block: 4494343
                registry:
                  synced_block: 4494065
                  miners: 762
                  active: 761
                  retired: 0
                  scored: 762
                  scored_block: 4494318
                  channels: 57580
                  channel_sweep_block: 4465512
                  models: 10
                event_index:
                  anchor_block: 4465429
                  forward_cursor: 4494343
                  backfill_cursor: 49773
                  backfill_done: true
                  backfill_floor: 49773
                  backfill_blocks: 4415656
                  backfill_ms: 10048522
                  events: 137597
                  channels_with_exact_outcome: 57011
                  channels_with_indexer_outcome_only: 0
                  explorer_cross_check:
                    compared: 56295
                    disagree: 0
                  undecodable_blocks: 0
                  rpc_calls_since_start: 602
                  last_follow_at: '2026-11-24T03:09:14.272Z'
                  last_ok_at: '2026-11-24T03:09:14.273Z'
                  consecutive_failures: 0
                  recoveries_since_start: 0
                  last_error: null
                  last_error_at: null
                endpoints:
                  candidate_urls: 125
                  verified: 7
                  verified_ready: 1
                  unbound: 5
                  dead: 1
                offers:
                  live: 48
                  with_venue: 0
                  polled_at: '2026-11-24T03:08:57.063Z'
                sources:
                  seed-issues-2026-11-23:
                    at: 1795489490597
                    claims: 15
                    fresh: 0
                    ok: true
                  owner-input-2026-11-24:
                    at: 1795489490600
                    claims: 7
                    fresh: 0
                    ok: true
                  github-issues:
                    at: 1795489491421
                    claims: 235
                    fresh: 0
                    ok: true
                  technocore:gpu-miners:
                    at: 1795489492595
                    claims: 1
                    fresh: 0
                    ok: true
                  technocore:inference-agents:
                    at: 1795489493315
                    claims: 0
                    fresh: 0
                    ok: true
                  technocore:flop-devnet-faucet:
                    at: 1795489494044
                    claims: 0
                    fresh: 0
                    ok: true
                  flopradar-leaderboard:
                    at: 1795489494599
                    claims: 55
                    fresh: 1
                    ok: true
                payer:
                  router_wallet: 5GmdxzsmKFi31y1qXYJfxmeBvDoUhxR6D4DnVxbAUjQ8RNnw
                  modes:
                    - grant
                    - credit
                  demo: false
                  delegates: 1
                billing:
                  deposit_address: 5CZb3mksqZKcnVqG2FMaEy9Phuc49uufnS4izjpgRoWeYsfB
                  fee_percent: 5
                sessions:
                  total: 45
                  in_flight: 0
                  open_channels: 1
                finality:
                  best_block: 4502990
                  finalized_block: 4502985
                  lag_blocks: 5
                  waiting: false
                  max_lag_blocks: 30
      security: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.