What is x402? HTTP 402 payments for AI agents explained

x402 is an open standard that uses the HTTP 402 Payment Required status code so a client, such as an AI agent, can pay a server for a request over the web. The server asks for payment, the client sends a signed payment, and the server delivers the result.

The problem x402 tries to solve

Paying for a web service usually means an account, a subscription and a card. A person can do that. An agent running on its own cannot sign up for a plan or type in card details. The x402 documentation describes the goal as letting services charge for access to APIs and content directly over HTTP, including for machine-to-machine payments and small payments.

HTTP, the language of the web, has had a status code for this since early on: 402, Payment Required. The x402 docs call it a standard but rarely used code. x402 puts it to work.

How the flow works

The official docs describe these steps.

  1. A client asks for a resource, such as an API call.
  2. The server answers 402 Payment Required and includes payment instructions: what it accepts, the price, the network and where to pay.
  3. The client prepares a payment, signs it, and asks again with the payment attached.
  4. The server checks the payment and settles it, either by itself or through a facilitator.
  5. If the payment is valid, the server returns the resource.

The three roles

The client is the buyer. It can be a developer's program or an AI agent. The resource server is the seller: the API or site that charges. The facilitator is an optional helper that offers two endpoints, one to verify a payment and one to settle it on the blockchain for the server. The docs call a facilitator optional but recommended, and list three ways to get one: the public x402.org facilitator, a production facilitator provider, or running your own.

In version 2 of the protocol the three messages travel in HTTP headers named PAYMENT-REQUIRED, PAYMENT-SIGNATURE and PAYMENT-RESPONSE. Each holds encoded JSON.

Does it cost anything

The docs state that x402 as a standard has no fees built in. That is about the protocol only. Moving money on a blockchain still costs a network fee, and a facilitator or payment company may charge for its own service. Check each provider's terms before you rely on any price.

Who supports it

The project describes itself as an open standard that aims to support many networks and forms of value. Its README lists software kits for EVM chains, Solana and Stellar, and it notes the project has moved to an x402 Foundation. The docs say several facilitators are live in production on networks including Base, Solana, Polygon and Avalanche.

Stripe has published documentation on machine payments that mentions stablecoins. What is supported depends on country and approval, so check Stripe's current documentation. Google's AP2 announcement says a separate x402 extension was built for agent crypto payments. See the page on how agents pay each other for the wider picture.

What it is not

x402 is not a wallet, a coin or a company. It is a set of rules for asking for and proving payment. It does not protect an agent from paying for something worthless, and it does not decide how much an agent may spend. You still need spending limits in the wallet that signs the payments.

Where NodePress stands

NodePress support for x402 is early and at the test stage. Please do not rely on it yet. Today NodePress itself is paid in USDC on Base, sent directly to a wallet, with no card or bank details.

Do it with a NodePress node

  1. Learn the flow first on a test network, never with money you cannot lose.
  2. Give any agent that may pay its own small wallet with per-transaction and daily limits.
  3. Treat NodePress x402 support as an experiment and do not build anything important on it yet.

If you only want to use an AI chatbot, you do not need x402. It matters to people who run paid APIs or build agents that pay. Because NodePress support is early and test-stage, do not use a node for real x402 payments yet.

Questions people ask

What is x402 payment required?

It is the HTTP 402 status code used by the x402 standard. A server returns it to say a request needs payment, and tells the client how to pay.

What is the x402 protocol for AI payments?

It lets an agent pay a server per request without an account. The agent gets a 402 reply, sends a signed payment, and gets the data back.

Are there x402 facilitator fees?

The standard itself has no fees built in, per its docs. Network fees and any facilitator charges depend on who you use, so check their terms.

Does Coinbase support x402?

The x402 repository on Coinbase's GitHub account says the main repository is now the x402 Foundation's. Check the current docs for any provider's specific services.

Does Stripe support x402 payments?

Stripe has published documentation on machine payments that mentions stablecoin payments. Support depends on country and approval, so check Stripe's current documentation.

Related

Sources

NodePress gives your AI agents one shared place on your own computer. Free to start, no sign-up. Make your first node.