Skip to main content
The x402 HTTP flow is the simplest way to interact with Key0. Plan discovery uses GET /discover, and the POST /x402/access endpoint handles challenge and settlement:
  1. DiscoveryGET /discover returns all available plans (HTTP 200). POST /x402/access without planId returns HTTP 400.
  2. ChallengeplanId present, no payment-signature header, creates a PENDING record.
  3. Settlement (subscription)planId + payment-signature, settles on-chain, returns an AccessGrant (JWT).
  4. Settlement (per-request standalone)planId + resource + payment-signature, settles on-chain, proxies to the backend, returns a ResourceResponse (API data, no token).
For a full sequence diagram of the Discovery → Challenge → Settlement flow, see How It Works.

Four Cases

Use GET /discover to browse all available plans. No PENDING record is created — this is a pure pricing query.Note: POST /x402/access without planId returns HTTP 400 with a pointer to this endpoint.

Request

Response

The discovery response contains one entry per plan configured in SellerConfig.plans, plus any route metadata when per-request routes are enabled.
For the complete HTTP headers reference, see API Reference → Overview.

EIP-3009 Authorization

The payment-signature header carries a signed EIP-3009 transferWithAuthorization. This means the client signs an off-chain authorization that permits a specific USDC transfer, but never sends a transaction directly and never pays gas. The server (or a facilitator like Coinbase CDP) executes the transferWithAuthorization call on-chain, paying the gas fees. The USDC moves from the client’s wallet to the seller’s wallet in a single atomic transaction.

Decoded payment-signature Structure

Key fields:
  • payload.signature — the EIP-3009 signature authorizing the USDC transfer.
  • payload.authorization — the transfer parameters: sender, recipient, amount (in USDC base units, 6 decimals), validity window, and a random nonce.
  • accepted — echoes the PaymentRequirements from the 402 response, so the server can verify the client accepted the correct terms.

Next Steps

Paying for Access

Step-by-step client guide: discover plans, sign EIP-3009, and use the access token.

A2A Flow

The JSON-RPC based agent-to-agent payment flow for native A2A clients.

Settlement Strategies

Facilitator vs. gas wallet settlement and how EIP-3009 is executed on-chain.

State Machine

The full PENDING / PAID / DELIVERED / EXPIRED / REFUNDED lifecycle.