YAML config
Define upstreams, routes, and pricing in a single tollbooth.config.yaml — no code required.
tollbooth is an API gateway that sits in front of your upstream APIs and charges callers per-request using the x402 payment protocol. No API keys, no subscriptions — just instant USDC micropayments.
YAML config
Define upstreams, routes, and pricing in a single tollbooth.config.yaml — no code required.
Dynamic pricing
Match on body fields, query params, and headers with glob patterns. Or use custom pricing functions.
Multi-upstream
Proxy to multiple APIs from a single gateway. Route by path, rewrite URLs, inject headers.
Lifecycle hooks
Hook into onRequest, onPriceResolved, onSettled, onResponse, and onError.
x402 V2
Modern payment headers with auto-discovery at /.well-known/x402.
Multi-chain
Accept USDC payments on Base, Base Sepolia, Solana, or any supported network.
bun add x402-tollboothnpm install x402-tollboothpnpm add x402-tollboothNext: Getting Started →