What is the x402 protocol?

· By MoltPe Team

x402 is an HTTP protocol for per-request payments in stablecoins. A server returns 402 Payment Required with payment details in response headers. The client (often an AI agent) signs a USDC micropayment and retries the request with an X-Payment header. The server verifies the payment and returns the data. MoltPe implements x402 natively for both API monetization and agent consumption of paid APIs.

The short version

In more detail

HTTP 402 was reserved in the original HTTP/1.1 specification for “Payment Required” but sat unused for decades because there was no settlement rail fast or cheap enough to power it. Stablecoins changed that. USDC on Layer 2 networks like Base and Polygon PoS settles in under a second at fractions of a cent, which finally makes per-request payment economically viable. x402 is the open protocol that revives HTTP 402 for this purpose.

For API providers, x402 means you can charge per call with no sign-up, no API keys, and no invoicing — the payment IS the auth. A weather API, a vector database query, or an LLM inference can each be a standalone priced request. For AI agents, x402 means your agent can discover and consume paid APIs at runtime without a human provisioning credentials in advance; the agent’s spending policy decides what gets paid for.

MoltPe runs an x402 facilitator that handles signature verification, replay protection, and on-chain settlement so API developers only need to check one header. The same infrastructure lets MoltPe-hosted agents consume x402 endpoints from anywhere on the web.

Related questions

About MoltPe

MoltPe is AI-native payment infrastructure that gives AI agents isolated wallets with programmable spending policies for autonomous USDC stablecoin transactions. Live on Polygon PoS, Base, and Tempo.

Learn more about MoltPe