Introducing a new console experience for AWS WAF
You can now use the updated experience to access AWS WAF functionality anywhere in the console. For more details, see Working with the console.
How AI traffic monetization works
AI traffic monetization uses the x402
-
Request – A client (typically an AI agent) sends a request to a AWS WAF protected resource on your CloudFront distribution.
-
Rule evaluation – AWS WAF evaluates the request against your rules in priority order. If a rule with a Monetize action matches and the request does not include a valid payment authorization, AWS WAF returns an HTTP 402 Payment Required response. For more details, see Rule actions.
-
Payment Required Challenge – AWS WAF returns an HTTP 402 response (the "Payment Required Challenge"). The response includes payment instructions containing:
-
Content price (per request) in USDC
-
Accepted payment networks (Base, Solana)
-
Publisher wallet address (payTo)
-
Maximum timeout
-
Payment scheme
-
-
Payment authorization – The client signs a payment authorization using their wallet's private key or a server wallet API. The client resubmits the original request with a
payment-signatureheader containing the signed authorization. -
Verification – AWS WAF verifies the payment credentials, confirming transfer of sufficient funds and valid authorization. This occurs synchronously in the request path. If the verification fails, the client is served a 402 and the content is not served.
-
Content fetch – On successful verification, the request for content is allowed.
-
Settlement – If content fetch is successful (2xx status code), the payment is settled on the blockchain via Coinbase Developer Platform's x402 facilitator service. Settlement occurs synchronously – content is served after confirmed payment. If the payment settlement fails, the client is served a 402 and the content is not served.
-
Response – The content is served to the client with a
payment-responseheader containing settlement confirmation details.
Key behaviors:
-
No payment for failed origins – If origin returns 4xx or 5xx, settlement is skipped and the client is not charged.
-
Idempotency – The x402 protocol supports a payment-identifier extension
that allows clients to retry requests without double-payment for up to 15 minutes, as long as the extension is used by the client. -
Replay protection – Payment authorizations are single-use. Reusing a payment header without a valid payment-identifier results in a new 402 response.
For more details about the x402 open payment protocol, see x402 documentation
Supported resource types
AI traffic monetization protects resources on Amazon CloudFront distributions. You can monetize any path or content zone served through CloudFront, including:
-
Web pages and articles
-
API endpoints
-
Data feeds
-
Media assets
-
Structured datasets