Skip to main content
Metal’s facilitator verifies a seller’s x402 payments and settles them, paying the gas. The official x402 middleware makes every call below for you.

Endpoints

/verify and /settle take the x402 payment and the offer it answers, and answer 200 with the standard x402 result. A /settle answer also carries extra.settlement, with the payment’s id and first, which is true only for the request that claimed the payment: deliver on that one. For a clearing payment, transaction is empty and extra.clearing carries the receipt.

GET /settlements

GET /settlements?payTo=<address or clearing key>&since=<ms> lists the payments settled to it at or after since, oldest first, 500 to a page; pass the last row’s settledAt as the next since. The listing is public.

Limits

The limits on settlements count exact settlements that were sent and did not revert; a clearing payment counts only toward the per-IP limits. Anyone can pay any payTo, so other people’s payments to your address count toward its limits too. If your payTo reaches its daily limit, receive at a new address.

Refusal reasons

/verify returns the reason as invalidReason and /settle as errorReason; the middleware passes it to the payer in its 402. A second /settle for the same payment sends nothing and answers already_settled, with the first transaction for an exact payment. Anyone holding a payment can present it, and once sent it is public on chain, so the same payment can arrive in several requests; deliver only on the one whose extra.settlement.first is true.

Accept agent payments

Charge for a route in your own Express service.

x402 on Metal

The payment loop and the two ways to pay.