⚡ x402 Provider Guide

Accept USDC Payments
From AI Agents

Deploy an x402 proxy on your existing RPC node. AI agents pay per request in USDC — no API keys, no accounts, no friction.

In This Guide

  1. 1 Prerequisites
  2. 2 Install x402 Proxy
  3. 3 Prepare Your Wallet
  4. 4 Configure server.mjs
  5. 5 Systemd Service
  6. 6 Nginx Reverse Proxy
  7. 7 Test Your Endpoint
  8. 8 Register on Arkeo
✅ Confirmed Working This guide is based on Red_5 (rbechtold.eth), the first Arkeo provider with a live x402 endpoint. Setup time: ~45 minutes on an existing VPS.

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.

1,000 requests/day$3/month
10,000 requests/day$30/month
100,000 requests/day$300/month
1M requests/day$3,000/month
1

Prerequisites

What you need before starting
2

Install x402 Proxy

~5 minutes

Create a dedicated directory and install the x402 packages:

bash
# 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/
Why local facilitator? We use @x402/evm/exact/facilitator which calls transferWithAuthorization on USDC directly. No third-party CDP API keys required, and no signature-rejection issues.
3

Prepare Your Wallet Key

Secure your facilitator wallet

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.

bash
# 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
⚠️ Two wallet addresses needed 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.).
4

Configure server.mjs

The core proxy file

Create the main server file. This proxies incoming requests, requires x402 payment, and settles on Base:

/opt/x402-proxy/server.mjs
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}`);
UPSTREAM_RPC should point to your local RPC node. Examples:
• Cosmos/Tendermint: http://localhost:26657
• EVM (geth/erigon): http://localhost:8545
• Bitcoin: http://localhost:8332
5

Systemd Service

Auto-start on reboot
/etc/systemd/system/x402-proxy.service
[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
bash — enable and start
# 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
6

Nginx Reverse Proxy

HTTPS with Let's Encrypt

Expose the proxy at https://yournode.com/x402/. Replace yournode.com with your actual domain.

/etc/nginx/sites-available/x402
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;
}
bash — enable and test
# 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
7

Test Your Endpoint

Verify x402 is live before registering

A working x402 endpoint returns HTTP 402 with a X-PAYMENT-REQUIRED header on unauthenticated requests:

bash
# 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-"
✅ Expected output includes: HTTP/2 402 and a header like X-PAYMENT-REQUIRED: ... containing your recipient address and price. If you see this, your endpoint is live.
⚠️ If you get 502 Bad Gateway Check that x402-proxy is running: systemctl status x402-proxy. Check the upstream RPC is reachable: curl http://localhost:26657/status.
8

Register on Arkeo Marketplace

Get discovered by subscribers

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.

Your x402 URL format: 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.

⚡ Join the First x402 Network

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.