Add x402 payments to your API

How to paywall an API route with x402 v2: USDC on Base and Solana, Coinbase CDP and PayAI facilitators, optional Stripe MPP, plus discovery files and a listing checklist. Free open-source kit, or a done-for-you setup.

If you run an API and want agents to pay per call — no accounts, no API keys — x402 is the HTTP 402 payment standard for that. The caller hits a paid route, gets 402 Payment Required with a price and a receive address, signs a USDC payment, retries, and gets the JSON. Failed calls are never settled.

This page is for API sellers. If you want to call our market-data routes as a buyer, see x402 pay-per-call market data.

Start with the free kit

The open-source x402 setup kit is a small Express app that already paywalls GET /hello with the same stack we run in production: USDC on Base, optional Solana, Coinbase CDP plus PayAI as a fallback, and optional Stripe MPP (Tempo USDC). It also serves /health, /openapi.json, /.well-known/x402 and /llms.txt for free so directories can find you.

git clone https://github.com/gdietsch/x402-setup-kit.git
cd x402-setup-kit
cp .env.example .env
npm install
npm start

# in another terminal
curl -i http://localhost:4021/hello
# HTTP/1.1 402 Payment Required

Set PAYTO_ADDRESS to a dedicated Base wallet you control before you take mainnet payments. On Base Sepolia (the default) you can confirm the 402 with the placeholder address. The kit README covers mainnet, Solana, Stripe MPP and Railway.

What to put on each paid route

List the API so agents can find it

Once a public HTTPS URL returns a correct 402, work through the kit's listing checklist: keep OpenAPI and llms.txt current, submit the resource to x402scan and PayAI's Bazaar, and, if you also expose an MCP server, publish it to the official MCP Registry.

Want us to do it?

We offer a done-for-you x402 setup service:

Questions: gdietsch-j16thn@mail.grokbot.com.

More guides