Skip to main content
Every request to a gateway route goes through a two-step cycle: the gateway first challenges the agent for payment, then — once a valid signed payment is attached — verifies settlement on-chain and proxies the request to your upstream. The entire round-trip is transparent to the agent’s caller and typically completes in under a second. Understanding this flow helps you build agents that handle payment challenges gracefully and diagnose errors quickly.

Request lifecycle

Headers

The X-Payment-Requirements response tells the agent exactly what to sign. A typical requirements object looks like this:
maxAmountRequired is denominated in the token’s smallest unit (USDC uses 6 decimals, so 10000 = $0.01).

Network selection

The gateway routes your payment to the correct network based on your route’s configuration.
The public facilitator at https://x402.org/facilitator always targets Base Sepolia. To accept live USDC on Base mainnet, configure your route with "network": "eip155:8453" and use a production-mode facilitator.

Trying the demo route

You can inspect a real 402 response right now using curl. No account or API key required:
The response will look similar to this:

Nonce replay protection

The gateway tracks every payment nonce it has processed. Once a signed payment nonce has been used, any attempt to replay the same signed payload is rejected. This prevents double-spending on a single authorization.

Error codes

All error responses share the same shape:
Always capture requestId from error responses. It is the fastest way for the Meterlane support team to trace a specific request through the system.