Deploy an x402 proxy on your existing RPC node. AI agents pay per request in USDC — no API keys, no accounts, no friction.
x402 is an open standard where your HTTP endpoint returns a 402 Payment Required response with USDC payment details. AI agents and apps pay per-request using USDC on Base — no API keys needed on either side.
You earn $0.0001 per request (configurable). That's $100 per million requests, settled directly to your EVM wallet.
node --version to check. Install: curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt install nodejs
rpc.yournode.com. Use Certbot/Let's Encrypt (free). nginx must be installed.
Create a dedicated directory and install the x402 packages:
# Create directory and initialize mkdir -p /opt/x402-proxy cd /opt/x402-proxy npm init -y # Install x402 packages (local EVM facilitator — no CDP needed) npm install @x402/node @x402/evm viem # Verify install ls node_modules/@x402/
@x402/evm/exact/facilitator which calls transferWithAuthorization on USDC directly. No third-party CDP API keys required, and no signature-rejection issues.
The facilitator needs a private key to sign settlement transactions on Base. This wallet does NOT need to hold USDC — it just pays gas for settlement. Use a dedicated wallet, not your main wallet.
# Store your private key in a secure env file # Replace with your actual private key (0x-prefixed) cat > /opt/x402-proxy/.env <<'EOF' FACILITATOR_PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE RECIPIENT_ADDRESS=0xYOUR_EVM_WALLET_ADDRESS UPSTREAM_RPC=http://localhost:26657 X402_PORT=3000 X402_PRICE=0.0001 EOF # Lock down permissions — only root can read this chmod 600 /opt/x402-proxy/.env
FACILITATOR_PRIVATE_KEY: signs settlement txs, needs ETH on Base for gas (~0.01 ETH).RECIPIENT_ADDRESS: receives the USDC payments. Can be any address (cold wallet, multisig, etc.).
Create the main server file. This proxies incoming requests, requires x402 payment, and settles on Base:
import { createServer } from '@x402/node'; import { facilitator } from '@x402/evm/exact/facilitator'; import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { base } from 'viem/chains'; import 'dotenv/config'; const account = privateKeyToAccount(process.env.FACILITATOR_PRIVATE_KEY); const walletClient = createWalletClient({ account, chain: base, transport: http('https://mainnet.base.org'), }); const myFacilitator = facilitator(walletClient); const server = createServer({ facilitator: myFacilitator, paymentRequired: { scheme: 'exact', networkId: 'eip155:8453', // Base mainnet maxAmountRequired: String( Math.round(parseFloat(process.env.X402_PRICE || '0.0001') * 1e6) ), // USDC has 6 decimals recipient: process.env.RECIPIENT_ADDRESS, asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base description: 'RPC access via Arkeo x402', }, upstream: process.env.UPSTREAM_RPC || 'http://localhost:26657', port: parseInt(process.env.X402_PORT || '3000'), }); console.log(`x402 proxy listening on port ${process.env.X402_PORT || 3000}`); console.log(`Recipient: ${process.env.RECIPIENT_ADDRESS}`); console.log(`Price: $${process.env.X402_PRICE} USDC per request`); console.log(`Upstream: ${process.env.UPSTREAM_RPC}`);
http://localhost:26657http://localhost:8545http://localhost:8332
[Unit] Description=x402 RPC Proxy After=network.target [Service] Type=simple User=root WorkingDirectory=/opt/x402-proxy EnvironmentFile=/opt/x402-proxy/.env ExecStart=/usr/bin/node /opt/x402-proxy/server.mjs Restart=always RestartSec=5 StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target
# Enable and start the service systemctl daemon-reload systemctl enable x402-proxy systemctl start x402-proxy # Check it's running systemctl status x402-proxy journalctl -u x402-proxy -f
Expose the proxy at https://yournode.com/x402/. Replace yournode.com with your actual domain.
server {
listen 443 ssl;
server_name yournode.com; # ← change this
ssl_certificate /etc/letsencrypt/live/yournode.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yournode.com/privkey.pem;
location /x402/ {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Important: allow both GET and POST for EVM chains
proxy_method $request_method;
proxy_pass_request_body on;
}
}
server {
listen 80;
server_name yournode.com;
return 301 https://$host$request_uri;
}
# Get SSL cert (if you don't have one already) certbot --nginx -d yournode.com # Enable the site ln -s /etc/nginx/sites-available/x402 /etc/nginx/sites-enabled/ nginx -t && systemctl reload nginx
A working x402 endpoint returns HTTP 402 with a X-PAYMENT-REQUIRED header on unauthenticated requests:
# Should return HTTP/1.1 402 Payment Required curl -I https://yournode.com/x402/ # Verify the payment header is present curl -sv https://yournode.com/x402/ 2>&1 | grep -i "payment\|402\|x-"
HTTP/2 402 and a header like X-PAYMENT-REQUIRED: ... containing your recipient address and price. If you see this, your endpoint is live.
systemctl status x402-proxy. Check the upstream RPC is reachable: curl http://localhost:26657/status.
Once your endpoint is live, add your x402 URL to the marketplace so subscribers can find you. Contact the Arkeo team on Telegram or Discord to add the x402Url field to your provider listing — it takes 5 minutes and gives you an ⚡ x402 badge on your provider card.
https://yournode.com/x402/ — include the trailing slash. This is the URL subscribers will pay to access.
Providers with x402 enabled appear with a prominent ⚡ badge in the marketplace and are prioritized in AI agent discovery (Bazaar extension). This puts your node directly in front of the growing ecosystem of automated x402 consumers.
Red_5 is live at $0.0001/request. Be among the first providers to accept AI agent payments on Arkeo.
Questions? Reach us on Telegram or Discord.