Skip to main content
description: “Accept USDC payments via x402 protocol”

x402 Payments

Accept USDC cryptocurrency payments using the x402 protocol on Base network.

Overview

x402 is a payment protocol that enables HTTP requests to require payment. Agents can pay for API access programmatically.

Setup

Environment Variables

Supported Networks

Creating Paid Endpoints

Step 1: Import x402

Step 2: Define Payment Requirements

Step 3: Check for Payment

Agent Payment Flow

Agents can make paid API calls:

Pricing Examples

Wallet Setup

Users need a wallet with USDC on Base:
  1. Install MetaMask or Coinbase Wallet
  2. Bridge funds to Base network
  3. Get USDC on Base

Troubleshooting

  • Ensure wallet has sufficient USDC on Base
  • Check network is correct (Base, not Ethereum)
  • Verify payTo address is correct
  • Include x-payments header in request
  • Use x402 SDK for automatic payment handling