📄 YAML-first config
No code, no compilation step. AI-friendly declarative config that fits in a single file. Readable by humans, writable by LLMs.
Turn any API into a paid x402 API.
One YAML config, zero code.
Define upstreams, routes, and pricing rules. Match on request body, query params, or headers using glob patterns.
npx tollbooth startYour API now requires x402 payment via USDC before forwarding requests upstream. No changes to your existing service.
Price different models differently. Match on request body, query params, or headers using glob patterns. The whole gateway is a single YAML file — no compilation, no build step.
upstreams:
anthropic:
url: "https://api.anthropic.com"
headers:
x-api-key: "${ANTHROPIC_API_KEY}"
routes:
"POST /ai/claude":
upstream: anthropic
path: "/v1/messages"
match:
- where: { body.model: "claude-haiku-*" }
price: "$0.005"
- where: { body.model: "claude-opus-*" }
price: "$0.075"
fallback: "$0.015"No code, no compilation step. AI-friendly declarative config that fits in a single file. Readable by humans, writable by LLMs.
Match on body fields, query params, or headers with glob patterns. Different prices per model, endpoint, or user tier.
Proxy Anthropic, OpenAI, Dune, or any HTTP API from a single gateway. One config file, many backends.
onRequest, onSettled, onResponse, onError — inject custom logic at any point without forking the gateway.
Modern payment headers, auto-discovery at /.well-known/x402. Fully spec-compliant out of the box.
Base, Solana, and any supported x402 network. Chain-agnostic by design — configure once, settle anywhere.
Tollbooth sits in front of your API and handles the payment handshake automatically. Clients that can't pay get a 402. Clients that pay get proxied through.
Wrap any existing HTTP API with per-request USDC payments. Deploy tollbooth in front of your service in minutes — no changes to your backend required.
Put a tollbooth in front of your fine-tuned model. Let other agents pay per request to use your model. YAML config, running in production, in under five minutes.
Multiple upstreams, one gateway, dynamic pricing per endpoint. Route to different backends based on the request — all from a single config file.