I needed agents to pay per call against an existing HTTP API without handing out API keys. x402-micro-tollgate is a thin Express process that is both an HTTP 402 reverse proxy and an MCP server.
Unpaid gated routes (default /v1) return protocol 402. After settlement, the request is proxied to UPSTREAM_URL. /health stays free. Same process exposes MCP tools: server_info (free), get_quote / proxy_request (paid).
Demo (no CDP keys):
curl -i https://x402-micro-tollgate.onrender.com/v1/quote
# HTTP/1.1 402 Payment Required
Self-host:
npx x402-micro-tollgate
Repo: https://github.com/kevin2003050666-coder/x402-micro-tollgate
npm: https://www.npmjs.com/package/x402-micro-tollgate
MCP Registry: io.github.kevin2003050666-coder/x402-micro-tollgate
Top comments (0)