Scenario 8
A crawler pays per page
Two separate Cloudflare variants, never one path. (a) The Monetization Gateway closed beta of 2026-09-30 answers with an inline x402 402 and settles USDC on Base through Coinbase's x402 facilitator. (b) The credit-backed batch-settlement binding on the cloudflare:402 network has the crawler sign with RFC 9421 while Cloudflare, as merchant of record, bills later off chain, as the x402 spec describes it for pay-per-crawl.
The situation
An AI company runs a crawler that reads articles on publisher sites behind Cloudflare. The publishers want to be paid for each page. No human is present: the crawler decides, pays and fetches by itself.
Cloudflare offers two different mechanisms, and they must not be merged. The Monetization Gateway closed beta of 2026-09-30 settles on Base through Coinbase’s .Source [1] The credit-backed cloudflare:402 network with signatures is a separate variant, not the gateway’s settlement path.Source [1, 2] This page walks through each in turn, steps 1 to 6 for variant (a) and steps 7 to 13 for variant (b).
There is a fit question too. The gateway targets per-use resources such as websites, APIs, tools and datasets.Source [1] Its announcement places pages that are crawled once and used many times under Cloudflare’s Pay Per Use instead.Source [1] The cloudflare:402 binding, by contrast, sends crawlers to Cloudflare’s pay-per-crawl documentation to register.Source [2]
Actors
- Crawler, an autonomous with a wallet (variant a) or a Cloudflare billing account (variant b).
- Cloudflare edge, which prices requests and checks payment.
- Publisher origin, the seller.
- Coinbase and Base, in variant (a) only.Source [1]
- Crawler key directory and Cloudflare billing, in variant (b) only; Cloudflare acts as there.Source [2]
Step by step
Variant (a): Monetization Gateway, closed beta.
- Request (x402). The crawler asks for a priced resource. Sellers set which requests pay, the cost and the destination, with rules on URL, headers or query parameters.Source [1] Only eligible US-based sellers and buyers can join.Source [1]
- (x402). The server answers with 402 and a
PAYMENT-REQUIREDheader holding base64PaymentRequiredJSON.Source [3, 4] The announcement names no identifier.Source [1] - Pay (x402). The crawler retries with
PAYMENT-SIGNATUREholding a base64PaymentPayload.Source [3] - Verify and settle (x402). The server calls the ’s
POST /verifyand thenPOST /settle.Source [4] Cloudflare routes this through Coinbase’s facilitator.Source [1] - On chain (Base). The facilitator broadcasts the transfer and usually pays the gas.Source [5, 6]
- Serve (x402). The server returns 200 with a
PAYMENT-RESPONSEholding theSettleResponse.Source [3]
Variant (b): on cloudflare:402, credit-backed.
- Register once (x402 ). The crawler publishes keys at
/.well-known/http-message-signatures-directoryand registers its signature ; Cloudflare ties it to a billing identity.Source [2] - Request (x402). The crawler asks for the article.
- 402 (x402). The requirement names
batch-settlement,cloudflare:402,payToset to the constantmerchant, and assetUSD.Source [2] Schema and optional fields are dropped because large headers may be lost.Source [2] - Sign (x402). The crawler sends
Signature-Agent,Signature-InputandSignature, plusPAYMENT-SIGNATUREwith amount and asset.Source [2] The signature covers@authority,signature-agentandpayment-signature.Source [2] - Verify at the edge (x402). The edge checks the signature, the known agent, amount and asset, freshness and the accepted offer.Source [2]
- Serve (x402). The
PAYMENT-RESPONSEhas an empty transaction field.Source [2] - Bill and pay out. Cloudflare aggregates commitments, bills the crawler’s identity and pays publishers periodically over off-chain rails.Source [2]
Which protocol does what
| Steps | Protocol | Object or message | Spec version |
|---|---|---|---|
| 1 to 6 | x402 V2 via the Monetization Gateway | PAYMENT-REQUIRED, PAYMENT-SIGNATURE, /verify, /settle, on eip155:8453 | V2; beta post 2026-09-30 |
| 7 | x402 http-message-signatures | key directory, registrationUrl | merged 2026-04-15 |
| 8 to 13 | x402 batch-settlement on cloudflare:402 | headers, payTo: "merchant", asset USD | network version 1.0.0 |
The , its cloudflare:402 binding and the signatures extension were merged on 2026-04-15.Source [7]
Where controls apply
- Before authorization. Budgets are out of scope for x402 and live in SDKs and wallets.Source [4, 8] The TypeScript client caps each payment at $1 by default.Source [9, 10] In variant (b) the credit terms set at registration act as the limit.Source [2]
- At signing. In variant (a) the client’s signature fixes recipient and amount.Source [11] In variant (b) the signature binds the payment header to the request.Source [2]
- At the edge. Cloudflare’s gateway is the enforcement point in both; in variant (b) identity replaces a wallet.Source [2, 12, 13]
- At settlement. Variant (a) has the , which usually pays gas.Source [5, 6] Variant (b) has Cloudflare’s billing.
- After the fact. The defines no refund, and x402 has no dispute process.Source [14, 15] In variant (b) Cloudflare is with its own billing and dispute terms.Source [2, 4]
What is observable from outside
Variant (a) leaves a transfer on Base. Header contents such as resource URLs and amounts stay between client, server and , so the chain shows the transfer but not the page.Source [4, 16] Variant (b) leaves nothing on any chain: commitments never reach one, and Cloudflare alone holds the link from signature identity to billing account.Source [2] The crawler’s key directory is public, since the edge must fetch it.Source [2, 17] The gateway post gives no fee or payout schedule.Source [1]
What can go wrong
- Unknown or unregistered crawler (b). The binding returns
signature_agent_unknown,invalid_signature,payment_failedorprice_not_acceptable.Source [2] - No identity check (a). The gateway post mentions no crawler signature requirement and says identity primitives are planned.Source [1] Anyone with a funded wallet can pay.
- Settle timeout (a). A timeout is indeterminate;
settlement_pendingis retried and reconciled.Source [4, 6] - Concentration. Critics note that Cloudflare’s gateway, like most x402 traffic, routes through Coinbase’s (reported).Source [1, 18, 19]
- Who bears the loss. In (a) a paid but failed fetch is the publisher’s arrangement to fix, because has no refund.Source [14] In (b) pages are served before the bill, and what happens when a batched payment fails is set by the registration terms, not by x402.Source [2]
Variants
- Pre-authorized crawler (b). A crawler with a pre-authorized agreement can sign and pay in its first request and skip the .Source [2]
- Paid inference instead of pages (a). Cloudflare AI Gateway
PAYMENT-METHOD: x402to pay for inference.Source [20]
Flow player: A crawler pays per page: (a) Cloudflare Monetization Gateway beta with USDC on Base, (b) the credit-backed cloudflare:402 network
Two separate variants, never one path. Steps 1 to 6, variant (a): the Cloudflare Monetization Gateway closed beta (2026-09-30) answers with an inline x402 402 and settles USDC on Base through Coinbase's x402 facilitator. Steps 7 to 13, variant (b): the credit-backed batch-settlement binding on the cloudflare:402 network, where the crawler signs with RFC 9421, Cloudflare is merchant of record and bills later off chain, as the x402 spec describes it with a registration link to Cloudflare's pay-per-crawl documentation.
Spec version: x402 V2 (repository at f8f8330); cloudflare:402 network version 1.0.0; Monetization Gateway beta post (2026-09-30) (2026-09-30).
Crosses a trust boundary
Use the left and right arrow keys to step, space to play or pause, Home and End to jump.
Step 1 of 13AI crawler or agent to Cloudflare edge (gateway)
(a) Request a priced resource
Variant (a), Monetization Gateway closed beta. The agent requests a resource the seller has priced in the gateway. Sellers define which requests require payment, the cost and the destination, with rules on URL, headers or query parameters. The beta is limited to eligible US-based sellers and buyers.
Spec for step 1 (external link)
Control point: Before authorization: the crawler's own allowlist of publishers and its per-request price ceiling.
Step 1 of 13: AI crawler or agent to Cloudflare edge (gateway). (a) Request a priced resource. Crosses a trust boundary.
Which protocol owns each step
- x402
| Step | From and to | Protocol | Control point | Observable from outside |
|---|---|---|---|---|
| 1. (a) Request a priced resource (crosses a trust boundary) | AI crawler or agent to Cloudflare edge (gateway) | x402 | Before authorization: the crawler's own allowlist of publishers and its per-request price ceiling. | Private |
| 2. (a) 402 with PAYMENT-REQUIRED (USDC on Base) (crosses a trust boundary) | Cloudflare edge (gateway) to AI crawler or agent | x402 | None | Private: the 402 goes only to the requester. |
| 3. (a) Retry with PAYMENT-SIGNATURE (crosses a trust boundary) | AI crawler or agent to Cloudflare edge (gateway) | x402 | At signing: wallet policy and SDK spendControls cap the amount per payment. | Private |
| 4. (a) POST /verify, then POST /settle (crosses a trust boundary) | Cloudflare edge (gateway) to Coinbase x402 facilitator | x402 | At settlement: the facilitator's screening and deduplication before money moves. | Private |
| 5. (a) USDC transfer on Base (crosses a trust boundary) | Coinbase x402 facilitator to Base (USDC) | x402 | None | Public: the USDC transfer on Base, with payer and payee addresses and the amount; not which page was bought. |
| 6. (a) 200 with the resource and PAYMENT-RESPONSE (crosses a trust boundary) | Cloudflare edge (gateway) to AI crawler or agent | x402 | After the fact: the transaction hash is the receipt; the exact flow has no refund in the protocol. | Private |
| 7. (b) One-time setup: publish keys and register the signature agent (crosses a trust boundary) | AI crawler or agent to Crawler key directory | x402 | Before authorization: Cloudflare's onboarding of the crawler and the credit terms set at registration. | Public: the crawler's key directory can be fetched by anyone; the billing link is private to Cloudflare. |
| 8. (b) GET the page (crosses a trust boundary) | AI crawler or agent to Cloudflare edge (gateway) | x402 | None | Private |
| 9. (b) 402: batch-settlement on cloudflare:402, payTo merchant (crosses a trust boundary) | Cloudflare edge (gateway) to AI crawler or agent | x402 | None | Private |
| 10. (b) Retry signed with RFC 9421 plus PAYMENT-SIGNATURE (crosses a trust boundary) | AI crawler or agent to Cloudflare edge (gateway) | x402 | At signing: the crawler's signer refuses commitments above its per-page ceiling or outside its publisher list. | Private |
| 11. (b) Fetch the key, check the agent is known, verify (crosses a trust boundary) | Cloudflare edge (gateway) to Crawler key directory | x402 | At the edge: Cloudflare's signature and billing-identity checks stand in for a facilitator. | Private |
| 12. (b) 200 with the page and PAYMENT-RESPONSE (no transaction) (crosses a trust boundary) | Cloudflare edge (gateway) to AI crawler or agent | x402 | None | Private: no chain transaction; only the crawler, Cloudflare and the publisher see the commitment. |
| 13. (b) Batched billing and periodic payout over off-chain rails (crosses a trust boundary) | Cloudflare billing (merchant of record) to Publisher origin | x402 | After the fact: Cloudflare's invoices and dispute terms; the crawler reconciles its own logs of PAYMENT-RESPONSE headers against the bill. | Private: the mapping from signature identity to billing account is held by Cloudflare. |
Sequence diagram: A crawler pays per page: (a) Cloudflare Monetization Gateway beta with USDC on Base, (b) the credit-backed cloudflare:402 network
Scroll to see the whole diagram
Diagram loads when it scrolls into view.
Generated from the flow definition (spec version x402 V2 (repository at f8f8330); cloudflare:402 network version 1.0.0; Monetization Gateway beta post (2026-09-30), 2026-09-30). The player above uses the same data.
Text alternative
Sequence diagram: A crawler pays per page: (a) Cloudflare Monetization Gateway beta with USDC on Base, (b) the credit-backed cloudflare:402 network. 7 participants: AI crawler or agent, Cloudflare edge (gateway), Publisher origin, Coinbase x402 facilitator, Base (USDC), Crawler key directory, and Cloudflare billing (merchant of record). 13 steps, 13 crossing a trust boundary, 8 failure branches. Based on several protocols x402 V2 (repository at f8f8330); cloudflare:402 network version 1.0.0; Monetization Gateway beta post (2026-09-30) (2026-09-30). Step 1: AI crawler or agent to Cloudflare edge (gateway): (a) Request a priced resource. This step crosses a trust boundary. Step 2: Cloudflare edge (gateway) to AI crawler or agent: (a) 402 with PAYMENT-REQUIRED (USDC on Base). This step crosses a trust boundary. Step 3: AI crawler or agent to Cloudflare edge (gateway): (a) Retry with PAYMENT-SIGNATURE. This step crosses a trust boundary. If The wallet holds too little USDC: Verification fails, for example with insufficient_funds; nothing is served. Step 4: Cloudflare edge (gateway) to Coinbase x402 facilitator: (a) POST /verify, then POST /settle. This step crosses a trust boundary. If The settle call times out: Indeterminate: settlement may still have happened; settlement_pending is retried and reconciled. Step 5: Coinbase x402 facilitator to Base (USDC): (a) USDC transfer on Base. This step crosses a trust boundary. Step 6: Cloudflare edge (gateway) to AI crawler or agent: (a) 200 with the resource and PAYMENT-RESPONSE. This step crosses a trust boundary. Step 7: AI crawler or agent to Crawler key directory: (b) One-time setup: publish keys and register the signature agent. This step crosses a trust boundary. Step 8: AI crawler or agent to Cloudflare edge (gateway): (b) GET the page. This step crosses a trust boundary. Step 9: Cloudflare edge (gateway) to AI crawler or agent: (b) 402: batch-settlement on cloudflare:402, payTo merchant. This step crosses a trust boundary. If The signature agent is not recognized: The amount may be missing from accepts; the client should retry with authentication. Step 10: AI crawler or agent to Cloudflare edge (gateway): (b) Retry signed with RFC 9421 plus PAYMENT-SIGNATURE. This step crosses a trust boundary. Step 11: Cloudflare edge (gateway) to Crawler key directory: (b) Fetch the key, check the agent is known, verify. This step crosses a trust boundary. If Unknown signature agent: signature_agent_unknown. If Bad or missing message signature: invalid_signature. If Agent not tied to a valid billing identity: payment_failed. If Amount does not match: price_not_acceptable. Step 12: Cloudflare edge (gateway) to AI crawler or agent: (b) 200 with the page and PAYMENT-RESPONSE (no transaction). This step crosses a trust boundary. Step 13: Cloudflare billing (merchant of record) to Publisher origin: (b) Batched billing and periodic payout over off-chain rails. This step crosses a trust boundary. If The crawler's account cannot be charged at the end of the period: Handled under Cloudflare's registration terms; x402 defines nothing.
- Step 1: AI crawler or agent to Cloudflare edge (gateway): (a) Request a priced resource. This step crosses a trust boundary.
- Step 2: Cloudflare edge (gateway) to AI crawler or agent: (a) 402 with PAYMENT-REQUIRED (USDC on Base). This step crosses a trust boundary.
- Step 3: AI crawler or agent to Cloudflare edge (gateway): (a) Retry with PAYMENT-SIGNATURE. This step crosses a trust boundary. If The wallet holds too little USDC: Verification fails, for example with insufficient_funds; nothing is served.
- Step 4: Cloudflare edge (gateway) to Coinbase x402 facilitator: (a) POST /verify, then POST /settle. This step crosses a trust boundary. If The settle call times out: Indeterminate: settlement may still have happened; settlement_pending is retried and reconciled.
- Step 5: Coinbase x402 facilitator to Base (USDC): (a) USDC transfer on Base. This step crosses a trust boundary.
- Step 6: Cloudflare edge (gateway) to AI crawler or agent: (a) 200 with the resource and PAYMENT-RESPONSE. This step crosses a trust boundary.
- Step 7: AI crawler or agent to Crawler key directory: (b) One-time setup: publish keys and register the signature agent. This step crosses a trust boundary.
- Step 8: AI crawler or agent to Cloudflare edge (gateway): (b) GET the page. This step crosses a trust boundary.
- Step 9: Cloudflare edge (gateway) to AI crawler or agent: (b) 402: batch-settlement on cloudflare:402, payTo merchant. This step crosses a trust boundary. If The signature agent is not recognized: The amount may be missing from accepts; the client should retry with authentication.
- Step 10: AI crawler or agent to Cloudflare edge (gateway): (b) Retry signed with RFC 9421 plus PAYMENT-SIGNATURE. This step crosses a trust boundary.
- Step 11: Cloudflare edge (gateway) to Crawler key directory: (b) Fetch the key, check the agent is known, verify. This step crosses a trust boundary. If Unknown signature agent: signature_agent_unknown. If Bad or missing message signature: invalid_signature. If Agent not tied to a valid billing identity: payment_failed. If Amount does not match: price_not_acceptable.
- Step 12: Cloudflare edge (gateway) to AI crawler or agent: (b) 200 with the page and PAYMENT-RESPONSE (no transaction). This step crosses a trust boundary.
- Step 13: Cloudflare billing (merchant of record) to Publisher origin: (b) Batched billing and periodic payout over off-chain rails. This step crosses a trust boundary. If The crawler's account cannot be charged at the end of the period: Handled under Cloudflare's registration terms; x402 defines nothing.
Source of truth: Specification (external link) Generated from src/content/flows/multi-crawler-pays-per-page.json.
Actors and protocol boundaries
A crawler pays per page: two separate Cloudflare variants
Scroll to see the whole diagram
Diagram loads when it scrolls into view.
Two variants that do not share a settlement path. Solid lines, variant (a): the Monetization Gateway closed beta (2026-09-30) uses an x402 V2 402 exchange and settles USDC on Base through Coinbase's x402 facilitator. Dashed lines, variant (b): the credit-backed batch-settlement binding on the cloudflare:402 network, where the crawler signs with RFC 9421 and Cloudflare, as merchant of record, bills and pays out later over off-chain rails.
Text alternative
Flowchart with two variants. In variant (a), drawn with solid lines, the crawler receives a 402 from the Cloudflare edge and retries with a PAYMENT-SIGNATURE header; the edge calls verify and settle on the Coinbase x402 facilitator, which settles a USDC transfer on Base. In variant (b), drawn with dashed lines, the crawler sends an RFC 9421 signature plus a PAYMENT-SIGNATURE with payTo merchant and asset USD; the edge fetches the key from the crawler's key directory at /.well-known/http-message-signatures-directory and records a commitment with Cloudflare billing, with no chain transaction; Cloudflare billing sends a periodic invoice to the crawler and a periodic payout over off-chain rails to the publisher. In both variants the edge serves the page from the publisher origin.
Source of truth: x402 batch-settlement on cloudflare:402 (v1.0.0) and Cloudflare's Monetization Gateway beta post (2026-09-30) (external link) Generated from src/content/diagrams/multi-crawler-pays-per-page-context.mmd.
Sources
- Monetization Gateway beta (external link)
- Scheme: batch-settlement on cloudflare:402 (external link)
- x402 HTTP transport (V2) (external link)
- x402 Protocol Specification v2 (external link)
- Scheme: exact on Solana (SVM) (external link)
- x402 docs: Facilitator (external link)
- x402 PR #1145: batch-settlement scheme with cloudflare:402 binding and http-message-signatures extension (external link)
- x402 docs: SDK features and parity (external link)
- x402Client.ts (SpendControls, DEFAULT_MAX_AMOUNT_PER_PAYMENT) (external link)
- @x402/core CHANGELOG.md (external link)
- Scheme: exact on EVM (external link)
- Extension: sign-in-with-x (external link)
- Extension: auth-hints (external link)
- Scheme: exact (network independent) (external link)
- Scheme: auth-capture (external link)
- Scheme: batch-settlement on EVM (external link)
- Extension: http-message-signatures (external link)
- When HTTP 402 Meets the Blockchain: Risks on Emerging x402 Payments (external link)
- CDP x402 docs: Welcome (external link)
- Cloudflare AI Gateway: Machine payments (PAYMENT-METHOD: x402) (external link)
- CDP x402 facilitator: pricing and supported networks (external link)