How x402 payments work

A paid call answers 402 with its price; the caller signs an EIP-3009 transfer authorization and repeats the call; Roundlot settles it after the tool succeeds. The caller needs no gas.

The round trip#

  1. Call. The agent calls a paid tool without paying.
  2. 402. Roundlot answers with an x402 v2 PaymentRequired object: scheme exact, network eip155:1952, asset USD₮0, the amount in atomic units and payTo.
  3. Sign. The agent signs an EIP-3009 TransferWithAuthorization for that amount. Nothing is sent on-chain yet, and the agent needs no gas.
  4. Retry. The agent repeats the same call with the signed payload.
  5. Verify. Roundlot has the facilitator check the signature, the amount, the recipient and the time window, and simulate the transfer.
  6. Run. The tool runs. If it refuses (bad input, a size the pool can't fill, a paused token), the authorization is never submitted and nothing is charged.
  7. Settle. The facilitator submits transferWithAuthorization on X Layer testnet and pays the gas.
  8. Receipt. The result comes back with the settlement receipt: success, transaction, network and payer.

What gets signed#

The EIP-712 domain is USD₮0's: name USD₮0 (with the ₮ character, U+20AE), version 1, chain id 1952, contract 0x9e29b3aada05bf2d2c827af80bd28dc0b9b4fb0c. The message authorizes a transfer from the payer to Roundlot's payTo of exactly the quoted amount, valid for a short window (maxTimeoutSeconds is 120), with a random nonce the token contract refuses to reuse.

ToolPriceAmount in the challenge (6 decimals)
session$0.0055000
quote$0.0110000
plan_trade$0.0220000

Where the payment travels#

  • REST: PAYMENT-REQUIRED header on the 402, PAYMENT-SIGNATURE header on the retry, PAYMENT-RESPONSE header on the result. See x402 over REST.
  • MCP: either inside the tool result and _meta, or as HTTP 402 headers, depending on the client. See x402 over MCP.
No accounts.

Any wallet that can sign EIP-712 typed data can pay. There are no API keys, sign-ups or subscriptions.

Last updated 25 Sep 2026

Roundlot

Pay-per-call market data and trade plans for tokenized equities on X Layer. Built for OKX Dev Day 2026.

Payments settle on X Layer testnet. Data and trade plans are X Layer mainnet. Not investment advice.