Cloudflare Challenge vs Turnstile: What’s the Difference?
The Cloudflare challenge gates a page and returns a cf_clearance cookie; Turnstile is a form widget that returns a token. How to tell them apart and handle each.
The short version: a Cloudflare "challenge" is the full-page interstitial that gates an entire site and hands your browser a cf_clearance cookie once you pass. Turnstile is a widget a site embeds inside a specific form; it hands the page a cf-turnstile-response token that the backend checks. One protects a whole URL. The other protects a single submit.
Developers mix these up constantly, and it's fair. Both come from Cloudflare, both can show a checkbox, and both exist to tell bots and humans apart. But they sit at different layers, fire under different conditions, and need completely different handling when you're automating anything against a protected site. Get the distinction wrong and you'll spend hours trying to solve a widget that isn't there, or chasing a cookie when all you needed was a token.
Cloudflare challenge vs Turnstile: the core split
The cleanest way to keep them apart is to ask what gets blocked. A challenge blocks a page load. Turnstile blocks a form submission. If you request a URL and get a holding screen before any of the real content renders, that's a challenge. If the page loads fine but there's a little Cloudflare box sitting next to a login or signup button, that's Turnstile.
The challenge is Cloudflare's edge security running at the CDN layer, before your origin server is even consulted. Turnstile is an opt-in product a developer wires into their own HTML and verifies on their own backend. Same company, two separate systems, and they can both be present on the same domain for different reasons.
What is a Cloudflare challenge?
A challenge is the interstitial page Cloudflare injects when its edge isn't sure about a visitor. You've seen it: "Checking your browser before accessing…", sometimes a spinner, sometimes a Managed Challenge checkbox, sometimes a few seconds of nothing while a background script runs. It's served from Cloudflare's network, not from the site's own servers.
The common types you'll run into:
- Managed Challenge - Cloudflare's default. It decides on the fly whether to show an interactive checkbox, a non-interactive wait, or nothing, based on how the request scores.
- JS Challenge - a JavaScript computation runs in the browser. No clicking, but your client has to execute real JS to pass.
- Interactive Challenge - the explicit checkbox you tick.
When you pass any of these, Cloudflare sets a cf_clearance cookie on your browser for that domain. That cookie is the proof. Send it back on subsequent requests (paired with the same User-Agent and IP that earned it) and Cloudflare lets you through without re-challenging. Lose it, change your IP, or swap your User-Agent, and you're back at the gate. I've written more about the triggers and behavior in what a Cloudflare challenge actually is if you want the deeper teardown.
The trigger is reputation plus behavior. A datacenter IP, a missing or weird header set, a headless browser fingerprint, a burst of requests, a high threat score on the ASN, any of these can tip Cloudflare into challenging you. It's not random, but from the outside it can feel that way because the scoring is opaque.
What is Cloudflare Turnstile?
Turnstile is Cloudflare's CAPTCHA alternative that a developer embeds in a page on purpose. You drop a <div class="cf-turnstile" data-sitekey="..."> into your HTML, load Cloudflare's script, and a widget appears wherever you put it. It's the thing people reach for instead of reCAPTCHA or hCaptcha, usually on login, signup, password reset, contact, or checkout forms.
Turnstile runs in one of three visual modes, set by the site owner:
- Managed - Cloudflare decides whether to show a checkbox or stay quiet.
- Non-interactive - a visible widget that resolves itself, no clicking.
- Invisible - no widget at all; it runs in the background and only surfaces if something looks off.
How does Cloudflare Turnstile work?
When Turnstile finishes, it writes a token into a hidden field named cf-turnstile-response inside the form. The token is a one-time, short-lived string. When the user submits, that token rides along in the POST body. The site's backend then calls Cloudflare's siteverify endpoint (https://challenges.cloudflare.com/turnstile/v0/siteverify) with the token and its secret key, and Cloudflare replies with {"success": true} or a failure plus error codes. No valid token, no accepted submission.
That server-side verification is the whole point. Turnstile doesn't gate the page; it gives the backend a signal to trust or reject a single action. The token expires fast (around 300 seconds) and can't be reused, so you can't mint one and replay it all day.
Cloudflare managed challenge vs Turnstile: side by side
Here's the part people actually bookmark. Note that "Managed" is a concept in both systems, which is a big reason for the confusion. A Managed Challenge gates the page. Managed-mode Turnstile is a widget inside a form that may show a checkbox. Different layers, same adjective.
| Dimension | Cloudflare Challenge (Managed / JS / Interactive) | Turnstile |
|---|---|---|
| What it is | Edge security interstitial that gates a whole URL | Embeddable widget a developer adds to a specific form |
| Where it appears | Full-page screen before any site content loads | Inside a form (login, signup, checkout) on an otherwise-loaded page |
| Who turns it on | Cloudflare edge, automatically, based on request score | The site developer, explicitly, with a sitekey in the HTML |
| What it returns | cf_clearance cookie |
cf-turnstile-response token |
| How it's verified | Cookie replayed on later requests (tied to IP + User-Agent) | Backend posts token to siteverify with the secret key |
| Lifetime | Cookie lasts for a session window (often ~30 min default) | Token is single-use, expires in ~300 seconds |
| Needs a sitekey? | No | Yes, baked into the widget |
| task_type to solve it | cloudflare5stask |
turnstiletaskproxyless |
Why automation treats them differently
This is where the distinction stops being academic. If you're running legitimate automation (QA on your own app, authorized scraping, uptime monitoring, an AI agent doing a task a human okayed), the thing you need back is different for each.
For a challenge, you need a cookie. The goal is a valid cf_clearance that you then attach to an HTTP client (requests, httpx, fetch, your crawler) so every subsequent call to that domain sails through. The catch: that cookie is bound to the IP and User-Agent that earned it. Solve the challenge from one exit node and then fire requests from a different IP, and the cookie's worthless. So the cookie, the IP, and the UA travel together as a set.
For Turnstile, you need a token. You're not trying to load past a wall; you're trying to submit a form that your backend (well, the target's backend) will accept. You grab a fresh cf-turnstile-response, drop it into the form payload, and POST immediately, because the token dies in a few minutes. There's no cookie to carry, no IP binding in the same way. One token, one submission.
Trying to solve the wrong one is the classic failure. People see "Cloudflare" on a page, assume Turnstile, go looking for a sitekey, and find none, because the thing in front of them is a Managed Challenge that wants a cookie. Or the reverse: they get a cf_clearance and still can't log in, because the login form has its own Turnstile widget that needs a token on top of the page clearance. A hardened site can run both.
If you want a sandbox to watch Turnstile behave across all three modes before you build against it, the Cloudflare CAPTCHA test page walkthrough covers what each mode looks like and how the token lands.
Solving both with one API
Peak (peak.fo) handles both from a single endpoint. You POST to https://api.peak.fo/solve with your key in the X-API-Key header, and the task_type tells Peak which problem it is.
For a full-page challenge, you ask for a clearance cookie:
curl -X POST https://api.peak.fo/solve \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"task_type":"cloudflare5stask","url":"https://target.example/gated"}'
That returns a cf_clearance value you attach to your client. For a Turnstile widget, you pass the sitekey too:
import requests
r = requests.post(
"https://api.peak.fo/solve",
headers={"X-API-Key": "YOUR_KEY"},
json={
"task_type": "turnstiletaskproxyless",
"url": "https://target.example/signup",
"sitekey": "0x4AAAAAAA...",
},
)
data = r.json()
token = data["data"]["token"] # cf-turnstile-response, drop into the form
Both calls return the same shape:
{"success": true, "data": {"token": "..."}, "cost": 0.0009}
You pay only for successful solves. Typical turnaround is about a second. Pricing starts at $0.90 per 1,000 solves and drops toward $0.35 at volume, so a batch of a thousand form submissions runs you well under a dollar. The cost field tells you exactly what each solve billed.
Keep it legitimate. This is for QA, authorized scraping, monitoring your own stack, and AI agents acting on a task someone signed off on. Respect the target's ToS and robots.txt, and don't point any of it at credential stuffing or account abuse. Solving a CAPTCHA doesn't grant permission you didn't already have.
Quick field guide
When you hit a Cloudflare wall and need to decide fast, run this check:
- Does the whole page refuse to load behind a holding screen? That's a challenge. You need
cf_clearance. Usecloudflare5stask. - Does the page load but a form won't submit, with a Cloudflare box near the button? That's Turnstile. Find the sitekey in the widget's
data-sitekeyattribute, get a token, useturnstiletaskproxyless. - Both happening on the same site? Solve the challenge first for page access, then solve Turnstile for the form. They stack.
The sitekey for Turnstile is sitting right in the page source, usually on the cf-turnstile div or in the script params. If you can't find one anywhere, you're almost certainly looking at a challenge, not a widget.
Try it against a live widget
If you want to see a real token come back before wiring any of this into your code, point a solve at the live Turnstile tester. It runs all three modes (managed, non-interactive, invisible), and you can watch Peak return a token and the page verify it end to end. Grab a key, send one request, and check the cost field to see how little a solve runs. Then swap turnstiletaskproxyless for cloudflare5stask the next time a full-page challenge gets in your way, and you've covered both halves of Cloudflare's bot wall with the same endpoint.