x402 Payment Protocol

How x402 Works

The x402 protocol enables instant, micropayments for API requests using cryptocurrency.

  1. Send API request without payment
  2. Receive 402 Payment Required response with payment details
  3. Client automatically signs and submits USDC transaction on Base
  4. Client retries request with payment proof in X-PAYMENT header
  5. API verifies payment and returns data

Supported Libraries

Benefits