feeBps. There are two endpoints and no authentication. The schemas below mirror the @caplane/shared wire types exactly; the machine-readable spec is published at /api/openapi.json.
Two conventions hold across the API:
- uint256 fields cross the wire as decimal strings (
amount,nonce,validAfter,validBefore,feeCollected), to avoid JavaScript number precision loss.feeBpsandchainIdare small integers. - The order is transmitted exactly as signed. The relayer recomputes
orderHashfrom the order itself and never mutates a field; any change breaks the binding and the token rejects it.
POST /broker
Transmit a consumer-signed order. The relayer recomputesorderHash, enforces its fee floor, checks the window, pre-simulates, then broadcasts. Returns a RelaySuccess (200) or a typed RelayFailure.
Request body (RelayRequest)
| Field | Type | Description |
|---|---|---|
order | OrderJson | The order (see below). |
signature | { v: integer, r: hex, s: hex } | The consumer’s EIP-3009 signature. |
validAfter | string | Decimal unix seconds; the authorization lower bound. |
validBefore | string | Decimal unix seconds; the authorization upper bound. |
chainId | integer | Routes to the registry entry (421614 or 46630). |
orderHash | string (optional) | Lets the relayer fail fast with ORDERHASH_MISMATCH. |
OrderJson fields: consumer, adapter, params, payToken, payee (addresses/hex); amount, nonce (decimal strings); feeBps (integer). It mirrors the Order struct.
Responses
| Status | Body | When |
|---|---|---|
| 200 | RelaySuccess | Settled: payment and grant landed atomically. |
| 400 | RelayFailure | MALFORMED_ORDER or ORDERHASH_MISMATCH. |
| 402 | RelayFailure | FEE_BELOW_FLOOR. |
| 422 | RelayFailure | WOULD_REVERT or AUTH_EXPIRED. |
| 502 | RelayFailure | UPSTREAM_RPC. |
| 503 | RelayFailure | INSUFFICIENT_RELAYER_GAS. |
| 429 | edge | RATE_LIMITED or SERVER_BUSY (only on the hardened edge). |
RelaySuccess carries ok: true, txHash, orderHash, brokered ({ consumer, adapter, amount, orderHash }), receipt (the decoded adapter receipt), and feeCollected. RelayFailure carries ok: false, code, and message, and never any key or signature material. The codes are catalogued in errors and reverts.
0xb89a56…abd845. The receipt decodes to slot id 1; feeCollected is 0.050000 TUSDC.
GET /info
The relayer’s public policy. No secrets; this is how a consumer shops relayers.Response (RelayerInfo)
| Field | Type | Description |
|---|---|---|
feeFloorBps | integer | The minimum feeBps this relayer accepts. |
supportedChainIds | integer[] | The chains this relayer serves. |
relayer | address | The relayer’s gas address (address only, never the key). |
The hosted relayer is not yet live. The relayer is permissionless: run your own (
pnpm --filter @caplane/relayer start) and point CAPLANE_RELAYER_URL at it, then GET /info and POST /broker are exercisable locally. The published OpenAPI spec describes both endpoints for any client. The relayer address shown above is a placeholder; a running relayer prints its real gas address on boot.See also
- Run a relayer: the pipeline behind these endpoints and one-command operation.
- Errors and reverts: every code these responses can carry.
- The SDK:
submitbuilds and sends aRelayRequest.

