AWS WAF AI Traffic Monetization

Charge AI bots for content access using the x402 protocol. Pay-per-request, settled on-chain.

The Problem

AI bots consume your content at scale, summarize it elsewhere, and return nothing. No page views, no ad revenue, no conversions. You bear the infrastructure cost while someone else extracts the value.

Until now, the options were binary: block them (lose reach) or allow them (subsidize their product). AWS WAF introduces a third option: charge them.

How It Works

1. Agent
GET /api/*
→
2. WAF
402 + Price
→
3. Agent
Signs Payment
→
4. WAF
Verify + Settle
→
5. Origin
200 + Content

The agent receives an HTTP 402 Payment Required with a machine-readable payment-required header containing the price, accepted payment network, and wallet address. The agent signs a USDC payment authorization and retries with a Payment-Signature header. WAF verifies, settles on-chain, and serves the content.

TEST MODE

Try It Yourself

This demo runs in test mode on Base Sepolia testnet. No real money needed. Free test USDC available from a faucet.

  1. Get test USDC from faucet.circle.com. Select Base Sepolia and paste your wallet address.
  2. Install the x402 client:
    npm install @coinbase/x402
  3. Make a paid request:
    import { paymentClient } from "@coinbase/x402";
    import { createWalletClient, http } from "viem";
    import { baseSepolia } from "viem/chains";
    import { privateKeyToAccount } from "viem/accounts";
    
    const account = privateKeyToAccount("0xYOUR_PRIVATE_KEY");
    const wallet = createWalletClient({
      account,
      chain: baseSepolia,
      transport: http()
    });
    
    const response = await paymentClient.fetch(
      "https://monetize.tzoori.click/api/article",
      { wallet }
    );
    
    console.log(await response.json());
    // => { title: "...", body: "...", author: "..." }
  4. Or just see the 402 response:
    curl -i https://monetize.tzoori.click/api/article
LIVE 402 RESPONSE

What the Agent Sees

The payment-required header (base64-decoded) contains:

{
  "accepts": [{
    "amount": "1000",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "extra": { "name": "USD Coin", "version": "2" },
    "maxTimeoutSeconds": 300,
    "network": "eip155:84532",
    "payTo": "0x9549392E8EFEE6ff66E364980177FFfe47052Fc7",
    "scheme": "exact"
  }],
  "error": "PAYMENT-SIGNATURE header is required",
  "resource": { "url": "https://monetize.tzoori.click/api/article" },
  "x402Version": 2
}

Translation: Pay 0.001 USDC on Base Sepolia to the publisher's wallet. Attach the signed authorization as a Payment-Signature header and retry within 300 seconds.

After Payment: Content Served

Once payment is verified and settled on-chain, the agent receives the actual content:

HTTP/2 200

{
  "title": "Understanding Neural Architecture Search",
  "author": "Dr. Sarah Chen",
  "body": "Neural architecture search (NAS) automates the design of...",
  "category": "machine-learning",
  "generated_at": "2026-06-16T10:30:00Z",
  "word_count": 342
}

Every /api/* path generates different randomized content. Try /api/weather, /api/economics, /api/anything.

Technical Stack

Why This Matters