How AIPayGen works
A site writes down what AI may do with its pages: AI search, AI answers, training, agents, each free, paid or refused. That is its AI Terms. When an AI crawler asks for a page, we check who it is and apply those terms: the page, or HTTP 402 and a price it can pay per page in USDC, wallet to wallet. Here is one request, step by step.
One AI crawler request
From the request to the page, free or paid. The same steps are in the list; the numbers match.
- A crawler asks for a page. On a site with our snippet or plugin, code on the site's own server sees the request first. A site can also put our gateway in front of its pages.
- Who is it? If the request carries a Web Bot Auth signature, it is checked against the signer's published key; otherwise a known crawler's name is checked against the address ranges its company publishes. Our gateway and the setups for Cloudflare Workers, Netlify, Express and Django check a Web Bot Auth signature first (Django when PyNaCl or cryptography is installed); the WordPress, PHP, nginx, Apache, Next.js and Vercel setups check a crawler's name against the addresses its company publishes, and Caddy passes AI crawlers to our gateway to check. See what we see on your own request · check an address · who we recognise.
- Free or priced? The site's settings decide, for example AI search crawlers free and training crawlers paid, or a few free pages a day for each verified crawler. The site's AI Terms file publishes the same settings, so a crawler can read them before it asks (ours, the Internet-Draft). Saying what a page is for in an AI-Purpose header doesn't change the price.
- Free use: the page. The site serves the page as it always does. The visit is counted in the owner's report.
- Priced use: a 402 and a price. Instead of the page, the crawler gets HTTP 402 Payment Required with an x402 quote: the owner's price in USDC on Base, payable to the owner's wallet, and a link to the terms. Try one on a demo site that charges training crawlers:
curl -i -A "GPTBot/1.2" https://aipaygen-ppc-demo.vercel.app/. How a crawler pays. - It asks again, with a payment. The same request, with a signed USDC payment in the PAYMENT-SIGNATURE header.
- The payment is checked. An x402 facilitator (Coinbase's, with PayAI's as a fallback) checks the signature and the amount. Nothing has moved yet.
- The page is fetched. We ask the site for the page. If it doesn't answer with a 2xx, the payment is never settled and nothing is charged.
- The payment settles. USDC goes from the crawler's wallet to the owner's, on Base. We never hold it and take 0%. About USDC on Base.
- The page, with a receipt. The crawler gets the page and a PAYMENT-RESPONSE header with the transaction hash, which anyone can look up on Base. Real receipts: our own test agent paying our own tools, each linked to Basescan (both wallets are ours, and the page says so). About receipts.
- A fake name isn't refused. A request using GPTBot's name from an address OpenAI doesn't publish gets no free pages, is asked the same price as GPTBot, and is counted as "GPTBot (fake)" in the owner's report. See the fakes on our own site.
The same, for an API
Sell calls to your API to AI agents: they pay per call, you get the money, we take 0%.
- Once: register and prove the domain. With a free key, you register your API's address, your price and your wallet on Base, then prove the domain is yours with a DNS record or a file. Until then the gateway sells nothing. Put your API behind the gateway · prove the domain.
- An agent calls your gateway address. Your route's address,
/g/<route>/plus the path, the same request it would send your API. - It gets a 402 and your price. An x402 quote: your price in USDC, payable to your wallet.
- It calls again, with a payment. A signed USDC payment in the PAYMENT-SIGNATURE header.
- The payment is checked. By the facilitator, before anything is forwarded. Nothing has moved yet.
- We forward the call. To your API, with an
x-aipaygen-gateway-secretheader, so your API can turn away calls that didn't come through the gateway. The template. - Your API answers. As it always does.
- Only a 2xx is charged. A 2xx answer settles the payment: USDC to your wallet, on Base, 0% to us. Anything else: the payment is never settled and the agent isn't charged.
- The agent gets your answer and the receipt. The same PAYMENT-RESPONSE header with the transaction hash.
Try it
Count the AI crawlers on your own site first, free and with no wallet; charge later if you want to.