Skip to main content
Set up pay-per-crawl on your site in five minutes — detect AI bots (GPTBot, ClaudeBot, PerplexityBot, etc.), return HTTP 402, collect USDC micropayments on Base. Works standalone or as a non-custodial alternative to Cloudflare pay-per-crawl.

Xenarch vs Cloudflare pay-per-crawl

Prerequisites

  • A USDC wallet on Base (this is where you receive payments)
  • Your content served over HTTPS

Step 1: Register

This creates your publisher account and returns an API key (xk_pub_...).

Step 2: Add your site

Returns a site token (st_...) and site ID. Save both.

Step 3: Set pricing

Sets a default price of $0.003 per page. Add path-specific rules:

Step 4: Install middleware

Choose your integration:
Site-wide middleware (gates all bot traffic):
Per-route decorator (gates individual endpoints):
See the FastAPI middleware guide.

Step 5: Add pay.json (optional)

Serve a pay.json file at /.well-known/pay.json so agents can discover your pricing without hitting a 402 first:
See the pay.json spec.

How it works for your users

  • Humans: Pass through completely unaffected. The middleware only gates bot traffic.
  • AI agents with payment: Pay USDC, get an access token, access your content.
  • AI agents without payment: See HTTP 402 with payment instructions.

Check your earnings