Learn / Sellers

How to accept x402 payments on your API

Accepting x402 comes down to one thing: answer unpaid requests with a correct 402, and let a facilitator handle the rest.

1. Return a correct 402

Send a PAYMENT-REQUIRED header with scheme, network, asset, amount, payTo and timeout, and name the facilitator at the root and in accepts[].extra.facilitator. Check it with our free endpoint report. Field details are in the 402 response.

2. Verify, then work, then settle

On a paid retry, call the facilitator's /verify. If it passes, run the handler. Settle once you have a real response, so a crash never charges a buyer. Return the receipt in PAYMENT-RESPONSE.

3. Put the payment check first

Return 402 before validating the request body. An agent probing your price should not be told its input is wrong before it has been told what the call costs.

4. Get found

Agents find paid endpoints through discovery indexes and directories. List on AgentPayStore's directory, where every listing gets a public probe-pass grade, and see x402 discovery.

Common questions

What is the minimum I can charge with x402?

On our facilitator, $0.001 USDC per call. Gas on Base is low enough that one-cent prices are practical.

Do I need to hold crypto to accept x402?

You need a payTo address that can receive USDC. The facilitator pays settlement gas.

How do I test my x402 endpoint?

Run it through our endpoint report or the probe-pass grader, and use /facilitator/simulate for a free dry run of a payment.

Keep reading

The x402 402 response, field by fieldHow agents discover x402 endpointsWhat does an x402 facilitator cost?All x402 guides
See what our facilitator supports
LearnDocsSettlement policyEndpoint report