Prerequisites
- A resource server that returns
402 Payment Requiredon Celo. Set one up on the x402 page first. - A public HTTPS origin. Indexes probe your endpoint from the outside, and some probe it every hour.
- Node.js 20 or later and the v2 packages:
@x402/express,@x402/core,@x402/evm,@x402/extensions.
How it works
Discovery has two halves.- Self-description. The x402
bazaarextension lets your 402 response carry the shape of the endpoint: the HTTP method, an example input, a JSON schema for it, and an example output. Facilitators and crawlers that understand the extension catalog the endpoint from the 402 itself, so an agent can call it correctly the first time. - Registration. Each index decides what it lists. Some crawl an origin you submit, one lists only endpoints that settle through its own facilitator, and one reads on-chain agent identities.
Describe your endpoint in the 402
Register thebazaar extension on the resource server and declare the shape of each route. The block below runs against the Celo facilitator and answers an unpaid request with a 402 that carries the description.
GET /weather?city=Lagos returns 402 with an empty {} body. The payment requirements travel base64-encoded in the PAYMENT-REQUIRED response header. Decoded (abridged here), that header carries the price in accepts and the description in extensions.bazaar:
description for an agent that is deciding whether to call you: what the endpoint returns and when to use it, in under 500 characters. The HTTP method comes from the route key, so "GET /weather" declares a GET. For a POST route, use a key such as "POST /summarize", and pass bodyType: "json" and the example body as input.
Register with agent402.tools
One request lists your origin. The crawler probes the x402 surface hourly and ranks listings by health.List in Coinbase’s discovery index
Coinbase’s index adds an endpoint automatically after a paid call has settled through Coinbase’s facilitator. It removes resources that go 30 days without a settlement, and endpoints that stop returning402. That facilitator settles on Base, Base Sepolia, Polygon, Arbitrum, World and Solana, so an offer that only settles on Celo is not listed. To appear there:
- Follow Coinbase’s seller guide to add an offer on one of those networks and settle it through Coinbase’s facilitator.
- Keep at least one paid call a month on the offer that settles there.
Register on x402scan
Submit the endpoint URL at x402scan.com/resources/register. It is added when the URL returns a valid x402 challenge. Registration accepts resources on Base and Solana, so an endpoint that only offers Celo is not accepted there.Register an ERC-8004 identity
Agents that look up sellers on 8004scan read the on-chain registry. Register an identity on Celo, list your endpoints underservices in the registration file, and set x402Support to true. The ERC-8004 page covers registration and the registry addresses.
Ask for a listing in the Buy catalog
Buy’s catalog is curated. Open a listing request with the buy-skill issue form with your origin, a one-paragraph description, the price, and the networks and tokens you accept.Troubleshooting
Resources
Related
- x402: Agent Payments - Set up the resource server this page assumes
- ERC-8004: Agent Trust Protocol - Identity and reputation for the seller behind the endpoint
- Attribution Tags - Credit on-chain activity back to your app
- MPP - Machine Payments Protocol: charge USDC per request over HTTP