Why it exists
Agents and apps increasingly call paid APIs, data feeds, and tools on demand. Subscriptions and API keys do not map cleanly to per-call usage, especially for autonomous software. x402 gives both sides a shared wire format: requirements in the 402 response, proof in the follow-up request, settlement rules defined by payment schemes.
Three roles
Every integration involves the same cast. Names vary by transport, but the responsibilities stay stable.
- Resource server — sells access (HTTP route, MCP tool, etc.) and publishes payment requirements.
- Client — wallet, agent, or app that selects an offer and signs payment.
- Facilitator — optional but common service that verifies signatures and submits chain transactions on behalf of merchants.
Layers to learn next
The protocol splits cleanly so you can study one slice at a time. Types and facilitator APIs are in the core spec; how bytes move on the wire is in transport specs; how value moves on chain is in payment schemes; optional capabilities sit in extensions.
Typical HTTP flow
Request without payment
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
Pay and retry
The client signs an authorization for one of the quoted options (scheme, network, asset, amount) and retries with that proof attached.
Verify, serve, settle
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
Highlighting Request
Request
Wallet, agent, or app that selects an offer and signs payment.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
Sells access and publishes payment requirements.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
Verifies signatures and submits chain transactions on behalf of merchants.
402
Wallet, agent, or app that selects an offer and signs payment.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
Sells access and publishes payment requirements.
A client calls a protected API or tool. If no valid payment is attached, the server answers with payment required and a machine-readable quote.
Verifies signatures and submits chain transactions on behalf of merchants.
Pay and retry
Wallet, agent, or app that selects an offer and signs payment.
The client signs an authorization for one of the quoted options (scheme, network, asset, amount) and retries with that proof attached.
The client signs an authorization for one of the quoted options (scheme, network, asset, amount) and retries with that proof attached.
The client signs an authorization for one of the quoted options (scheme, network, asset, amount) and retries with that proof attached.
Sells access and publishes payment requirements.
The client signs an authorization for one of the quoted options (scheme, network, asset, amount) and retries with that proof attached.
Verifies signatures and submits chain transactions on behalf of merchants.
Verify
Wallet, agent, or app that selects an offer and signs payment.
Sells access and publishes payment requirements.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
Verifies signatures and submits chain transactions on behalf of merchants.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
Settle
Wallet, agent, or app that selects an offer and signs payment.
Sells access and publishes payment requirements.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
Verifies signatures and submits chain transactions on behalf of merchants.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
Response
Wallet, agent, or app that selects an offer and signs payment.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
Sells access and publishes payment requirements.
The server (often via a facilitator) verifies the authorization, returns the resource, and settles on chain when the scheme calls for it.
Verifies signatures and submits chain transactions on behalf of merchants.