Skip to main content
x402 is an open protocol for internet-native payments that activates the HTTP 402 “Payment Required” status code. It enables AI agents and applications to make instant, permissionless micropayments using stablecoins.

Key Features

  • HTTP-Native: Built into existing HTTP requests with no additional communication required
  • Instant Settlement: Sub-second on Celo, compared to days with traditional payments
  • Zero Protocol Fees: Only pay nominal blockchain gas fees
  • Agent-First: Designed for autonomous AI agent transactions
  • Chain Agnostic: Supports 170+ EVM chains including Celo

Why x402?

Traditional payment systems don’t work for AI agents and micropayments:

How It Works

Step-by-step:
  1. Client requests resource - AI agent or app sends HTTP request to API
  2. Server returns 402 - If no payment attached, server responds with HTTP 402 Payment Required and payment details in headers
  3. Client signs payment - Client signs payment authorization using their wallet
  4. Client retries with payment - Request sent again with X-PAYMENT header
  5. Server verifies and settles - Payment is verified and settled on-chain
  6. Server delivers resource - Requested content returned with payment receipt

Get Started with the Celo Facilitator

Celo runs its own hosted x402 facilitator at x402.celo.org, built on the open-source x402-rs implementation. It is the recommended default for accepting x402 payments on Celo. It accepts USDC and USDT on Celo via the gasless EIP-3009 transferWithAuthorization scheme — the buyer signs an authorization off-chain, and the facilitator submits it on-chain and pays the gas itself. The facilitator never custodies funds: transferWithAuthorization moves tokens directly payer → payee inside the token contract.
Source: celo-org/x402-facilitator (private repo). The endpoints below are live at x402.celo.org.

Endpoints

Pointing a Resource Server at It

Any standard x402 middleware that accepts a custom facilitator URL can use the Celo facilitator. Example with x402-express:
USDT has no version() method on-chain — its EIP-712 domain resolves to name: "Tether USD", version: "1". Set those exactly in asset.eip712 or signature verification fails.

x402 on Celo

Celo is an ideal network for x402 due to:
  • Low fees: Gas costs under $0.001 per transaction
  • Fast finality: ~1 second block times
  • Stablecoin support: Native USDC and USDT for predictable pricing
  • Fee abstraction: Agents can pay gas in the same stablecoins used for x402 payments — no separate CELO balance needed. See Fee Abstraction for Agents

Supported Payment Tokens on Celo

The Celo facilitator settles USDC and USDT via EIP-3009 transferWithAuthorization:

Celo Configuration

Standard x402 middleware targets Celo by its CAIP-2 network identifier:

Use Cases

AI Agent API Access

An AI agent uses its own wallet to pay for API calls autonomously. The agent doesn’t need API keys or pre-registered accounts—it simply pays per request using the x402 protocol. Each call attaches an X-PAYMENT header signed by the agent’s wallet, enabling truly permissionless agent commerce without accounts or onboarding.

Pay-Per-Use AI Inference

Instead of charging a fixed price upfront, a server can price each request by actual usage: verify that the buyer’s authorization covers up to a maximum amount, run the inference, measure real token consumption, and settle only for what was used. This is ideal for AI inference, where cost varies with prompt length and output tokens. Support for usage-based or “up-to” pricing depends on the x402 middleware and facilitator you use.

Micropayments for Content

Publishers can monetize individual articles instead of requiring subscriptions. Each request is checked for a valid x402 payment—if missing, the server returns 402 Payment Required with pricing details; if present, the payment is settled and the content is delivered. This unlocks true pay-per-article pricing at amounts too small for card-based payments.

Alternative: thirdweb facilitator

thirdweb offers a hosted x402 facilitator and SDK supporting Celo and 170+ EVM chains. It provides React hooks (useFetchWithPayment), a wrapFetchWithPayment helper for non-React clients, and a settlePayment helper for servers, handling wallet connection, payment signing, and retries. See the thirdweb x402 docs and playground to get started.

Resources

  • ERC-8004 - Trust layer for AI agents
  • MPP - Machine Payments Protocol: charge USDC per request over HTTP
  • Celopedia - Celo ecosystem knowledge for coding assistants
  • Fee Abstraction - Pay gas with stablecoins on Celo
  • Attribution Tags - Credit on-chain activity back to your app