Readit News logoReadit News
Posted by u/paolobietolini 13 days ago
Show HN: Caddy plugin that charges AI crawlers real USDC to access your sitegithub.com/paolobietolini...
Hello, I built a Caddy middleware that implements the x402 protocol (by Coinbase) to charge AI crawlers real money for content access.

When GPTBot, ClaudeBot, or any known AI crawler hits your site, it gets an HTTP 402 with payment requirements. If it pays (USDC on Base), it gets the content. If not, it gets nothing.

Normal users are never affected.

How it works: - Crawler detected by User-Agent → 402 response with price and wallet address

- Crawler signs a USDC payment (EIP-3009) and retries with X-PAYMENT header

- Plugin forwards to x402.org facilitator → on-chain settlement on Base

- USDC goes directly from crawler's wallet to yours

- Content served

  Configuration is a few lines in the Caddyfile:

      x402 {
          pay_to  0xYOUR_WALLET
          price   0.05
          network base
          exempt  /robots.txt
      }

  It's running on my site right now. No payments yet since most crawlers don't support x402, but they get blocked with a proper 402 instead of getting free content. When they do adopt it, the infrastructure is ready.
Built with pure Go (no CGo), SQLite audit trail, Cloudflare-compatible headers.

ollybrinkman · 13 days ago
This is a great approach. We built something complementary — Apiosk is an API gateway where AI agents pay per request using USDC on Base via x402.

The idea is the same: use HTTP 402 as real payment infrastructure, not just a status code that never got used.

We have 16 live APIs (weather, prices, news, PDF generation, etc.) that agents can call without any API keys — just a wallet.

https://apiosk.com

paolobietolini · 13 days ago
piggybacking on my post