ExploreKnow Your AgentHow it worksDevelopersPricingSponsors Sign in
  1. Home
  2. Learn
  3. x402 explained

Guide

x402 explained: how AI agents pay for APIs, and how to know who's paying

How the x402 standard uses HTTP 402 and stablecoins for pay-per-request payments, and why you still need to know which agent is paying.

By Dewan Efaj Tahamid Rifat, founder of Neptuv ·

The short answer

x402 is an open payment standard that lets AI agents pay for APIs and content per request, using stablecoins. It revives the web's long-unused HTTP 402 "Payment Required" status: a server answers with its price, the agent pays and retries, and the server returns the data — no accounts, card forms or subscriptions. What x402 doesn't tell you is which agent is paying and whether you should trust it; that's what ERC-8004 identities and trust scores add.

Why AI agents need a new way to pay

Payments on the web were built for people: sign up, enter a card, agree to a subscription. An AI agent that needs one weather lookup, one research query or one image can't fill in a checkout form for every service it uses, and API keys mean every provider has to onboard every agent by hand.

Agents need to pay the way they call APIs — automatically, in tiny amounts, and only for what they use. Stablecoins on fast, cheap networks make sub-cent payments practical, and x402 gives them a standard shape over plain HTTP.

How x402 works

  1. The agent asks for a resource. A normal HTTP request, for example GET /api/report.
  2. The server replies 402. Instead of the data, it returns "Payment Required" with what it accepts: the amount, the token (often USDC), the network and where to pay.
  3. The agent pays. It signs a payment authorization with its wallet and sends the request again with that payment attached.
  4. The payment is checked and settled. The server — or a facilitator service it trusts — verifies the payment and settles it on-chain, straight to the seller's wallet.
  5. The server returns the data. The whole exchange can take a couple of seconds, with no account on either side.

Because it's just HTTP, any API can add x402 in front of existing endpoints, and any agent with a wallet can pay. Details and SDKs are on x402.org.

The missing piece: who is paying?

x402 answers "has this request been paid for?" It deliberately doesn't answer "who is this agent?" For a one-cent lookup, that may not matter. For anything bigger, it does:

  • Should a known scam agent be allowed to buy from you, even if it pays?
  • Should a brand-new agent get the same limits as one with months of good history?
  • When an agent pays you for a service, how do you know it's the agent it claims to be?

x402 + ERC-8004 + trust scores

These standards fit together:

  • x402 handles the payment.
  • ERC-8004 gives the agent a permanent on-chain identity, with public feedback and validation records.
  • A trust score turns that record into a decision: allow, limit or refuse.

With Neptuv, an agent signs its requests with the wallet registered for its ERC-8004 identity. Your server verifies the signature and applies your rules — a minimum score, required independent checks — before it even sends the 402. Scam agents never reach checkout, and trusted agents pay and get served in one smooth flow. You can browse agents that accept x402, ranked by trust.

Getting started

  • Selling to agents? Put x402 in front of your API, then add a Know Your Agent check so you know who's paying.
  • Building an agent? Register it on ERC-8004, sign your requests, and earn reviews and validations — a good score opens doors.
  • Just exploring? Look up any agent's trust score for free.

Check an agent now

Search any ERC-8004 agent and see its Neptuv Score with every reason, free.

Keep reading