When CapMonster Cloud "does not work", the response almost always tells you why: a non-zero errorId with an errorCode such as ERROR_ZERO_BALANCE, ERROR_CAPTCHA_UNSOLVABLE or ERROR_WRONG_USERAGENT. If there is no error but the site still blocks you, the task was usually created in the wrong mode (a Turnstile widget task sent for a full-page Cloudflare challenge), with stale dynamic parameters, or the result is being replayed with a different proxy or User-Agent. Match your error in the table below and apply the fix before you change tools.
Every error code and parameter on this page comes from CapMonster Cloud's own documentation at docs.capmonster.cloud, and the token and cookie rules come from Cloudflare's documentation.
Quick answer: what your CapMonster Cloud error means
createTask and getTaskResult return {"errorId": 0} on success. Any other errorId comes with an errorCode (and an errorDescription). Find yours below.
- ERROR_KEY_DOES_NOT_EXIST
- The API key was not found or is in the wrong format. Copy the key again from your dashboard, check that it is active, and strip spaces or newlines from the environment variable.
- ERROR_ZERO_BALANCE
- Not enough funds to solve. Top up the balance and resubmit the task.
- CAPTCHA_NOT_READY
- Not an error: the task is still being solved. Call getTaskResult again, at least 2 seconds apart. CapMonster says a Turnstile result can take 5 to 20 seconds depending on load.
- ERROR_TOO_MUCH_REQUESTS
- You exceeded the request limit. Increase the interval between calls; poll getTaskResult no more than once every 2 seconds.
- ERROR_CAPTCHA_UNSOLVABLE
- The task could not be solved. Usually temporary: create a new task. If it repeats, check that the parameters are correct and current. Unsolved tasks are not charged.
- ERROR_WRONG_USERAGENT
- The userAgent you sent is not accepted. Use the current value CapMonster publishes at capmonster.cloud/api/useragent/actual, then send your own requests with that same UA.
- ERROR_INVALID_TASK / ERROR_TASK_NOT_SUPPORTED / ERROR_TASK_ABSENT
- The task object is invalid, mistyped or missing. Read errorDescription: it names the invalid fields. Check type ("TurnstileTask"), cloudflareTaskType and that the JSON has a task object.
- ERROR_PROXY_MISSING / ERROR_PROXY_NOT_AUTHORISED / ERROR_PROXY_CONNECT_REFUSED / ERROR_PROXY_BANNED
- Your proxy is missing, rejected or blocked. Provide proxyType, proxyAddress and proxyPort, check proxyLogin and proxyPassword (no % character), or use a proxy the target site has not banned.
- ERROR_IP_NOT_ALLOWED / ERROR_IP_BANNED / ERROR_IP_BLOCKED
- Your calling IP is refused. Add your IP to the trusted list in the dashboard, or stop for a while: bans follow many invalid or failed requests.
- cf_clearance returned, but the site still answers 403 / "Just a moment..."
- The cookie is used outside the context it was issued for. Replay it through the same proxy and with the same userAgent you sent in the task, and send a fresh htmlPageBase64 for each solve.
Why CapMonster Cloud tasks fail
Most failures fall into one of four groups, and each has a different fix:
- Account and request errors (key, balance, IP, malformed task). The task never reaches the solver; fix your code or dashboard settings.
- Polling too fast. CAPTCHA_NOT_READY is normal, but calling getTaskResult in a tight loop leads to ERROR_TOO_MUCH_REQUESTS and, with enough failed calls, ERROR_IP_BANNED.
- The wrong task mode or stale parameters. CapMonster uses one type, TurnstileTask, for a Turnstile widget and for a Cloudflare challenge page, and the two need different fields. Several values change on every page render.
- A valid result replayed in the wrong context: different proxy, different User-Agent, or a token used after it expired.
Account, key and task errors
These come back from createTask immediately and retrying without a change will return the same error:
- ERROR_KEY_DOES_NOT_EXIST: the key is wrong, inactive or badly formatted. ERROR_ZERO_BALANCE: top up first.
- ERROR_IP_NOT_ALLOWED: your account restricts the key to trusted IPs; add the server's IP in the settings. ERROR_IP_BANNED and ERROR_IP_BLOCKED follow many invalid or failed requests; the docs say not to retry immediately.
- ERROR_TASK_ABSENT (no task object or invalid JSON), ERROR_TASK_NOT_SUPPORTED and ERROR_NO_SUCH_METHOD (wrong type value): check the request structure and spelling.
- ERROR_INVALID_TASK: the request is valid JSON but some required data is missing, invalid or expired. errorDescription lists the fields to fix.
- ERROR_NO_SUCH_CAPCHA_ID / WRONG_CAPTCHA_ID: the taskId is wrong or its result storage period has expired. Retrying with the same taskId will not help; create a new task.
- ERROR_DOMAIN_NOT_ALLOWED: CapMonster Cloud does not accept tasks for certain domains. There is no setting to change.
CAPTCHA_NOT_READY and ERROR_TOO_MUCH_REQUESTS: poll at the right pace
After createTask returns a taskId, call getTaskResult until the status is ready. CapMonster's guidance is to keep at least 2 seconds between getTaskResult calls; the Turnstile page says a result can take 5 to 20 seconds depending on load. A loop that sleeps 2 to 3 seconds, stops on any real error and gives up after a fixed number of attempts avoids both ERROR_TOO_MUCH_REQUESTS and runaway retries. The cf_clearance example further down includes such a loop.
ERROR_CAPTCHA_UNSOLVABLE is a different case: the task has finished and failed. Do not keep polling the same taskId; create a new task. If it repeats on one site, the parameters are the likely cause (next section).
Turnstile widget or Cloudflare challenge: pick the right TurnstileTask
CapMonster documents three set-ups under the same type, TurnstileTask. Sending the wrong one is the most common reason for unsolvable tasks or rejected results.
- Turnstile widget on a form: websiteURL and websiteKey (format 0x4AAAAAAA...), optionally pageAction, data (cData) and userAgent. CapMonster uses its built-in proxies by default and suggests your own proxy only when the site does not accept the token. If your proxy uses IP authorization, whitelist 65.21.190.34.
- Cloudflare challenge, token mode: add cloudflareTaskType "token", plus the required pageAction (usually "managed" or "non-interactive"), userAgent, data (cData) and pageData (chlPageData), all taken from the window.turnstile.render() call. apiJsUrl is optional. The token is then passed to the page's callback.
- Cloudflare challenge, cookie mode: cloudflareTaskType "cf_clearance", websiteKey can be any string, htmlPageBase64 is the base64 of the 403 "Just a moment" page, userAgent is required, and a full proxy (type, address, port, login, password) is mandatory. The result is solution.cf_clearance.
Dynamic parameters and ERROR_WRONG_USERAGENT
CapMonster warns that some values are dynamic and change with each render of the page: cData, chlPageData and the challenge HTML. Extract them immediately before creating the task. A task built from a page you loaded a minute ago can fail as unsolvable, or return ERROR_TOKEN_EXPIRED ("the provided token or challenge has expired"), and resubmitting the same data returns the same error.
ERROR_WRONG_USERAGENT means the userAgent in the task is not accepted. CapMonster's docs list one current Windows Chrome value and publish the latest at capmonster.cloud/api/useragent/actual. Use that exact string in the task, and in every request you make afterwards with the result.
cf_clearance returned but the site still blocks you
A cf_clearance cookie is not a password you can paste anywhere. Cloudflare documents that the clearance cookie is tied to the specific visitor and device it was issued to, and that it stays valid for the zone's configured Challenge Passage. In practice that means:
- Send every follow-up request through the same proxy you put in the task. A rotating proxy that changes IP between solve and replay is a common cause of an immediate new challenge.
- Use exactly the userAgent you sent in the task, in the HTTP header and, if you use a browser, in its configuration.
- Capture htmlPageBase64 through that same proxy and UA, right before creating the task.
- When the clearance expires, solve again. In token mode, remember that Cloudflare documents Turnstile tokens as valid for 300 seconds and meant for single use.
- ERROR_PROXY_BANNED means the target already blocks that proxy IP; no solve will fix it. Change the proxy.
import base64
import time
import requests
CM = "https://api.capmonster.cloud"
KEY = "YOUR_CAPMONSTER_KEY"
URL = "https://example.com/"
# Use the value currently published at capmonster.cloud/api/useragent/actual
UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ..."
PROXY_URL = "http://user:pass@1.2.3.4:8080"
proxies = {"http": PROXY_URL, "https": PROXY_URL}
# 1) Fetch the 403 "Just a moment..." page through the SAME proxy and UA
page = requests.get(URL, headers={"User-Agent": UA}, proxies=proxies)
html_b64 = base64.b64encode(page.content).decode()
task = {
"type": "TurnstileTask",
"websiteURL": URL,
"websiteKey": "xxxxxxxxxx", # any string in cookie mode
"cloudflareTaskType": "cf_clearance",
"htmlPageBase64": html_b64,
"userAgent": UA,
"proxyType": "http",
"proxyAddress": "1.2.3.4",
"proxyPort": 8080,
"proxyLogin": "user",
"proxyPassword": "pass",
}
r = requests.post(f"{CM}/createTask", json={"clientKey": KEY, "task": task}).json()
if r["errorId"] != 0:
raise RuntimeError(r.get("errorCode")) # ERROR_INVALID_TASK: read errorDescription
# 2) Poll no more than once every 2 seconds
for _ in range(40):
time.sleep(3)
res = requests.post(f"{CM}/getTaskResult",
json={"clientKey": KEY, "taskId": r["taskId"]}).json()
if res.get("errorCode") == "CAPTCHA_NOT_READY" or res.get("status") == "processing":
continue
if res["errorId"] != 0:
raise RuntimeError(res.get("errorCode")) # e.g. ERROR_CAPTCHA_UNSOLVABLE
break
# 3) Replay with the same proxy and the same User-Agent
s = requests.Session()
s.proxies = proxies
s.headers["User-Agent"] = UA
s.cookies.set("cf_clearance", res["solution"]["cf_clearance"], domain="example.com")
print(s.get(URL).status_code)When to switch to a Cloudflare-focused API
CapMonster Cloud covers many captcha types, and most of the errors above are configuration problems you can fix. Keep it if you need that breadth.
If your workload is mainly Cloudflare and most of your code is about capturing the challenge HTML, matching user agents and polling, a synchronous API is simpler. For reference, capmonster.cloud/en/prices lists Cloudflare Turnstile at $1.30 per 1,000 and Cloudflare Bot Challenge at $1.30 per 1,000 (checked 2026-12-01). NSLSolver charges $0.80 per 1,000 Turnstile solves and $1.00 per 1,000 Cloudflare Challenge solves, billed only on success.
NSLSolver supports Cloudflare Turnstile, Cloudflare Challenge, reCAPTCHA v3 / Enterprise, Kasada and Akamai (beta). It does not solve reCAPTCHA v2, hCaptcha, image or text captchas, FunCaptcha, GeeTest or DataDome; keep a general-purpose service for those. To compare providers on price and supported types, see CapMonster, CapSolver and 2Captcha alternatives.
The same Cloudflare challenge with NSLSolver
For a full-page challenge you send the url, the challenge site_key and your proxy; the response contains cookies (including cf_clearance) and the user_agent to replay through the same proxy. Omit user_agent in the request (or send an iPhone Safari UA), because the clearance is issued for an iPhone Safari User-Agent. A challenge averages about 3.3 s and a Turnstile token about 250 ms, with no polling.
Only automate sites you own or are authorised to access. Sign up with Google, Gmail or Proton for $0.10 of free credit (about 125 Turnstile solves), no card required.
import requests
API = "https://api.nslsolver.com"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
PROXY = "http://user:pass@host:port"
# Full-page Cloudflare challenge: no HTML capture, no polling
r = requests.post(f"{API}/solve", headers=HEADERS, json={
"type": "challenge",
"url": "https://example.com/",
"site_key": "0x4AAAAAAAxxxxxxxxxxxxxxxx",
"proxy": PROXY,
# omit user_agent: the clearance is issued for the solver's iPhone Safari
}).json()
s = requests.Session()
s.proxies = {"http": PROXY, "https": PROXY} # same IP as the solve
s.cookies.update(r["cookies"]) # includes cf_clearance
s.headers["User-Agent"] = r["user_agent"] # replay exactly this UA
print(s.get("https://example.com/").status_code)
# Turnstile widget on a form: token in the same response
t = requests.post(f"{API}/solve", headers=HEADERS, json={
"type": "turnstile",
"site_key": "0x4AAAAAAAxxxxxxxxxxxxxxxx",
"url": "https://example.com/login",
}).json()["token"]