Charge AI crawlers to read your site instead of blocking them
Put agent402-tollbooth in front of your site and AI crawlers pay
per request instead of being blocked: people browse free, a crawler gets
402 Payment Required and pays in USDC over x402 or MPP, or spends a little
CPU on a proof-of-work puzzle. It is open source (MIT), runs on any host, and
pays straight to your own wallet, with no account, no signup and no CDN
required.
Run it in front of any site
The reverse proxy needs no change to the site behind it:
TOLLBOOTH_UPSTREAM=https://your-site.example \
TOLLBOOTH_PAYTO=0xYourWallet \
npx agent402-tollbooth # listens on :4021; people pass free, crawlers pay
Or as middleware
import express from "express";
import { createTollbooth } from "agent402-tollbooth";
const app = express();
// price: what one request costs a crawler, in USD (your number)
app.use(createTollbooth({ price: process.env.CRAWL_PRICE, payTo: "0xYourWallet" }));
The same gate runs on edge runtimes built on the Web Crypto and Fetch APIs
(agent402-tollbooth/edge), and the package ships ready deploy templates.
Who pays
- Default: requests whose User-Agent matches a known AI crawler or fetcher pay; classic search indexers stay free, so search indexing is unchanged.
- Strict: anything that is not a real browser page load pays.
- All: every client pays or solves the puzzle, so disguising a crawler gains nothing.
- Adaptive: the puzzle gets harder as load climbs, so a high-volume scraper pays more CPU per request.
Not ready to charge? Run it in observe mode first: every request is classified and counted, and the dashboard shows what it would have charged, with no 402 sent.
What the crawler sees
One 402 carrying both payment wires and the puzzle: an x402 accepts entry
with your price and wallet, MPP challenges where you turn MPP on, and a
proofOfWork challenge. A crawler with no wallet solves the puzzle and
retries with X-Pow-Solution; a solution is single-use and bound to that
URL.
Next
- The tollbooth page and the package README.
- Sell your API over x402, for an API rather than a site.
- x402 vs MPP: use both.