XPayLabs is the first self-hosted gateway to support the x402 protocol for AI agent micropayments. Enable pay-per-call USDC billing for LLM APIs, AI agents, and any HTTP-based service — no API key management required. This is a capability no hosted competitor (BitPay, Coinbase Commerce, NowPayments) offers.
Quick Start
Deploy your payment gateway and create your first collection in minutes
Authentication
Generate merchant tokens and sign your requests securely
API Reference
Explore every endpoint, parameter, and response field
Guides
Step-by-step walkthroughs for collection and payout flows
Supported Blockchains
XPayLabs natively supports the following blockchain networks:| Chain | Type | Stablecoins |
|---|---|---|
| TRON | TRC20 | USDT, USDC |
| Ethereum | ERC20 | USDT, USDC, DAI |
| BNB Chain | BEP20 | USDT, USDC, BUSD |
| Polygon | ERC20 | USDT, USDC, DAI |
| Arbitrum | ERC20 | USDT, USDC |
| Optimism | ERC20 | USDT, USDC |
| Base | ERC20 | USDT, USDC |
| Avalanche C-Chain | ERC20 | USDT, USDC |
| SUI | Native | USDC |
Architecture
XPayLabs runs as 11 Docker containers orchestrated via Docker Compose. A single Nginx gateway serves as the public entry point, routing requests to backend services and frontend UIs. 11 microservices: 1 gateway, 2 data stores, 3 blockchain scanners, 1 SUI RPC proxy, 2 backend APIs, 2 frontend UIs.How does XPayLabs process payments?
Deploy the gateway
Run
docker compose up -d on your server. All services start together — Java backends (xpay-user, xpay-merchant, xpay-eth, xpay-tron, xpay-sui), blockchain scanners, webhook dispatcher, and the checkout UI.Generate API credentials
Configure your merchant token in the gateway dashboard. This token is used to sign every API request with HMAC-SHA256.
Create a collection
Send a
POST /v1/order/createCollection request with amount, symbol, and chain. XPayLabs returns a unique deposit address and checkout URL.Key Concepts
| Concept | Description |
|---|---|
| Collection | A request for payment that generates a unique deposit address |
| Payout | A funds transfer from your gateway wallet to an external address |
| Settlement | Automatic sweep of received funds from hot wallets to your cold storage |
| Webhook | An HTTP callback triggered by order or collection status changes |
| Scanner | A blockchain indexer that monitors incoming transactions in real-time |

