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
A facilitator is a service that checks a buyer’s signed payment and submits it on-chain on the seller’s behalf, so the seller does not run a node or need CELO for gas. Step-by-step:- Client requests resource - AI agent or app sends HTTP request to API
- Server returns 402 - If no payment attached, server responds with
HTTP 402 Payment Requiredand payment details in headers - Client signs payment - Client signs payment authorization using their wallet
- Client retries with payment - Request sent again with a
PAYMENT-SIGNATUREheader - Server verifies and settles - Payment is verified and settled on-chain
- Server delivers resource - Requested content returned with payment receipt
Get Started with the Celo Facilitator
Celo runs its own hosted x402 facilitator, built on the open-sourcex402-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.
Two hosts are involved, and they are not interchangeable:
- Dashboard — x402.celo.org serves the web dashboard (a single-page app). Do not point a resource server at it.
- Payment API —
https://api.x402.celo.org(mainnet) is the facilitator endpoint your resource server talks to for/verify,/settle, and/supported. Celo Sepolia is athttps://api.x402.sepolia.celo.org.
The endpoints below are live at
https://api.x402.celo.org (mainnet) and https://api.x402.sepolia.celo.org (Celo Sepolia).Endpoints
Base URLs:- Mainnet —
https://api.x402.celo.org - Celo Sepolia —
https://api.x402.sepolia.celo.org
Only
/settle requires an API key — so /verify and /supported succeed and an integration looks healthy right up until its first settlement, which fails with 401 if no key is attached. See Getting an API Key.
Pointing a Resource Server at It
The x402 v2 middleware wires a resource server to the Celo facilitator. Install the scoped packages:@x402/express → @x402/hono; the body is identical.
Getting an API Key
/settle is metered, so accepting real payments requires an API key. To create one:
- Open the dashboard and connect your wallet.
- Click Create API key and sign the message. This is an off-chain signature — no gas, no transaction.
- The key is shown once. Copy it and set it as
X402_API_KEYin your server environment.
GET https://api.x402.celo.org/api/config returns the current model under pricing.
If a call to /settle fails, the status code tells you why:
Check that it works
Start the server and request the paid route without a payment. This step needs no API key:402 Payment Required with an empty {} body. The payment requirements are in the base64-encoded PAYMENT-REQUIRED header. To read them:
10000 base units of USDC, which is $0.01 because USDC has 6 decimals. A 402 with that price means the middleware is wired to the route.
To see a paid response you need a buyer that signs the authorization and retries the request. The simplest way is the x402 template of Celo Composer, which ships its own seller and buyer wired to Celo Sepolia (see x402 paid API). Run the seller with pnpm api:dev and the buyer with pnpm api:buy. The buyer pays the template’s own route and prints the response and the settlement transaction, so expect that output rather than the {"data":"paid content"} from the server above. The buyer wallet needs test USDC on Celo Sepolia and no CELO.
To charge for the server on this page instead, switch it to Celo Sepolia. Change the network, asset and payTo values to the Celo Sepolia ones under Celo Configuration, and change the facilitator url to https://api.x402.sepolia.celo.org. The mainnet facilitator does not list Celo Sepolia, so the server fails on startup if the URL stays as it is. Settlement needs the key from the previous section. A paid request then returns 200 with {"data":"paid content"} and the payment settles on Celo Sepolia for the price above. At that point you have charged an agent $0.01 in test USDC.
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-3009transferWithAuthorization:
Celo Configuration
Each route lists what it accepts by CAIP-2 network identifier. Use the flatprice object with an explicit asset address on both networks:
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 aPAYMENT-SIGNATURE 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 returns402 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.
Trust and other facilitators
The Celo facilitator athttps://api.x402.celo.org is run by Celo and built on x402-rs.
A facilitator you do not know deserves the same checks as any other service that submits transactions for you:
- Confirm who operates it.
- Before your server accepts a payment, check the asset, amount and
payToaddress against what you priced. Do not rely on the facilitator’s response alone. - Confirm the settlement transaction on-chain before you deliver anything valuable. A facilitator cannot redirect funds, because the payer signs
toandvalue, but a settlement claim should still be checked. - Test against Celo Sepolia (
https://api.x402.sepolia.celo.orgfor the Celo facilitator) before sending mainnet funds. To create a test account and fund it, see Give your agent a wallet and test funds.
Resources
Related
- ERC-8004 - Trust layer for AI agents
- x402: Get your endpoint discovered - Make the endpoint findable by agents and indexes
- 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 (facilitator-side tagging of x402 settlements is not live yet)