x402 is an open, neutral payment standard for internet-native transactions built on the HTTP protocol. It repurposes the long-unused HTTP 402 "Payment Required"
This article may rely excessively on sources too closely associated with the subject, potentially preventing it from being verifiable and neutral. (April 2026) |
| Developed by | Coinbase |
|---|---|
| Introduced | 2025 |
| Website | x402 |

x402 is an open, neutral payment standard for internet-native transactions built on the HTTP protocol. It repurposes the long-unused HTTP 402 "Payment Required" status code to enable peer-to-peer payments directly within HTTP request-response cycles. Payments can be made in supported cryptocurrencies like USDC and through supported fiat money facilitators like payment cards.[1]
The HTTP 402 status code has existed since the early days of the World Wide Web, originally conceived as a mechanism for servers to charge clients per request. However, the status code remained largely unused for decades due to infrastructural limitations: payments were slow, expensive, and required accounts, sessions, and chargeback-heavy intermediaries.
x402 was developed by Coinbase to revisit this original concept with modern cryptographic primitives, including stablecoins, fast blockchain settlement, and programmable authorization. The protocol leverages EIP-3009 (permit-style authorization) to enable direct payment verification without external payment gateways.
x402 introduces a minimal extension to standard HTTP flows, enabling payment verification before resource access is granted. The protocol maintains full HTTP compatibility while introducing payment negotiation as an integral part of the request–response cycle.[2]
A client makes a standard HTTP request to a resource server. If the resource requires payment, the server responds with an HTTP 402 status code along with a JSON payload specifying:
The client generates a signed payment authorization using the EIP-3009 standard (transferWithAuthorization) via their cryptocurrency wallet. The client resubmits the HTTP request, attaching the signed payment payload in an HTTP header (typically X-PAYMENT or PAYMENT-SIGNATURE). A facilitator service (or the server itself) verifies the cryptographic signature and confirms that payment parameters match the initial quote.[3]
Once the facilitator validates the payment authorization off-chain, the signed transaction is submitted to the blockchain for settlement. After on-chain confirmation, the server returns the requested resource with an HTTP 200 status code and an X-PAYMENT-RESPONSE header containing the transaction hash for verification.
The x402 protocol facilitates instant, programmatic transactions for environments where traditional payment systems are inefficient. Enterprise platforms such as Amazon Web Services have demonstrated how financial institutions can integrate autonomous AI agents with x402 payments infrastructure, enabling agents to access premium APIs and data services with instant, on-chain settlement without account setup or intermediary involvement.[4] Primary applications include:
A simple Node.js example using x402 middleware:
app.use(
paymentMiddleware(
{
"GET /weather": {
accepts: [...], // As many networks / schemes as you want to support
description: "Weather data", // What your endpoint does
},
},
)
);
If a request arrives without payment, the server responds with HTTP 402. Upon receiving the 402, the client's wallet signs a payment authorization and resubmits the request.
x402 conforms to:
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.