URL shortener
proxy402 is a growing Go project in the AI payments / x402 ecosystem, focused on ai, ai-agents, coinbase, llm. It currently has 26 GitHub stars and 7 forks, and sits alongside related tools like x402, ClawRouter, nano-currency-mcp-server.
Proxy402 lets you monetize APIs by requiring x402 payments on Base before accessing your endpoints.
Test Proxy402 instantly with our pre-configured client:
# Clone the repo
git clone https://github.com/Fewsats/proxy402.git
cd proxy402/client
# Copy sample env file
cp .env.example .env
# Add your wallet keys to the .env file
# You can generate these keys with cast (google how to install foundry, cast is part of the suite)
# Then run the following command to get a test address
cast w new
# You will need Base Sepolia ETH & USDC. Get them from these faucets:
- [Base Sepolia ETH](https://portal.cdp.coinbase.com/products/faucet)
- [Base Sepolia USDC](https://faucet.circle.com/)
# Install dependencies
npm install
# Run client against a test endpoint (returns Bitcoin whitepaper)
npm run client https://proxy402.com/wUUbqudYsM
# Clone the repo (if you haven't already)
git clone https://github.com/Fewsats/proxy402.git
cd proxy402
# Configure environment
cp .env.example .env
# Edit .env file with your details
# Start the server with Docker Compose
docker compose up
Important .env variables:
X402_PAYMENT_ADDRESS: Your Base wallet address for receiving payments (works for Base Sepolia & Base Mainnet)GOOGLE_CLIENT_ID & GOOGLE_CLIENT_SECRET: For auth (obtain from Google Cloud Console)http://localhost:8080 and log inhttp://localhost:8080/YOUR_SHORT_CODEProxy402 adds a Proxy402-Secret header to forwarded requests:
// Node.js example
app.get('/api/data', (req, res) => {
if (req.headers['proxy402-secret'] !== 'YOUR_SECRET_FROM_USER_SETTINGS') {
return res.status(403).json({ error: 'Unauthorized' });
}
res.json({ data: 'Your protected data' });
});
The client uses your private key to make payments on Base:
# client/.env
PRIVATE_KEY="YOUR_CLIENT_WALLET_PRIVATE_KEY" # Never commit this to Git
# Create route via API
curl -X POST http://localhost:8080/links/shrink \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"target_url": "https://raw.githubusercontent.com/ibz/bitcoin-whitepaper-markdown/refs/heads/master/bitcoin-whitepaper.md",
"method": "GET",
"price": "0.0001",
"is_test": true
}'
For more details visit x402.org
If using file uploads with Cloudflare R2, configure CORS to allow direct browser uploads:
You can configure it via Cloudflare dashboard:
http://localhost:3009 and https://your-domain.com*)Join our Discord for support and discussions.
💸 Enable seamless, low-cost digital dollar payments with x402—zero fees, instant settlement, and no high minimums for all users.
The agent-native LLM router for OpenClaw. 41+ models, <1ms routing, USDC payments on Base & Solana via x402.
Send Nano currency from AI agents/LLMs