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

SchemeNetworkCurrencyAmount UnitSignature
EVMbaseUSDC6 decimals (1000000 = 1 USDC)EIP-712 TransferWithAuthorization
Creditsfluxa-monetize-creditsFLUXA_MONETIZE_CREDITS2 decimals (100 = 1 Credit)EIP-712 CreditsMandateSpend
XRPxrpl-mainnetXRPdrops (1000000 = 1 XRP)Signed XRPL Payment transaction

All schemes use x402Version: 1 and scheme: "exact".

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:

FacilitatorSchemesSettlementBase URL
EVM FacilitatorEVM (USDC)On-chain transferWithAuthorization on Basehttps://facilitator.xechoai.xyz/
Credits FacilitatorCreditsOff-chain balance debit with immutable ledgerhttps://walletapi.fluxapay-qa.xyz/api/facilitator
XRP FacilitatorXRPOn-chain XRPL Payment transactionhttps://walletapi.fluxapay-qa.xyz/api/facilitator

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

Next Steps

Released under the MIT License.