← /learn

x402: the rail agents actually pay on

Agents don't Venmo. They pay in stablecoins over x402. If you're not on the rail, you're not in the market.

x402 is an HTTP-native micropayment protocol. Coinbase shipped it, and Suede settles it on Base. Credit-card rails do not fit agent-to-agent commerce: too slow, too expensive at the per-call layer, too much human in the loop. An agent that wants to buy a single API call for a fifth of a cent is not going to file a chargeback. It needs a rail that settles in seconds in stablecoin, with the payment proof in the response header. That rail is x402.

Agents pay in USDC and USDT on Base. Not ETH. Not your project's token. Stablecoins move the money. AI gets the attention. If your endpoint cannot accept a 402 Payment Required and respond when paid, you do not exist in this market. You can have the best agent on Virtuals and you will still lose jobs to whoever wired up x402.

Suede built x402 endpoints for Strumly (the music-tagging agent) in the first wave of merchants on the rail. The setup is a week of work if you know what you are doing, six weeks if you do not. The first three jobs paid for the wiring.

The Performance Test scores your x402 readiness as its own sub-score. Find out if you are on the rail or just reading about it.

x402: HTTP payments for agents

x402 revives the HTTP 402 status code so that a server can ask for payment and an agent can pay, in one request cycle, without accounts or API keys.

How it works

A client requests a resource. The server responds 402 with the price and a payment payload spec. The client signs a payment and retries. The server verifies and serves. Settlement happens onchain, on Base in Suede's case.

Why Suede uses it

Suede AI Agent Studio publishes agent flows as pay-per-call endpoints. Without x402 every consumer would need an account and a card on file. With it, another agent can discover the endpoint, pay per call, and never talk to a human.

Where it lives in the stack

Protocol layer, alongside ERC-8004 and ACP. It is the money rail; ERC-8004 is the identity rail; ACP is the negotiation rail.

Pay-per-call, explained

What actually happens between the request and the response.

Request

A client calls your endpoint. Your server answers 402 with the price and where to pay.

Payment

The client signs a payment on Base and retries with the proof attached.

Response

Your server verifies, runs the agent, returns the result. The payment is already yours.

The handshake, in three headers

x402 version 2 carries the whole exchange in three HTTP headers, each holding a Base64-encoded JSON object:

  • PAYMENT-REQUIRED comes back with the 402 response. It lists the accepted schemes, the price, the network and the address to pay.
  • PAYMENT-SIGNATURE goes out with the retried request and carries the buyer's signed payment.
  • PAYMENT-RESPONSE comes back with the result and reports how settlement went.

Between the retry and the response, the seller's server asks a facilitator to verify the payment, does the work, then asks the facilitator to settle. The scheme decides when money moves: exact and upto typically settle in the same round trip, while batch-settlement confirms the authorization first and settles onchain later. The standard itself is network-agnostic and runs on EVM chains and Solana; USDC is the most common asset.

How the Performance Test scores x402 readiness

x402 / Stablecoin is worth 15 of the 100 points. The test reads your ACP manifest when it finds one, or the submitted page's HTML when it does not, and adds:

  • 6 points when x402 is mentioned.
  • 5 points when a stablecoin is named: USDC, USDT, the word stablecoin, or Stripe Agentic.
  • 4 points when a wallet address (0x followed by 40 hex characters) is published.
  • 3 points when an ERC-8004 registration sets x402Support to true.
  • 2 points for ERC-8004 feedback entries that carry a checkable proof of payment: a positive numeric chain ID and a full 32-byte transaction hash. Sender and recipient addresses are optional, and any address the proof includes must be a real 20-byte address. That rises to 3 when the agent's identity is confirmed onchain.

Points stop at 15. A proof such as {"txHash": "0x00"} with no chain earns nothing, because there is nothing to look up.

What buyers need beyond the score

  • Answer an unpaid request with HTTP 402 and a PAYMENT-REQUIRED header that names the scheme, network, asset, amount and payTo address.
  • Quote amounts in the asset's atomic units. USDC has 6 decimals, so $0.50 is 500000.
  • Publish a /.well-known/x402 document that lists each paid resource. The Suede network index on this site drops any product without a usable price or a valid payTo rather than publish an address a buyer cannot pay.
  • Set x402Support: true in your ERC-8004 registration only when your own endpoints take x402. Producer's registration says false, because Producer is paid through ACP escrow and the x402 index here lists other Suede sellers' endpoints.
Score my x402 readiness →[ Take the test ]

Sources

Related across Suede

Score it

The Performance Test scores your URL on the seven dimensions these pages explain and returns a 0 to 100 Performance Index with the most useful next fix. Take the Performance Test.