What Is x402? HTTP 402 Payments for AI Agents

Cover: What Is x402? HTTP 402 Payments for AI Agents

Short answer: x402 is an open standard that lets a website charge for a web request using the old HTTP 402 “Payment Required” status code. The server states a price, the client pays, then retries with proof and gets the content. No account is needed first.

Five-step diagram of the x402 flow: request, 402 response, payment, retry with proof, content delivered

Picture a developer who runs a small data API. An AI agent from somewhere else starts calling it all day. The agent has no account, no card on file and no human to email. Each call costs real server time, and the traffic keeps growing.

The stakes are simple. Block the agent and you lose a possible customer. Allow it and you pay for free usage. A signup form and an API key do not help, because the agent cannot fill in a form or enter a card number.

The turn comes when the developer reads about x402. Instead of blocking or giving the data away, the server can answer with a price. The agent reads it, pays, and asks again. The sign-up step simply disappears from the exchange.

That is the whole idea, and the rest of this post explains how it works. That’s a composite, not a real client.

What is x402 in plain words?

x402 is described in its GitHub README as “an open standard for internet native payments.” It is built on HTTP, the same protocol your browser already uses. It is a set of rules, not a coin.

The idea is that a payment request lives inside the web request itself. A server can say “this costs this much,” and a client can answer with payment. Both sides use ordinary web traffic.

That matters for AI agents. An agent works through requests, not through checkout pages. A payment method built on requests fits how it already behaves.

What does HTTP 402 Payment Required actually mean?

HTTP status codes tell a client what happened. 200 means success. 404 means not found. 402 means payment is required.

Here is the catch. MDN calls 402 a nonstandard status code reserved for future use. It was meant for digital cash and micropayments, but no standard convention exists. Different systems use it in different ways.

So 402 has been sitting unused for decades. x402 fills the gap. It defines what the 402 response should contain and how the client should reply.

How does the x402 payment flow work?

The flow has six steps. This is the version in our own explainer, and it matches the general pattern in the GitHub README.

  1. The agent requests a page or API.
  2. The server replies with 402, stating the cost and how to pay.
  3. The agent pays the required amount.
  4. The agent retries the request with proof of payment.
  5. The server verifies the proof.
  6. The server delivers the resource.

The README gives more detail. The server puts its payment terms in a header named PAYMENT-REQUIRED. The client sends its payload back in a header named PAYMENT-SIGNATURE. The final response can carry a PAYMENT-RESPONSE header with settlement details.

Header names have changed over time, so check the current specification before you build. Do not copy names from older articles.

What is a facilitator?

The README defines a facilitator as a server that helps verify and execute payments for one or many networks. A seller can check payments itself or send them to a facilitator. The facilitator submits the payment and reports the result.

This is a real design choice. If you use a third-party facilitator, you rely on it. Read its terms before you depend on it.

Why do AI agents need x402?

Most paid web services assume a human. A person creates an account, adds a card, and clicks buy. An autonomous agent cannot do that on its own.

x402 lets the agent handle the whole exchange in code. It also suits small payments, such as a single API call, where a subscription would be a poor fit. It does not require a login for each site.

This also connects to how agents read the web. If you are curious how AI tools already see your business, see how to check if ChatGPT recommends your business. Reading is one half. Paying is the other.

What does x402 not tell you?

Many explainers skip the hard parts. I read several top results for this topic, and the same gaps kept appearing.

  • Refunds and disputes. Crypto payments are final. If a payment goes through and the server fails to deliver, you need your own logic.
  • Spending limits. An agent that can pay can also overspend. Caps and oversight are your job.
  • Facilitator risk. Sellers may rely on a third party to verify and settle payments.
  • Pricing. Pricing a single request is a new skill. There is no standard price list.
  • Compliance. Tax and regulation still apply to you, in your jurisdiction.

Some pages also quote large transaction counts. I could not verify those figures independently, so I do not repeat them here.

How should a site owner start charging agents?

Go back to the developer in the opening story. The fix is not a bigger firewall. It is a clear price and a safe way to test it.

Our explainer suggests a simple path. Decide a clear price for each request, and start with one price per kind of resource. Add rate limits and logs. Test on a testnet before you touch anything else.

A testnet uses test tokens with no real value. That lets you break things safely. It is the right place to learn how the 402 exchange behaves with your own endpoints.

What is Agent Pay by PayZiip?

Agent Pay by PayZiip, built with AIplusAPI, is being built to let websites and APIs charge AI agents using x402. I am working on it at both companies.

It is on testnet. It is not for sale. Coming soon means we are building toward it, nothing more. I have no release date to share, and I am not naming prices, chains or features until they exist.

If you run a site or API and want to hear when there is news, join the waitlist on the Agent Pay page. You can also browse our other PayZiip products.

I wrote a plain-language explainer covering the flow and the safeguards above. You can download the Agent Pay x402 explainer. Comment X402 on the matching post and I will point you to it.

Frequently asked questions

Is x402 a cryptocurrency?

No. x402 is an open standard, not a coin or a blockchain. There is no x402 token to buy. It describes how a server asks for payment and how a client answers, inside a normal web request.

Does x402 replace API keys?

It can remove the need for one in simple cases. The agent pays per request and sends proof, so no account sign-up is needed first. Sites with other needs may still keep keys or logins.

Is HTTP 402 a real status code?

Yes, but it was reserved and never given a standard meaning. MDN calls it nonstandard and reserved for future use. x402 gives it a concrete job: tell the client what to pay.

Can I use Agent Pay by PayZiip today?

No. Agent Pay is on testnet and is not for sale. Coming soon means we are building toward it. You can join the waitlist to hear when there is news.

What should a site owner do before charging AI agents?

Decide a clear price for each request and start simple, with one price per kind of resource. Add rate limits and logs, and test on a testnet before anything else.

If you want a simple way to charge AI agents without building the plumbing yourself, join the Agent Pay waitlist. It is testnet only for now, and mainnet launch is pending.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *