Skip to main content

What is an x402 facilitator

An x402 facilitator is a service that verifies and settles x402 payments on-chain, so the seller of an API does not have to run a wallet, hold gas, or write settlement code. It is the piece that turns a signed payment authorization into a confirmed transfer of funds.

If you just want to start taking payments, the hosted x402 facilitator on XDC AI is live and free to try. This page explains what the component actually does.

The problem it solves​

x402 is the "HTTP 402 Payment Required" standard for pay-per-call APIs. The flow looks like this:

  1. A buyer requests a paid resource.
  2. The server answers 402 with the price and payment details.
  3. The buyer signs a payment authorization and repeats the request.
  4. The server has to check that the signature is valid, then move the money on-chain, then serve the content.

Steps 4 is where the work lives. Checking a signature, broadcasting a transfer, paying the gas for it, and waiting for it to confirm is real blockchain plumbing. A facilitator does exactly that work behind two HTTP calls, so your API code never touches a chain.

What a facilitator does​

A facilitator exposes a small HTTP surface. The two calls that matter are:

  • verify - given a payment authorization and the price, confirm the signature is real and covers the amount. This is a read, and it is free.
  • settle - broadcast the transfer on-chain and report the transaction hash once it confirms.

On XDC AI, settlement uses EIP-3009 transferWithAuthorization on USDC, which is gasless for the buyer: the buyer signs, but the facilitator submits the transaction and pays the gas. The buyer never needs to hold native XDC.

buyer signs an EIP-3009 authorization
your server calls verify -> is this real?
your server calls settle -> move the money, pay the gas
your server polls until it confirms on-chain
your server returns the paid content

What it means for buyers​

Nothing. A buyer or an AI agent paying for a call needs no account with the facilitator, no API key, and no credits. They hold USDC on XDC and sign a payment. Everything about the facilitator is the seller side.

Using a facilitator vs running one​

You have three options, in order of how much you operate yourself:

  • Do not run one at all. Use the gateway, which wraps your existing API and handles 402, verification and settlement for you.
  • Call a hosted facilitator. Host your own API and its payment logic, and call the public x402 facilitator for verify and settle. You manage a seller API key and prepaid credits.
  • Run your own facilitator. Operate the whole payment layer, including the wallet that submits settlements and pays the gas. See Build a facilitator.

Get started​

Read the facilitator overview for the constants and the exact request shapes, then the seller guide to wire it into your server. When you are ready, open the dashboard at xdcai.tech/account/facilitator to mint a key.