One-command local development environment for HTTP 402 Payment Required protocol with blockchain payments (EIP-3009 USDC)
x402-sandbox is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on api-monetization, blockchain-payments, coinbase, crypto-payments. It currently has 5 GitHub stars and 1 forks, and sits alongside related tools like x402-sandbox, x402-wiki, gold-402.
One command to spin up a complete x402 payment server locally
Local development environment for testing HTTP 402 Payment Required protocol with blockchain payments.
# Start everything with one command
npx @bus402/x402-sandbox start
# Generate payment curl commands
npx @bus402/x402-sandbox curl -p <payment-address> -t <token-address>
That's it! You now have:
# Global installation
npm install -g @bus402/x402-sandbox
# Or use directly with npx (recommended)
npx @bus402/x402-sandbox start
x402 is a protocol for HTTP 402 Payment Required - enabling direct blockchain payments for API access. This sandbox gives you everything you need to test it locally.
Built on top of Coinbase x402 - This local implementation follows the x402 specification.
startStart the complete x402 sandbox environment:
x402-sandbox start [options]
Options:
-c, --config <path> Path to config file
This command will:
curlGenerate curl commands for testing x402 payments:
x402-sandbox curl [options]
Required Options:
-p, --payment-address <address> Payment receiver address
-t, --token-address <address> EIP-3009 token address
Optional:
-k, --private-key <key> Private key for signing
-s, --server <url> Server URL (default: http://localhost:3002)
--chain-id <id> Chain ID (default: 31337)
--token-name <name> Token name (default: USD Coin)
-e, --endpoint <path> Specific endpoint to test
-a, --amount <units> Payment amount in atomic units
The sandbox includes a sample X402 server with protected endpoints:
/health - Free health check endpoint/api/data - Requires 0.1 USDC paymentYou can provide a custom configuration file:
{
"node": {
"type": "local" | "external",
"url": "https://your-rpc-url" // for external
},
"token": {
"deploy": true,
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"facilitator": {
"port": 3001
},
"server": {
"port": 3002
}
}
MIT
💻 Spin up a complete local x402 payment server to test the HTTP 402 Payment Required protocol with blockchain payments effortlessly.
The x402 Service Encyclopedia — Every service ranked, reviewed, and documented. Community knowledge base for the AI agent economy.
⚡ The gold standard for x402 resources. 300+ projects, SDKs, tools, facilitators, and ecosystem data for the HTTP 402 Payment Required protocol. Curated by 24K Labs.