Cloudflare Pay per Crawl: How the HTTP 402 Handshake Works, and What It Means for Twitter (X) Data

By TwitterAPI.io Team•16 min read
Sequence diagram of Cloudflare Pay per Crawl. Three lanes: AI crawler signed with Web Bot Auth, Cloudflare edge, publisher origin. The crawler sends GET /article with signature, signature-input and signature-agent headers; the edge answers HTTP 402 with crawler-price: USD 0.01; the crawler retries with crawler-exact-price: USD 0.01, signed; the edge sends an origin request with cf-pay-per-crawl: protocol=cloudflare; the origin returns 200 with content and an optional crawler-price for dynamic pricing; the edge returns HTTP 200 with crawler-charged: USD 0.01. Notes: crawler-max-price is the proactive variant, errors carry crawler-error and are not billed, minimum price $0.001 per crawl.
The Pay per Crawl handshake as Cloudflare's docs define it: 402 with a price, a signed retry, 200 with the charge. Diagram, not a packet capture.
TL;DR
  • Status: announced in private beta on July 1, 2025; Cloudflare's docs still label Pay per Crawl closed beta, joined by signup form or account team.
  • The handshake: unpaid request gets 402 + crawler-price; a signed retry with crawler-exact-price (or a first request with crawler-max-price) gets 200 + crawler-charged.
  • Identity is mandatory: requests must carry Web Bot Auth signature, signature-input and signature-agent headers, and the price header must be inside the signature.
  • Prices: one price per zone, minimum $0.001 per crawl, optional dynamic pricing from the origin; error responses are never billed; /robots.txt and /sitemap.xml are always free.
  • On X: we found 270 posts that name Pay per Crawl; 61.5% came after the July 2026 Pay Per Use announcement, and only 2.2% mention Web Bot Auth.
  • X data is a different road: x.com disallows all crawlers in robots.txt; an API returns posts at $0.15 per 1,000 tweets versus $5 on X's pay-per-usage rate card.

"Pay per crawl" turns up in three places at once: publishers asking whether AI companies will finally pay for their pages, crawler and agent builders asking what a 402 response from a Cloudflare site means, and people working on agent payments who see HTTP 402 and assume it is x402. This page is the explainer for the first two groups. It covers what the feature is, its status, every header and error code, how Web Bot Auth fits in, what changed with Pay Per Use, and what it does and does not change for teams that need X (Twitter) data. The x402 protocol has its own page, and so does the wider choice between scraping and an API; this page links to them instead of repeating them.

Every fact about the feature below was checked against Cloudflare's developer docs and blog for this article, and each header name is copied from the docs. We also measured how the topic is discussed on X: every post that X search returned for "pay per crawl", plus the recent timelines of @Cloudflare and @CloudflareDev, collected in 2026. The numbers in the charts and tables come from that study.

X posts that name Cloudflare Pay per Crawl, collected in 2026

270 posts from 227 authors; 61.5% came after the July 2026 Pay Per Use announcement, and only 2.2% mention Web Bot Auth

01 — Section

What Cloudflare Pay per Crawl is, and its status

Pay per Crawl is one of the controls inside AI Crawl Control, the Cloudflare product that was called AI Audit until it was renamed and moved to general availability on August 28, 2025. AI Crawl Control shows which AI crawlers visit a site and lets the owner allow or block each one. Pay per Crawl adds a third answer: charge.

Cloudflare announced it on July 1, 2025 in a post titled "Introducing pay per crawl: Enabling content owners to charge AI crawlers for access", the same day it switched new domains to blocking AI crawlers by default ("Content Independence Day"). The launch post said the feature was "in private beta" and called it "our first experiment in this area". The current docs page "What is Pay Per Crawl?" says: "Pay per crawl is currently in closed beta." There is no public self-serve switch; publishers and crawler operators ask to join through Cloudflare's signup form or, for Enterprise customers, their account executive.

The docs define it this way: "Pay per crawl is a feature of AI Crawl Control that enables site owners to control and monetize AI crawler access to content by setting a price per zone." A zone is a domain on Cloudflare. For each AI crawler the owner picks one of three actions:

Allow. The crawler gets the content for free.

