402 Payment Required status code so that agents, apps, and services can pay each other for API access in a single request, with no accounts, invoices, or checkout flows.
On Celo, MPP lets any service charge USDC per request. The buyer pays no gas — settlement is handled on-chain by a hosted facilitator.
How it works
A request with no payment gets a402 carrying an MPP Challenge. The buyer signs a Credential and retries; the server settles the payment on Celo and returns a Receipt with the on-chain transaction.
USDC moves buyer → seller directly inside the token contract. The facilitator
submits the transaction and pays the gas; it never custodies funds.
Prerequisites
Settlement runs through a hosted facilitator that charges a small credit per transaction. Get an API key (a human does this once):- Open x402.celo.org and connect an EVM wallet.
- Click Create API key and sign the message (no gas, no transaction).
- Copy the key (shown once) — it looks like
x402_.... - Set it as
X402_API_KEYin your project.
Build with MPP
Install themppx SDK.
Seller — charge for your API
Configure MPP with one payment method — a one-time EVM charge on Celo — and settle through the Celo facilitator. Passing the known asset (assets.celoSepolia.USDC) lets mppx infer the chain id, decimals, and EIP-712
domain for you.
Buyer — pay automatically
Themppx client patches fetch to answer MPP challenges automatically. The
buyer needs a wallet funded with USDC and no native gas.
On the buyer side you must supply the token
decimals and its EIP-712
authorization ({ name, version }) — the client builds the payment
credential locally and does not read these from the server’s challenge. For
Celo USDC the domain is name: "USDC", version: "2".Example project
A complete, runnable seller + buyer you can clone and run in minutes — verified end-to-end on Celo testnet and mainnet:celo-org/mpp-celo-example
Minimal MPP example on Celo — a paid API and a client that pays it.
Supported assets on Celo
Both are 6-decimal and support gasless EIP-3009 transfers.
Resources
- MPP protocol: mpp.dev
mppxSDK: npmjs.com/package/mppx- Facilitator dashboard (API key + credits): x402.celo.org
- Example repo: celo-org/mpp-celo-example