Skip to content

x402 Protocol Overview

What is x402?

x402 is a payment protocol built on HTTP 402 (Payment Required). When a client requests a paid resource, the server responds with 402 and includes payment requirements in the X-Payment-Required header. The client constructs a payment proof, attaches it as the X-Payment header, and retries the request.

FluxA extends the x402 protocol to support three payment schemes — EVM (USDC on Base), Credits, and XRP — enabling AI agents to pay for APIs, MCP tools, and other resources programmatically.

Payment Schemes

SchemeNetworksCurrencyAmount UnitSignaturex402Version
EVMbase (mainnet), base-sepolia (testnet)USDC6 decimals (1000000 = 1 USDC)EIP-712 TransferWithAuthorization1, 2
Creditsfluxa-monetize-creditsFLUXA_MONETIZE_CREDITS2 decimals (100 = 1 Credit)EIP-712 CreditsMandateSpend1
XRPxrpl-mainnetXRPdrops (1000000 = 1 XRP)Signed XRPL Payment transaction1

All schemes use scheme: "exact".

x402Version — protocol versions

The EVM scheme accepts both protocol versions; new integrations should prefer 2.

  • x402Version: 1 — original payload. The network field uses the short chain name (e.g. "base").
  • x402Version: 2 — same payload structure with the network field upgraded to a CAIP-2 identifier (e.g. "eip155:8453" for Base mainnet, "eip155:84532" for Base Sepolia). All other fields are unchanged; existing 1 clients continue to work.

The Credits and XRP schemes currently use x402Version: 1 only.

How It Works

  1. Client sends a request to a paid resource
  2. Server responds with HTTP 402 and X-Payment-Required header containing accepted payment schemes
  3. Client selects a scheme, constructs a signed payment proof
  4. Client retries the request with the X-Payment header
  5. Server verifies and settles the payment, then delivers the resource

See Payment Flow for a detailed walkthrough.

Facilitators

Each scheme has a facilitator — a service that verifies payment proofs and executes settlement:

FacilitatorSchemesNetworksx402VersionSettlementBase URL
Base USDC FacilitatorEVM (USDC)base (mainnet), base-sepolia (testnet)1, 2On-chain transferWithAuthorization on Basehttps://facilitator.fluxapay.xyz/
Credits FacilitatorCreditsfluxa-monetize-credits1Off-chain balance debit with immutable ledgerhttps://walletapi.fluxapay-qa.xyz/api/facilitator
XRP FacilitatorXRPxrpl-mainnet1On-chain XRPL Payment transactionhttps://walletapi.fluxapay-qa.xyz/api/facilitator

The Base USDC Facilitator at facilitator.fluxapay.xyz is FluxA's production x402 settlement endpoint for USDC on Base. It is registered on x402scan and is currently the most active non-Coinbase x402 facilitator on Base by daily transaction count. It covers gas on the user's behalf and submits EIP-3009 transferWithAuthorization transactions, so funds settle directly user → user.

Credits and XRP share the same multi-asset facilitator service.

Next Steps

Released under the MIT License.