Add x402 payment support to your API in seconds. Easily accept x402 payments and sell one-time API access—all with a single configuration and no changes to your existing codebase.
x402proxy is an early-stage JavaScript project in the AI payments / x402 ecosystem, focused on api, blockchain, payments, proxy. It currently has 11 GitHub stars and 2 forks, and sits alongside related tools like x402scan, x402-payments-mcp, x402, x402, agenti, machinepal.

Monetize your API in Minutes • Automatically accept x402 Payments • Simple Config, Zero Code Changes Required
A plug-and-play proxy that automatically takes care of all the x402 payment logic for you.
Set up in minutes in front of any existing API and start selling one-time access to your endpoints. A simple JSON config file lets you customize which endpoints to monetize, how much they cost, and where you get paid.
That's it! No complex dependencies or setup required.
🚀 Get up and running in under 60 seconds
📥 Step 1: Download Starter Config
curl -o custom-config.json https://raw.githubusercontent.com/zachalam/x402proxy/refs/heads/main/custom-config.json🐳 Step 2: Run with Docker
docker run -p 8080:8080 \ -v $(pwd)/custom-config.json:/app/config.json:ro \ ghcr.io/zachalam/x402proxy:latest✅ That's it! Your instance of x402proxy is now running and accepting x402 payments. 🎉
| Feature | Description |
|---|---|
| 🌐 Multi-chain support | Works with Ethereum, Base, Solana, and more |
| 💰 Direct payments | Paywall any URL; payment straight to your wallet |
| 🏗️ Flexible pricing | Set one-time global or per-route pricing |
| 🔌 Plug & play | Works with any standard x402 facilitator |
Simple architecture, powerful results. Clients make requests, payments are verified via x402 facilitator, and your API gets protected automatically.
The application loads configuration strictly from /app/config.json inside the container.
⚠️ Important: If this file is not mounted, the container will exit with an error.
| Field | Description |
|---|---|
facilitatorUrl |
The X402 facilitator URL |
network |
Blockchain network (e.g., "base-sepolia") |
paymentAddress |
Receiving wallet address |
defaultPrice |
Default payment price for all routes |
protectedEndpoints |
Map of protected endpoints with prices and forwarding URLs |
Here's a complete example configuration file (custom-config.json):
{
"facilitatorUrl": "https://x402.org/facilitator",
"network": "base-sepolia",
"paymentAddress": "0x5629562956295629562956295629562956295629",
"defaultPrice": "$0.05",
"protectedEndpoints": {
"GET /cat": {
"forwardTo": "https://api.thecatapi.com/v1/images/search"
},
"GET /dog": {
"price": "$0.10",
"forwardTo": "https://api.thedogapi.com/v1/images/search"
},
"GET /fact": {
"price": "$0.15",
"forwardTo": "https://catfact.ninja/fact"
},
"GET /joke": {
"price": "$0.20",
"forwardTo": "https://official-joke-api.appspot.com/random_joke"
}
}
}
💡 Tip: For large
protectedEndpointsconfigurations, file mounting is recommended (no size limits).
The application is automatically built and pushed to GitHub Container Registry (ghcr.io) on every push to the main branch.
Each push creates a new version tagged with an auto-incremented version number and also tagged as latest.
# Pull the latest image
docker pull ghcr.io/zachalam/x402proxy:latest
# Run with default port (config must be mounted to /app/config.json)
docker run -p 8080:8080 \
-v $(pwd)/custom-config.json:/app/config.json:ro \
ghcr.io/zachalam/x402proxy:latest
# Run with custom external port
docker run -p 4020:8080 -e PORT=8080 \
-v $(pwd)/custom-config.json:/app/config.json:ro \
ghcr.io/zachalam/x402proxy:latest
Perfect for quick local testing and development:
# Install dependencies
npm install
# Run in development mode with nodemon (hot reload)
npm run dev
# Run in production mode
npm start
📍 The application will be available at
http://localhost:3000
Use Docker for a consistent development environment with hot reload:
# Build and run the development container with hot reload
docker-compose up
# Run in detached mode (background)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the container
docker-compose down
📍 The application will be available at
http://localhost:3000
⚠️ Note: You must mount your config to
/app/config.json. If the file is missing, the container will exit with an error.
| Environment | Details |
|---|---|
Development (docker-compose.yml) |
Uses nodemon for hot reload, mounts source code as volume |
Production (Dockerfile) |
Optimized image with only production dependencies, runs as non-root user |
This project is licensed under the ISC License.
Built with ❤️ for the x402 ecosystem
x402 Ecosystem Explorer
Give AI agents a wallet — x402 payment tools over Model Context Protocol.
💸 Simplify payments with x402, an open protocol for fast, fee-free digital dollar transactions. Experience seamless integration and instant settlements.
💸 Enable seamless, low-cost digital dollar payments with x402—zero fees, instant settlement, and no high minimums for all users.
Give any AI agent a crypto wallet. Agents deserve access to money. Pay x402 APIs, receive USDC, check balances — autonomously. Works with Claude, LangChain, AutoGen, CrewAI, and any MCP client. EVM + Solana.
The Cloud-Native MCP and X402 Gateway to Run and Monetize your AI Agents and Services, as well as optimize your AI costs
An open SDK for agentic payments. Let AI agents make payments, hold funds, and move money across chains with policy enforcement and human approval built in.
Golang SDK for A2A Protocol
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
Rust SDK for the Machine Payments Protocol
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Opinionated React Native crypto x AI chat app boilerplate with embedded wallet support, conversational AI, and dynamic UI component injection