Learn / How to accept x402 payments

How to accept x402 payments

Part of the Agentic Finance Index knowledge base · Updated 2026-07-20

If you sell an API, dataset, tool, or content, x402 lets you charge AI agents per request — no accounts, no API keys, no checkout. This is the practical path from zero to your first machine-paid request.

What you need before you start

  1. A receiving wallet address that can hold USDC on Base (or Solana). Any agent-capable or standard EVM wallet works — see our agent-wallet comparison if you're choosing one.
  2. A facilitator — the service that verifies an agent's payment before you release the response. Coinbase runs the canonical one via CDP; self-hosting is possible. (New to the term? Read what a facilitator does.)
  3. A price per request, expressed in atomic USDC units (6 decimals: 1000 = $0.001).

The server flow, in three steps

  1. Quote. When a request arrives without payment, respond with HTTP 402 and a JSON payment spec: scheme, network, asset, amount, your payTo address, and the resource URL.
  2. Verify. When the agent retries with an X-PAYMENT header, pass the payload to your facilitator. It confirms the payment is genuine and settled (or settles it).
  3. Serve. On a positive verification, return the resource with a receipt header. Total added latency is typically under two seconds.

Implementation options

Cloudflare (edge, minimal code)

If you're already on Workers, Cloudflare's Agents platform ships x402 support, and pay-per-crawl extends the same idea to bot access on regular pages — you set prices, Cloudflare handles the 402 exchange at the edge. (Our own sites run this pattern; try curl -i https://index.agiscorecard.com/agent to see a live 402 quote.)

Coinbase CDP SDK (most tooling)

CDP provides server middleware, the reference facilitator, and listing in Bazaar — the agent-facing directory of payable endpoints — which is how paying agents discover you. This is currently the most-traveled path.

Self-hosted (maximum control)

The x402 spec and facilitator interface are open (Linux Foundation governance since July 2026), so you can verify payments against the chain yourself. Sensible once volume justifies owning the verification layer.

How to price machine access

  • The network average payment is roughly $0.32; typical API calls clear between $0.001 and $0.05.
  • Price by marginal value per call (a fresh dataset row, a scored result), not by human subscription logic — agents buy exactly what they consume.
  • Keep a free human tier. Machine-metered and human-free can coexist on the same content (that's how this site works: free pages, paid /agent endpoint).

Frequently asked questions

Do I need to run blockchain infrastructure?

No. The facilitator verifies and settles; your server only quotes and checks the verification result.

How much should I charge per request?

Most x402 payments are sub-dollar. Start low ($0.001–$0.01), watch demand, and remember the money is in call volume, not unit price.

Will any agents actually pay?

~75 million x402 payments cleared in a recent 30-day window from ~69,000 active agents, and directories like Bazaar route agents to payable endpoints. Early, but real.

Building x402 into your product? →

Get listed in the Agentic Finance Index so builders and agents can find you.

Submit your project

Related: What is x402? · What is an x402 facilitator? · Machine-to-machine payments · Pay-per-crawl

© 2026 Agentic Finance Index. Original editorial; figures reflect public reporting as of 2026-07-20. Not investment advice.