The HTTP 402 payment standard, on XDC

What is x402?

x402 lets an API charge for a single request, using the HTTP 402 Payment Required status code. No account, no key, no subscription. On XDC the payment is USDC and settles gaslessly, so agents and apps can pay per call down to a fraction of a cent.

How it works

A paid call, step by step

The whole exchange happens in the same request the buyer already made. No redirect, no checkout page.

  1. 1

    The buyer requests a resource

    An app or an AI agent calls a paid endpoint the normal way, with no payment attached yet.

  2. 2

    The server answers 402

    It returns HTTP 402 with the price, the token, and the address to pay - the payment requirements.

  3. 3

    The buyer signs and retries

    The buyer signs an EIP-3009 authorization for the amount and repeats the same request with it attached.

  4. 4

    The server verifies and settles

    It confirms the signature, settles the USDC transfer on-chain, then returns the paid content.

The buyer signs but never submits a transaction, so they never need XDC for gas. Settlement is submitted and paid for by a facilitator using EIP-3009.

Build with x402

Everything you need on XDC AI

Whether you are paying for calls or getting paid for them, these are the pieces.

Marketplace

Browse x402 services on XDC and see their per-call prices. This is where an agent discovers what it can pay for.

Open the marketplace

Agent wallet

A non-custodial wallet your AI agent spends from, capped on-chain. Gasless USDC, no seed phrase for the agent.

Give an agent a wallet

Gateway

Turn an existing API into a paid x402 endpoint with no code changes. It handles 402, verification, and settlement.

List your service

Facilitator

Host the API yourself and call the public x402 facilitator to verify and settle payments from your own server.

Settle it yourself

Connect an agent

Add x402 payments to Claude or any LLM through the MCP connector, a CLI, or a paste-in skill.

Connect an agent
FAQ

Common questions about x402

What is x402?

x402 is a standard for paying for a web resource per request, built on the HTTP 402 Payment Required status code. A server answers a request with 402 and a price, the caller signs a payment and repeats the request, and the server serves the content once the payment is confirmed. It lets APIs charge per call with no accounts, keys, or subscriptions.

Is x402 safe to use?

You approve every payment by signing for a specific amount, so nothing is charged without your signature and there is no stored card or standing authorization that could be misused later. On XDC the payment is USDC and settles transparently on-chain, so you can see exactly what moved.

How much does it cost?

You pay the price the service lists for a call, in USDC, often a fraction of a cent. There is no subscription, no minimum, and no gas fee to you as the payer. You only ever pay for the calls you actually make.

Do I need crypto experience to use it?

No. As a buyer or an AI agent you hold some USDC and sign a payment, and you never manage gas or run anything. As a seller you can wrap an existing API and write no blockchain code. XDC AI handles the on-chain part for both sides.

How is x402 different from an API key or subscription?

An API key ties usage to an account you registered and get billed for later. x402 charges at the moment of the call, with no account and no monthly bill, which is what makes it a good fit for autonomous agents that discover and pay for services on their own.

How do I get started?

Browse the marketplace to see what you can pay for, set up a wallet, and connect your agent or app. From there it pays per call automatically whenever a service answers 402.