Charge. The crawler must pay the zone's price. A crawler with no billing relationship with Cloudflare cannot pay, so for it Charge works like a block, except that the response tells it a paid relationship is possible.

Block. The crawler is refused, with no option to pay.

Cloudflare is the Merchant of Record: it records each paid fetch, aggregates the charges, bills the crawler operator through Stripe and pays the publisher. WAF and Bot Management rules run first, so a crawler blocked there never reaches the Charge decision.

02 — Section

The HTTP 402 handshake: headers and error codes

Everything happens in HTTP headers on the normal request. There is no checkout page and no separate payment API call per page. A crawler can find out the price reactively (ask, get a 402, retry) or state a budget up front.

Reactive (discovery first). The crawler requests a paid URL. Cloudflare answers HTTP 402 Payment Required with crawler-price: USD 0.01 (the docs' example price). If the crawler accepts, it repeats the request with crawler-exact-price: USD 0.01. The value must match crawler-price exactly.

Proactive (intent first). The crawler sends crawler-max-price: USD 0.05 on its first request. If the page costs that much or less, it gets HTTP 200 and pays only the page's price, not the maximum. If the page costs more, it gets a 402 that states the price.

Only one price header may appear on a request. A successful paid fetch returns crawler-charged, which Cloudflare says is "the exact amount that will be billed to your Cloudflare account for the request" and recommends logging. The table lists every header in the protocol:

HeaderDirectionMeaning
crawler-priceedge to crawler (on 402); origin to edge (dynamic pricing)Price to fetch this page, e.g. USD 0.01
crawler-exact-pricecrawler to edge"I agree to pay exactly this"; must equal crawler-price
crawler-max-pricecrawler to edge"I pay up to this"; charged the page price if lower
crawler-chargededge to crawler (on 200)Amount billed for this fetch
crawler-erroredge to crawlerError code when the paid request fails
cf-pay-per-crawledge to originPricing mode for this request, e.g. protocol=cloudflare, pricing=in-band
signature, signature-input, signature-agentcrawler to edgeWeb Bot Auth identity; the price header must be a signed component

Two details catch people out. First, the crawler-price header from the origin is only forwarded to the client when the client is being asked to pay (a 402); on an ordinary 200 it stays at the edge. Second, re-crawling is not free: the FAQ says every access "will incur the cost set by the site owner", so the crawler has to track its own spend. Cloudflare's billing page is explicit that "Crawlers are responsible for setting and enforcing their own spending limits."

A failed paid request carries a crawler-error header. Cloudflare's docs list eleven codes. Errors are not billed, even when a price header was sent: "Charging events are only triggered for successful HTTP response codes."

CodeHTTPWhat it means
CrawlerForbidden403The site owner blocked this crawler
StrongAuthRequired400Web Bot Auth headers missing or not strong enough
InvalidSignature400signature-input or signature missing or invalid
InvalidCrawlerPriceValue400Price header badly formatted (expected like USD 0.01)
MissingCrawlerPrice402Neither price header was sent
PaymentFailed403Payment setup problem on the crawler's account
InvalidCrawlerExactPrice402crawler-exact-price does not match crawler-price
InvalidCrawlerMaxPrice402crawler-max-price is below the page price
ConflictingPriceHeaders400Both price headers on one request
InvalidContentPrice502The origin returned an invalid price
InternalError500Cloudflare error; retry with exponential backoff

The sketch below shows the crawler side of the reactive flow with a budget check. The signing function is a placeholder for your Web Bot Auth signer (key, directory and registration are prerequisites); the point is the control flow: read crawler-price, refuse anything over budget, sign the price header, record crawler-charged.

python
import requests
from decimal import Decimal

BUDGET_PER_PAGE = Decimal("0.02")   # your own cap; Cloudflare does not enforce one for you
spent = Decimal("0")


def sign(headers, url):
    """Placeholder: add signature-agent, signature-input and signature (Web Bot Auth,
    Ed25519, RFC 9421). Include crawler-exact-price / crawler-max-price in the signed
    components when present."""
    return headers


def parse_usd(value):
    currency, amount = value.split()
    assert currency == "USD"
    return Decimal(amount)


def fetch_paid(url):
    global spent
    r = requests.get(url, headers=sign({"User-Agent": "ExampleBot/1.0"}, url), timeout=30)
    if r.status_code != 402:
        return r                                   # free, blocked (403) or another error
    price = parse_usd(r.headers["crawler-price"])
    if price > BUDGET_PER_PAGE:
        print("skip", url, "costs", price)
        return None
    h = sign({"User-Agent": "ExampleBot/1.0", "crawler-exact-price": f"USD {price}"}, url)
    r = requests.get(url, headers=h, timeout=30)
    if r.status_code == 200 and "crawler-charged" in r.headers:
        spent += parse_usd(r.headers["crawler-charged"])
    elif "crawler-error" in r.headers:
        print("paid fetch failed:", r.headers["crawler-error"])
    return r
03 — Section

Web Bot Auth: why an unsigned crawler cannot pay

Charging a crawler only works if nobody else can claim to be that crawler. User-Agent strings can be copied, so Pay per Crawl relies on Web Bot Auth, Cloudflare's implementation of two IETF drafts (a key directory draft and a Web Bot Auth architecture draft) built on HTTP Message Signatures (RFC 9421).

Step 1, key. Generate an Ed25519 key pair; Cloudflare supports Ed25519 for this.

Step 2, directory. Host the public key as a JSON Web Key Set at /.well-known/http-message-signatures-directory over HTTPS, with the directory response itself signed so nobody can mirror it and register on your behalf.

Step 3, registration. Submit the bot through the Bot Submission Form in the Cloudflare dashboard with Request Signature as the verification method, choosing "Verified Bot" or "Signed Agent".

Step 4, sign every request. Send signature-agent, signature-input (with tag="web-bot-auth", the key thumbprint as keyid, and created / expires) and signature. Sign at least @authority. For Pay per Crawl, the docs add that the payment header (crawler-exact-price or crawler-max-price) "must be included in the signature-input header components".

After that, a crawler operator connects a Stripe account under the Pay Per Crawl tab of the account settings. The flow in the docs runs: set up the account, verify the crawler, discover payable content, connect Stripe, crawl. Discovery has its own endpoint, crawlers-api.ai-audit.cfdata.org/charged_zones, which returns, for a signed crawler, the list of domains that have set it to Charge.

In our X sample this is the least discussed part of the feature: only 6 of 270 posts (2.2%) mention Web Bot Auth or signed agents, against 13.7% that mention HTTP 402.

04 — Section

The publisher side: setting a price

For a site owner the setup is dashboard work, not code. The docs list five steps: enable Pay per Crawl in account settings (the domain must be set to Visible), set a price, select which crawlers to charge, monitor activity, and connect a payout account.

One price per zone. The default price applies to every page and to every crawler set to Charge. The FAQ answers "Can I set different prices for different AI crawlers?" with "No." The minimum is $0.001 USD per crawl.

Dynamic pricing. With "Enable dynamic pricing" switched on, the origin (or a Cloudflare Worker in front of it) can add a crawler-price header to a response, and that price replaces the zone default for that page. The edge tells the origin which mode applies through the cf-pay-per-crawl request header: zone-default, in-band, or a third value for requests that are not subject to payment, such as ordinary visitors.

Free paths. Configuration Rules can turn Pay per Crawl off for URI patterns, for example a homepage or a public directory. Five paths are always free: /robots.txt, /sitemap.xml, /security.txt, /.well-known/security.txt and /crawlers.json.

Payouts. Publishers need a dedicated Stripe Connect account created from the Cloudflare dashboard ("Pre-existing Stripe accounts are not compatible"). Cloudflare records a charge on each successful paid delivery, aggregates them, and pays publishers in good standing monthly, subject to settlement periods and minimum payout thresholds. The docs also note that the accrued balance is not yet visible in the dashboard.

To put the price floor in perspective: at the docs' example price of USD 0.01, 1,000 paid pages cost a crawler $10; at the $0.001 minimum, $1. Re-crawls are charged again each time.

05 — Section

From Pay per Crawl to Pay Per Use and the Monetization Gateway

Cloudflare itself has said that a crawl is a rough measure of value. Its July 1, 2026 post "Making AI search smarter" put it this way: "crawling is a crude measure of value. A single page might be crawled once and then cited in thousands of answers, or crawled over and over and never used at all. ... So we're starting to shape Pay Per Crawl into Pay Per Use."

Pay Per Use (beta since September 30, 2026). An AI company defines the use it will pay for (for example, returning an excerpt in a search answer) and sets a price; publishers accept or decline offers in the dashboard under Monetize; the buyer reports each use as a line of JSON to a Cloudflare API, and Cloudflare bills the buyer and pays the publisher monthly. Usage is self-reported under the program terms. Cloudflare's announcement says plainly: "Pay Per Crawl, which we launched in 2025, charges for access. Pay Per Use pays for what happens next. Publishers can choose the model that suits them." Cloudflare named Ceramic.ai and You.com as early partners in July.

Monetization Gateway (closed beta since September 30, 2026). This is the x402 side of Cloudflare's 402 work: a domain owner can charge agents per request for a website, API, MCP tool or dataset, with payment settled in USDC on Base through Coinbase's x402 facilitator. Cloudflare describes it as being for resources "where every request is the use, like APIs, tools, and data", and points high-value content toward Pay Per Use.

So "HTTP 402 on Cloudflare" now means one of three things, and they are easy to mix up:

ProductWho paysUnitPayment railStatus
Pay per CrawlVerified AI crawlerEach successful fetchCloudflare bills via StripeClosed beta
Pay Per UseVerified AI buyerEach reported useCloudflare bills, monthly payoutBeta
Monetization GatewayAgent with a walletEach request, priced by rulesx402, USDC on BaseClosed beta

Pay per Crawl uses its own crawler-* headers, not the x402 payment payload. Our x402 explainer covers that protocol, and the agentic payments overview compares x402 with the card-network and Stripe approaches.

06 — Section

What X says about Pay per Crawl: a study of every post we could find

We searched X for "pay per crawl", "pay-per-crawl" and paypercrawl, read every page the search returned until it ran out, added the top-ranked results, and removed duplicates. That gave 270 posts from 227 authors, from the July 2025 launch to the time of collection in 2026. We also read the latest 200 posts of @Cloudflare and 140 of @CloudflareDev.

The conversation comes in bursts tied to announcements. The launch month brought 45 posts. Then interest nearly stopped: 10 posts in the eight months from September 2025 to April 2026. It came back from May 2026 and peaked at 53 posts in July 2026, the month Cloudflare said it was turning Pay per Crawl into Pay Per Use. 61.5% of all posts we found were written from July 2026 on.

Bar chart of X posts mentioning pay per crawl by month. July 2025: 45; August 2025: 8; then 10 posts in total from September 2025 to April 2026; May 2026: 14; June: 27; July 2026: 53; August: 41; September: 12; October: 20; November (partial): 40. July 2025 and July 2026 are highlighted as the launch and the Pay Per Use announcement.
Posts that name Pay per Crawl, by month. 270 posts, 227 authors, collected in 2026. Search returns what X indexes, not every post ever written.
07 — Section

What the posts talk about, and who gets attention

Most posts frame Pay per Crawl as a fight between AI crawlers and publishers. 46.7% mention crawlers, bots or scrapers, 20.4% mention blocking and 18.1% mention publishers. Agents come up in 34.1%. The mechanics are rarer: HTTP 402 appears in 13.7% of posts, a price in 12.2%, and Web Bot Auth in 2.2%. x402 appears in 12.2%, which is one reason the two get confused.

Signal in the postPostsShare
AI crawlers, bots, scrapers12646.7%
agents9234.1%
blocking5520.4%
publishers4918.1%
HTTP 4023713.7%
x4023312.2%
Pay Per Use197.0%
robots.txt103.7%
Web Bot Auth or signed agents62.2%

Attention is concentrated. The median post got 6 likes and about 956 views; the 90th percentile reached 58 likes and about 19,523 views. The ten most-liked posts hold 57.8% of all likes in the sample. 82.8% of authors carry a verification badge, and 173 posts are in English, with Japanese (22) and Chinese (13) next.

Cloudflare's own accounts mention it rarely. Of 175 original posts on @Cloudflare over about 54 days, 5 were about crawlers or paid access (2.9%), and 1 named Pay Per Use or Pay per Crawl directly (the September 30, 2026 Pay Per Use beta). Those few posts drew a median of 293 likes against 102.5 for everything else. @CloudflareDev had 0 such posts out of 97; agents were the bigger theme on both accounts (16.6% and 20.6% of posts).

Horizontal bar chart of what X posts about Pay per Crawl mention: AI crawlers, bots or scrapers 46.7%; agents 34.1%; blocking 20.4%; publishers 18.1%; HTTP 402 13.7%; a price 12.2%; x402 12.2%; Pay Per Use 7.0%; robots.txt 3.7%; Web Bot Auth or signed agents 2.2%.
Share of the 270 posts that mention each term (keyword match; posts can match several). Collected in 2026.
08 — Section

What Pay per Crawl means if you need Twitter (X) data

Pay per Crawl is opt-in per zone: a site only charges if its owner turned it on and set your crawler to Charge. Being on Cloudflare is not the same as selling crawls. x.com is an example. A request for x.com/robots.txt comes back with server: cloudflare envoy and a cf-ray header, so X's traffic passes through Cloudflare's network, yet the same robots.txt ends with User-agent: * and Disallow: /, disallows Google-Extended and Meta's AI agents by name, and adds a __usage_ai-training group that disallows everything. There is no published price an AI crawler can pay to fetch x.com pages.

The licensed route to X data is an API. The official one is X's own, and its pay-per-usage rate card at docs.x.com/x-api/getting-started/pricing charges $0.005 per post read and $0.010 per user read, capped at 3 million post reads a month before Enterprise, with $20 of credits on a first card and a match of up to $50. TwitterAPI.io returns the same posts as JSON at $0.15 per 1,000 tweets returned, against $5 per 1,000 on that rate card, about 33x less; profiles cost $0.18 per 1,000. A search that finds nothing costs the 15-credit minimum, $0.00015.

Way to get X dataPrice per 1,000 postsWhat you need
X API, pay-per-usage rate card$5.00 ($0.005 per post read)X developer account, card
TwitterAPI.io REST API$0.15 (per tweet returned)API key, no X account needed
Pay per Crawl on x.comnot offeredx.com robots.txt disallows all crawlers

Our own study is a worked example. Reading every post about Pay per Crawl plus two timelines took 43 requests that returned 782 tweets, which comes to about $0.12. Keeping a watch on the topic is cheap too: a check every 5 minutes that usually finds nothing costs about $1.30 a month at the minimum, plus $0.15 per 1,000 posts it does return. Every account starts with up to $1 of free credits (at most 100,000 credits, no card, one per person or network, expiring after 31 days) for new accounts that pass the automatic bot check; purchased credits never expire. Rate limits are 0.2 requests per second before the first payment and 20 after; plans and higher tiers are on the pricing page.

For agents, the same endpoints are available as an MCP server at mcp.twitterapi.io/mcp with an Authorization: Bearer header, so an agent can search X without crawling anything.

09 — Section

How we collected this

Question. How is Cloudflare Pay per Crawl discussed on X, and how much of Cloudflare's own posting is about AI crawlers and paid access?

Queries and accounts. /twitter/tweet/advanced_search with "pay per crawl" (queryType Latest, read until has_next_page was false), "pay-per-crawl" OR paypercrawl (Latest, until exhausted) and "pay per crawl" (Top, 5 pages); /twitter/user/last_tweets for @Cloudflare (10 pages) and @CloudflareDev (8 pages, about 56 days).

Sample. 270 unique posts from 227 authors, from July 2025 to the time of collection; 200 and 140 timeline posts. 43 requests, 782 tweets returned. Collected in 2026.

Method. Duplicates removed by tweet id. Topic flags are case-insensitive keyword matches on post text, so a post can match several and a post that discusses a topic without the keyword is missed. Engagement figures are the counts at collection time.

What it cannot show. X search returns what X indexes, not every post ever written, and the November figure is a partial month. Keyword flags measure vocabulary, not opinion. The sample says nothing about how many sites use Pay per Crawl or how much money it moves; Cloudflare does not publish those figures.

Privacy. Aggregates only. Search authors are mostly private individuals, so their posts are not stored in our study folder; only de-identified rows (month, language, counts, flags) are kept. Organization accounts are named.

python
# Reproduce the study: every X post that names Pay per Crawl, counted by month.
import re
from collections import Counter
from datetime import datetime

import requests

API_KEY = "YOUR_API_KEY"          # from the TwitterAPI.io dashboard
BASE = "https://api.twitterapi.io"
HEADERS = {"X-API-Key": API_KEY}


def search(query, query_type="Latest", max_pages=40):
    cursor, tweets = "", []
    for _ in range(max_pages):
        r = requests.get(f"{BASE}/twitter/tweet/advanced_search", headers=HEADERS,
                         params={"query": query, "queryType": query_type, "cursor": cursor}, timeout=30)
        r.raise_for_status()
        data = r.json()
        tweets += data.get("tweets", [])
        if not data.get("has_next_page"):
            break
        cursor = data.get("next_cursor", "")
    return tweets


posts = {}
for q in ['"pay per crawl"', '"pay-per-crawl" OR paypercrawl']:
    for t in search(q):
        posts[t["id"]] = t

by_month = Counter(
    datetime.strptime(t["createdAt"], "%a %b %d %H:%M:%S %z %Y").strftime("%Y-%m") for t in posts.values()
)
for month in sorted(by_month):
    print(month, by_month[month])

flags = {"http_402": r"\b402\b", "x402": r"\bx402\b", "web_bot_auth": r"web bot auth|signed agent"}
for name, rx in flags.items():
    n = sum(1 for t in posts.values() if re.search(rx, t.get("text") or "", re.I))
    print(f"{name}: {n} of {len(posts)} posts")

likes = sorted(t.get("likeCount") or 0 for t in posts.values())
print("median likes:", likes[len(likes) // 2] if likes else 0)

Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.

10 — Questions

Questions readers ask

Is Cloudflare Pay per Crawl available to everyone?

No. It was announced in private beta on July 1, 2025, and Cloudflare's docs still say "Pay per crawl is currently in closed beta." Site owners and crawler operators join through Cloudflare's signup form or, for Enterprise customers, their account executive. AI Crawl Control itself, which includes allow and block controls for AI crawlers, has been generally available since August 28, 2025.

How much does Pay per Crawl cost?

The site owner sets the price. It is one price per zone (domain) for all crawlers set to Charge, with a minimum of $0.001 USD per crawl; Cloudflare's docs use USD 0.01 as the example. With dynamic pricing switched on, the origin can set a different price per response with a crawler-price header. Each re-crawl is charged again, and error responses are never billed.

What headers does Pay per Crawl use?

crawler-price (the price, sent with a 402), crawler-exact-price (the crawler agrees to that exact price), crawler-max-price (the crawler's maximum), crawler-charged (what was billed, sent with a 200) and crawler-error (an error code). Toward the origin, Cloudflare adds cf-pay-per-crawl with the pricing mode. Every paid request also carries the Web Bot Auth headers signature, signature-input and signature-agent.

Is Pay per Crawl the same as x402?

No. Both use HTTP 402 Payment Required, but Pay per Crawl uses Cloudflare's own crawler-* headers, requires a verified crawler signed with Web Bot Auth, and bills through Cloudflare and Stripe. x402 is an open protocol where the client pays per request, usually in USDC. Cloudflare's x402 product is the Monetization Gateway, in closed beta since September 30, 2026.

What is the difference between Pay per Crawl and Pay Per Use?

Pay per Crawl charges for each successful fetch. Pay Per Use, in beta since September 30, 2026, pays the publisher when an AI company reports using the content, such as quoting it in an answer, at a price the AI company offers and the publisher accepts. Cloudflare says publishers can choose the model that suits them.

Do I get charged for robots.txt or for errors?

No. /robots.txt, /sitemap.xml, /security.txt, /.well-known/security.txt and /crawlers.json are always free to crawl, and charges are only recorded for successful responses, even if a price header was sent with a request that failed.

Can I use Pay per Crawl to get Twitter (X) data?

No. x.com is served through Cloudflare's network, but its robots.txt disallows all crawlers and X does not offer paid crawling. X data is available through X's official API ($0.005 per post read on its pay-per-usage rate card) or through TwitterAPI.io at $0.15 per 1,000 tweets returned, with no X account needed.

11 — Further reading

Continue

Sources & further reading
More from this series

Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.

Build it

Stop reading. Start building.

Starter credits cover real testing on real data. Google sign-in, no card, no application queue.

Get an API key

Already building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.