On June 15, 2026, AWS and Coinbase shipped x402 support directly into Amazon CloudFront and AWS WAF. API publishers can now monetize requests from AI agents at the edge — no origin-server logic, no custom middleware, no third-party payment gateways. The flow runs entirely in AWS WAF Bot Control as a "Monetize" rule, settles USDC payments on Base or Solana in ~200ms, and costs less than one cent per transaction.
If you're serving data to agents and want per-request billing without building your own facilitator, this is the fastest path from "I have an API" to "agents pay me in stablecoins."
What shipped
AWS CloudFront distributions can now return HTTP 402 Payment Required responses when an agent requests a protected resource. The response includes a machine-readable JSON price manifest that tells the agent:
- How much the resource costs (denominated in USDC)
- Which blockchain networks the publisher accepts (Base, Solana)
- The facilitator endpoint to settle through (Coinbase's x402 facilitator)
- A challenge nonce for replay protection
The agent signs a payment authorization, retries the request with an X-PAYMENT header, and AWS WAF validates the signature + settlement before returning the resource. The origin server never sees the payment logic — CloudFront handles it at the edge.
Settlement networks: Base (Coinbase's Ethereum L2) and Solana. Both use USDC as the settlement token. Per-transaction fees are sub-cent on both chains; Base typically runs ~0.3¢, Solana ~0.02¢. Settlement latency is ~200ms end-to-end (challenge → payment → validation → response).
Pricing model: No extra charge beyond standard AWS WAF pricing. You pay AWS WAF's per-request fee (~$0.60 per million requests) plus CloudFront data transfer. The x402 validation adds negligible compute overhead; Coinbase's facilitator settlement fee is included in the on-chain gas.
Why this matters for agent builders
Before June 15, integrating x402 meant:
- Standing up your own facilitator (or proxying through Coinbase's reference implementation)
- Writing middleware to generate 402 challenges
- Validating payment proofs in your application layer
- Handling settlement retries and edge cases
Now you configure a WAF rule, set a price, and CloudFront does the rest. If you're building an agent that consumes paid APIs, you already speak x402 via libraries like World AgentKit or LangChain's X402PaymentProvider. The agent hits a CloudFront URL, sees the 402, pays, and gets the data — no human in the loop.
This is the first cloud-provider-native x402 implementation. Before this, x402 was a protocol you ran yourself or used via Coinbase's hosted facilitator. Now it's infrastructure you toggle on in the AWS console.
The request flow
Here's the sequence from an agent's perspective:
sequenceDiagram
participant Agent
participant CloudFront
participant WAF
participant Facilitator as Coinbase Facilitator
participant Chain as Base / Solana
Agent->>CloudFront: GET /dataset/v1/weather
CloudFront->>WAF: Evaluate Bot Control rules
WAF-->>CloudFront: Rule: Monetize (price: 0.05 USDC)
CloudFront-->>Agent: HTTP 402 Payment Required<br/>{"price": "0.05", "currency": "USDC", "chains": ["base", "solana"], "facilitator": "https://x402.coinbase.com", "nonce": "..."}
Agent->>Agent: Sign payment authorization (HD wallet)
Agent->>Facilitator: POST /settle {signature, nonce, amount}
Facilitator->>Chain: Submit USDC transfer tx
Chain-->>Facilitator: Tx confirmed
Facilitator-->>Agent: {"proof": "..."}
Agent->>CloudFront: GET /dataset/v1/weather<br/>X-PAYMENT: {proof}
CloudFront->>WAF: Validate proof
WAF->>Facilitator: Verify proof signature
Facilitator-->>WAF: Valid
WAF-->>CloudFront: Allow
CloudFront-->>Agent: HTTP 200 + data<br/>X-PAYMENT-CONFIRMATION: {receipt}
The agent sees two round-trips: one to discover the price, one to deliver the payment and fetch the resource. Total latency from first request to data in hand: ~250ms (network RTT + 200ms settlement).
Configuring WAF for x402
AWS published sample CloudFormation templates in their public GitHub repositories. The core setup:
Resources:
MyWAFWebACL:
Type: AWS::WAFv2::WebACL
Properties:
Rules:
- Name: MonetizeAgentRequests
Priority: 10
Statement:
ManagedRuleGroupStatement:
VendorName: AWS
Name: AWSManagedRulesBotControlRuleSet
ManagedRuleGroupConfigs:
- PayloadType: JSON
MonetizationConfig:
Enabled: true
PricePerRequest: "0.05" # USDC
AcceptedChains:
- base
- solana
FacilitatorEndpoint: "https://x402.coinbase.com"
Action:
Block:
CustomResponse:
ResponseCode: 402
CustomResponseBodyKey: X402PriceManifest
The MonetizationConfig block is new as of the June 15 release. You set:
PricePerRequest: the USDC amount (as a string to avoid floating-point issues)AcceptedChains:["base", "solana"]or a subsetFacilitatorEndpoint: Coinbase's facilitator is the default; you can self-host if you run your own
When an unauthenticated request hits, WAF returns a 402 with the CustomResponseBodyKey you define (a JSON manifest stored in WAF's custom response bodies). The agent parses it, pays, and retries.
Agent-side integration
If your agent uses World AgentKit (the World Chain orchestrator SDK), you already have x402 support:
from world_agentkit import Agent, X402PaymentProvider
import os
agent = Agent(
wallet_seed=os.getenv("AGENT_WALLET_SEED"),
payment_provider=X402PaymentProvider(
chains=["base", "solana"],
usdc_balance_threshold=10.0 # refill if below 10 USDC
)
)
# Agent makes a request to a CloudFront URL with x402 enabled
response = agent.fetch(
"https://d123abc.cloudfront.net/dataset/v1/weather?location=SFO"
)
# Under the hood:
# 1. fetch() sees HTTP 402, parses the price manifest
# 2. X402PaymentProvider signs a payment authorization
# 3. fetch() retries with X-PAYMENT header
# 4. Returns the data if payment validates
print(response.json())
# {"temperature": 16.2, "conditions": "fog", "timestamp": "2026-08-26T14:32:00Z"}
The X402PaymentProvider handles:
- HD wallet derivation (one keypair per payment to avoid nonce collisions)
- Signature generation (EIP-712 for Base, Solana's
ed25519for Solana) - Facilitator interaction (POST to
/settle, polling for confirmation) - Proof attachment to retry headers
If you're not using World AgentKit, LangChain 0.3.x includes an X402Tool that does the same thing. The pattern is: wrap your HTTP client in a payment-aware layer that catches 402s and injects payment headers.
Cost breakdown
Assume you're serving weather data to 10,000 agent requests/day at $0.05 USDC per request:
- Revenue: 10,000 × $0.05 = $500/day
- AWS WAF: 10,000 / 1,000,000 × $0.60 = $0.006/day
- CloudFront data transfer (assume 50 KB/response, us-east-1): 10,000 × 50 KB × $0.085/GB = $0.04/day
- Settlement gas (Base, avg 0.3¢/tx): 10,000 × $0.003 = $30/day
- Net: $500 - $30.046 = $469.95/day
The settlement gas is the dominant cost. If you price below ~2¢ per request, gas eats most of your margin. For sub-cent pricing, batch settlement (aggregate multiple agent payments into one on-chain tx) makes sense; AWS+Coinbase plan to ship batching in Q4 2026 according to the Genfinity coverage.
Solana's lower gas (~0.02¢) improves margins for cheap requests, but Base has better USDC liquidity and agent wallet support today. Most production agents we see at eSIMx402 default to Base unless latency or cost is critical.
When to use CloudFront x402 vs. self-hosted facilitator
Use CloudFront + WAF if:
- You already serve traffic through CloudFront
- You want zero code changes to your origin (the edge handles everything)
- You're fine with Coinbase as the settlement facilitator
- You trust AWS to validate payment proofs (they run the WAF rule)
Use a self-hosted facilitator if:
- You need custom settlement logic (e.g., escrow, multi-party splits)
- You want to settle on chains AWS doesn't support yet (Polygon, Arbitrum, TON)
- You need settlement batching today (not waiting for AWS to ship it)
- You want to avoid vendor lock-in to AWS infrastructure
We run a self-hosted facilitator for eSIMx402 because we need Polygon support (cheap gas for IoT device activations) and custom failover logic when an agent's primary chain is congested. But if you're starting from scratch and Base/Solana cover your use case, CloudFront is faster to ship.
Tradeoffs
The CloudFront implementation is edge-only. That's a feature (no origin load) and a constraint (no server-side business logic in the payment flow). Specifically:
- No dynamic pricing. The price is fixed in the WAF rule. If you want to charge different amounts based on request parameters (e.g., premium data costs more), you need multiple CloudFront distributions or multiple WAF rules with path-based routing. A self-hosted facilitator can compute prices on the fly.
- No refunds or partial settlements. Once the agent pays and the WAF validates, the transaction is final. If your API returns an error after payment (e.g., data unavailable), the agent doesn't get their USDC back unless you manually refund off-chain. Traditional APIs would return 503 before charging; x402 charges first.
- Settlement is synchronous. The agent blocks waiting for on-chain confirmation (~200ms). For latency-sensitive agents, that's noticeable. Some agents pre-pay (send a payment authorization for N requests upfront) to avoid per-request blocking; AWS's implementation doesn't support prepayment yet.
These aren't bugs — they're protocol design choices. HTTP 402 optimizes for permissionless monetization (no auth tokens, no rate-limit bypass, no account setup) at the cost of flexibility. If you need complex billing, a traditional API key + usage-based invoicing (e.g., Stripe) is still the right answer. x402 is for "pay per call, no questions asked."
What's next
AWS and Coinbase are iterating fast. Upcoming features (per the Coinbase developer blog):
- Settlement batching (Q4 2026): aggregate multiple agent payments into one on-chain transaction to reduce gas overhead. Useful for sub-cent pricing.
- Polygon and Arbitrum support (Q1 2027): expand beyond Base and Solana. We're watching Polygon closely because it's our primary chain for eSIM dispatch.
- Prepayment credits: let agents deposit USDC once and draw down per request without blocking on settlement each time. Cuts latency by ~180ms.
If you're building an agent that consumes paid APIs, start with the x402 spec to understand the challenge-response format. If you're publishing an API and already use CloudFront, try the WAF Monetize rule on a test distribution. The quickstart guide walks through agent-side integration in 5 minutes.
The June 15 launch makes x402 infrastructure-grade. Before this, it was a protocol you implemented yourself or proxied through Coinbase. Now it's a checkbox in AWS WAF. That's the tipping point where agent-to-API payments go from "interesting experiment" to "default monetization pattern."