The open, neutral standard that finally activated HTTP 402 “Payment Required” — turning the internet’s oldest reserved status code into a native payment layer for AI agents and applications.
x402 is an open payment protocol built directly on the HTTP protocol. It reuses the long-dormant HTTP status code 402 Payment Required so that any web resource (API, content, tool) can demand payment before serving a response.
Clients — especially autonomous AI agents — respond by attaching a cryptographically signed payment (usually stablecoins such as USDC) in a standard HTTP header. No accounts, no sessions, no API keys, no human checkout forms.
PAYMENT-REQUIRED, PAYMENT-SIGNATURE, PAYMENT-RESPONSE).The flow is deliberately minimal and HTTP-native. No extra round-trips beyond a normal request-response cycle when the client already knows the price.
HTTP 402 + PAYMENT-REQUIRED header (Base64-encoded payment options: scheme, network, amount, asset, payTo address…).PAYMENT-SIGNATURE header.HTTP 200 + PAYMENT-RESPONSE header containing settlement proof.PAYMENT-REQUIRED (server → client), PAYMENT-SIGNATURE (client → server), PAYMENT-RESPONSE (server → client).