x402proxy is a lightweight proxy that verifies x402 payments before forwarding requests to your API. Protect any endpoint and start charging per-request in minutes.
curl -o custom-config.json https://raw.githubusercontent.com/zachalam/x402proxy/refs/heads/main/custom-config.json
docker run -p 8080:8080 \
-v $(pwd)/custom-config.json:/app/config.json:ro \
zachalam/x402proxy:latest
Your proxy will be available on port 8080 by default. The app exits if /app/config.json is missing.
The app reads configuration from /app/config.json inside the container.
Required fields:
facilitatorUrl: The x402 facilitator URLnetwork: Blockchain network (e.g. "base-sepolia")paymentAddress: Your wallet address to receive paymentsdefaultPrice: Default price for all routes (overridable per route)protectedEndpoints: Map of protected routes → forward targets and optional priceExample:
{
"facilitatorUrl": "https://x402.org/facilitator",
"network": "base-sepolia",
"paymentAddress": "0x5629562956295629562956295629562956295629",
"defaultPrice": "$0.05",
"protectedEndpoints": {
"GET /cat": { "forwardTo": "https://api.thecatapi.com/v1/images/search" }
}
}
latest: latest stable build<number>: auto-incremented version per commit to main8080 in the container. Map to your host with -p.Content type
Image
Digest
sha256:22621672c…
Size
553.4 MB
Last updated
10 months ago
docker pull zachalam/x402proxy