ReinkeyDocsConsole

Facilitator API

The facilitator is a plain HTTP service. The live, always-current reference is its OpenAPI document: openapi.json. Agents can start from llms.txt. This page is a map.

Amounts are decimal strings in base units. Errors use the shape described in Reason codes.

x402 facilitator

GET /supportedSchemes and networks this facilitator handles.
POST /verifyVerify a payment. For channel, a valid voucher is accepted: the channel's highest accepted cumulative advances. Returns { isValid, receipt } or { isValid: false, invalidReason }.
POST /settleQueue an accepted voucher for settlement.
JSON
{
  "paymentPayload": { "x402Version": 2, "accepted": { "scheme": "channel" }, "payload": { "channelId": "7", "cumulative": "145000", "signature": "…" } },
  "paymentRequirements": { "scheme": "channel", "payTo": "G…", "amount": "5000", "unit": "request", "resource": "https://…" }
}

Channels

GET /channelsKnown channels, newest first.
GET /channels/:idDeposit, claimed, last accepted, remaining, expiry.
POST /channels/:id/voucherNext voucher for a running stream (streamId, cumulative, signature).
POST /channels/:id/claimSettle now. Callable by anyone; pays only the channel's payee.

Streams (external sellers)

The facilitator holds stream sessions so a seller can wait for the next voucher where vouchers are verified. @reinkey/meter's rk.stream() wraps these.

POST /streamsOpen a session after the first slice was verified: { channelId, payTo, resource, unit, sliceCost, initialCharge }{ streamId, requiredCumulative, voucherUrl }. At most 4 open sessions per channel.
POST /streams/:id/waitLong-poll for the next voucher (timeoutMs ≤ 30000). Returns { kind: "paid", receipt, requiredCumulative }, or kind = timeout / exhausted / frozen / aborted.
DELETE /streams/:idEnd the session: { reason, units }{ charged, vouchers }; emits stream.ended. Idle sessions are closed after 90 s.

Accounts and audit

GET /accounts/:addressPolicy, today's spend, frozen flag, balances, open channels.
GET /accounts/:address/ledgerThe account's events, newest first, cursor-paginated.
GET /eventsServer-sent events: the last 200 events, then live. Filter with ?account= or ?channelId=.
GET /statsTotals: vouchers, on-chain transactions, volume, median verification latency.
POST /v1/reportReport an on-chain transaction; verified against the chain before it is published.

Seller finance (Meter)

Derived from the audit ledger, so the report and the ledger can't disagree. Three numbers are kept apart: earned (accepted vouchers), settled (claimed on-chain), receivable (the difference).

GET /sellers/:payTo/revenueTotals (earned, settled, receivable, payments, settlements, payments per settlement, buyers), revenue by resource, a time series (?bucket=hour|day, ?days= 1–365), receivables aging per channel, and the settlement list.
GET /sellers/:payTo/settlements.csvAccounting export: one row per on-chain settlement (time, tx, channel, payer, amount, payments covered, explorer link).

Float (credit pool)

Read-only; nothing here submits a transaction. See Float.

GET /floatPool summary (size, share price, utilization), known credit lines with health, investor positions, share-price history.
GET /float/lines/:accountOne account's line: debt, value, healthBps, liquidatable.
GET /float/positions/:addressAn investor's shares and their USDC value.

Discovery

GET /discovery/resourcesx402 Bazaar catalog. Every resource that has received at least one verified payment through this facilitator, with its 402 terms (accepts) and extensions.bazaar input/output metadata. Query: payTo, limit, offset. Response: { x402Version, items[], pagination }. There is no registration endpoint: a verified payment is the listing.
GET /openapi.jsonOpenAPI 3 document.
GET /llms.txtPlain-text guide for language models.
POST /mcpModel Context Protocol endpoint. Tools include reinkey_list_resources (the catalog), reinkey_price_list, reinkey_get_channel, reinkey_get_account, reinkey_stats, reinkey_supported.

Events

Each event has id, type, source and ts. Types: channel.opened, channel.topped_up, voucher.accepted, voucher.rejected, channel.claimed, channel.closed, payment.exact, chain.rejected, stream.started, stream.ended, dex.swapped, account.frozen.

Reinkey runs on Stellar testnet. The contracts are unaudited. Don't send mainnet funds.