x402
Share post
In Brief
x402 is an open payment protocol built on the HTTP 402 "Payment Required" status code that lets websites and APIs charge crypto — typically stablecoins — per request, so humans and AI agents can pay for resources instantly.

What Is x402?
x402 is an open payment protocol built on HTTP status code 402, "Payment Required," which was reserved in the web's original design but never standardized. x402 puts it to work: a server responds to a request with payment terms, the client pays in crypto — typically stablecoins — and retries, receiving the resource moments later.
The protocol is aimed squarely at machine-to-machine commerce. AI agents, scripts, and apps can pay per request — per API call, per article, per inference — without accounts, API keys, subscriptions, or card checkouts, because the payment travels inside the HTTP exchange itself.
How an x402 Payment Works
A client requests a paid resource; the server replies with a 402 status and machine-readable payment terms — asset, amount, network, and address.
The client — a human's wallet or an AI agent — signs a payment authorization for the stated amount.
It retries the request with the signed payment attached in a header.
The server (or a facilitator service) verifies and settles the payment on-chain, then returns the resource.
Why x402 Matters
Micropayments become practical: charging tiny amounts per request was never viable with card fees.
Agent-native: autonomous agents can buy resources without a human filling out a checkout.
No account required: payment replaces registration — no API keys to issue, steal, or leak.
Stablecoin rails: pricing in dollar-pegged tokens keeps costs predictable for both sides.
x402 and Trust Wallet
Trust Wallet doesn't process x402 payments itself; it's the self-custody home where users hold the stablecoins and keys that protocols like x402 build on. If agent-driven payments become part of everyday crypto, the foundation stays the same: your keys, your authorization, your funds.