x402

About x402

x402 is an open standard for internet-native payments. It reuses the familiar HTTP 402 Payment Required idea: instead of inventing a new checkout page for every API, servers advertise what they accept, clients pay with standard wallets, and facilitators can verify and settle without each merchant running chain infrastructure.

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

  1. 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.

  2. Pay and retry

    The client signs an authorization for one of the quoted options (scheme, network, asset, amount) and retries with that proof attached.

  3. 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

  1. 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.

  2. 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.

  3. 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.

  4. 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.
  5. 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.
  6. 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.