Popular starting points

Loading the full XDC search index…

Developer hubBuild · PageFrom your first contract to your next application.Wallets & custodyDiscover · PageUnderstand the network. Find your place in it.Get XDCDiscover · PageUnderstand the network. Find your place in it.Run a nodeBuild · PageFrom your first contract to your next application.Ecosystem applicationsDiscover · PageUnderstand the network. Find your place in it.Post-quantum initiativeResearch · PageA clear view of the engineering ahead.
↑ ↓ to selectEnter to openEsc to close
Browse all resources →

x402 on XDC

Payments built into the request

An open standard for paying for APIs, data and digital services over HTTP—with USDC settlement on XDC.

On this page

Explore the expanded XDC guide to agent payments, application design and integration choices. AI & agents on XDC →

x402 uses HTTP’s 402 Payment Required status to let a service request payment and a compatible client respond with a signed payment authorization. It was incubated by Coinbase and is developed as an open, blockchain-agnostic payment protocol.

For developers, it enables per-request pricing. For agents, it provides a machine-readable way to discover a price, authorize a payment and retrieve a resource.

One request. A clear payment flow.

  1. 01 · Request a resource

    A client or agent calls an API endpoint using HTTP.

  2. 02 · Receive payment requirements

    An unpaid request receives HTTP 402 with the service’s price and accepted payment details.

  3. 03 · Authorize and retry

    The client checks its authorization and spending policy, signs the supported payment and retries the request.

  4. 04 · Verify, settle and respond

    The service and its payment infrastructure verify the payment, settle it and return the requested resource according to the integration’s flow.

Why build payments on XDC?

USDC settlement

Price APIs in a stablecoin and settle payments on XDC.

Sponsored gas

EIP-3009-based integrations let a relayer submit payment authorizations and pay the XDC gas. The user pays the quoted USDC amount.

EVM tooling

Build with familiar smart contracts, middleware and developer libraries.

Verifiable records

On-chain transaction references let applications record and inspect settlement.

Infrastructure for agent commerce

Agents can buy data, access compute, use services and transact with other agents. Metered access makes it possible to charge for a single useful request rather than requiring every interaction to begin with a subscription.

Data & APIs

Weather, market information, RPC access and specialist datasets.

Compute & inference

Metered processing, model inference and digital tools.

Content access

Per-request access to articles, research and other digital resources.

Agent marketplaces

Machine-readable service discovery and payment.

Enterprise information

Paid trade-finance, RWA and other institutional data endpoints.

Built on familiar web infrastructure

The ecosystem includes resource servers, clients, SDKs and payment facilitators. x402 composes with HTTP applications, MCP servers and agent frameworks; supported networks and payment schemes depend on the chosen implementation.

For API and service providers

  1. 01 · Choose an integration

    Use compatible middleware or a facilitator for your framework and network. The original guide identifies Express, Next.js and FastAPI as examples.

  2. 02 · Price your route

    Set the accepted USDC amount and payout details for each protected endpoint.

  3. 03 · Return HTTP 402

    Provide machine-readable payment requirements when payment is missing.

  4. 04 · Serve paid requests

    Verify and settle the supported payment before completing the paid resource flow. Publish your service details for discovery.

For agent and client developers

  1. 01 · Prepare a compatible wallet

    Fund the correct XDC wallet with USDC and review its custody model.

  2. 02 · Set a spending policy

    Authorize a budget, recipients and service calls appropriate for your application. Enable available wallet controls before automation.

  3. 03 · Discover an endpoint

    Use the service’s documentation or a marketplace to select a supported x402 resource.

  4. 04 · Pay and inspect the result

    Let the compatible client handle the signed retry, then inspect the response and settlement record.

A small paid endpoint

A weather API could price GET /weather at 0.001 USDC per request. A client receives the payment requirement, authorizes the exact amount and retries. This is an illustration of the flow; use current SDK documentation for package names, middleware syntax and XDC configuration.

Explore XDC AI

XDC AI provides a marketplace, agent tooling and payment infrastructure built around x402. Chat and terminal integrations connect service discovery, USDC payments and transaction records. Wallet setup and limits depend on the selected provider flow.

x402, explained

Is x402 an XDC-only protocol?

No. x402 is an open, blockchain-agnostic protocol. This guide focuses on integrations that settle supported USDC payments on XDC.

Does gasless mean there is no network fee?

No. In the described relayed flow, a relayer pays the XDC transaction fee. The paying client does not need to hold native XDC for that payment.

Does every wallet have an on-chain spending limit?

No. Limits depend on the wallet and configuration. XDC AI’s wallet documentation distinguishes a basic account flow from an opt-in smart-wallet cap.

Do I need a subscription to use x402?

The protocol supports payment per request. A particular service may still have its own pricing, access conditions or commercial terms.

Can I use it with a normal web API?

Yes. The integration uses HTTP request and response flows, with compatible payment-aware server and client components.

Build with support

CodeRun AI

AI development tools and technical support for building on XDC.

SOURCE & CONTEXT

Content carried forward from XinFin’s public website and linked primary sources. Historical material is identified where applicable.

Source record Editorial methodology