Altcha has no sitekey and no image to click. It hands the browser a small computing job, and the proof that the job was done is what the site accepts. By the end of this post you will know what is in an Altcha challenge, how to capture it, what the solver sends back (a single token) and where that token goes when you submit the form.
For a shorter overview of the captcha, see the Altcha solver page. If you are new to the different families, what a captcha is and how the types work gives the background.
How Altcha works
Altcha ("Alternative CAPTCHA") is a self-hostable, privacy-oriented widget. Its web component, <altcha-widget>, fetches a challenge from the site's server, computes the answer in a Web Worker and writes the result into a hidden form field. In the default flow there is nothing for the visitor to click.
The cycle has three steps:
- The server issues a fresh, single-use challenge.
- The browser brute-forces a number that satisfies it. That is the proof-of-work.
- The form is submitted with the result, and the server checks it with one cheap verification. It does not call a third-party service.
Because the answer is a computation, not a recognition problem, the solve is deterministic. That is also why a solver API for Altcha is a convenience for outsourcing the CPU work, not a way past something a machine cannot do.
API or local solve
Whether you need the API at all depends on how you submit the form. Decide before you integrate.
- If you drive a real browser and let the widget run, the widget computes the proof by itself in its Web Worker. Nothing for you to solve.
- If your job posts the form with a plain HTTP client, or you do not want to run the widget, you have to produce the proof yourself. That is where
createTaskfits. - The open-source libraries can compute the proof locally. For the default algorithm that is probably the cheaper option for a few requests, but that is untested here, so measure it on your target. Memory-hard algorithms (below) are where outsourcing starts to pay.
The rest of this post is about the second case.
Anatomy of a challenge
The challenge is a JSON object that the site's endpoint returns. The fields you will see:
| Field | Meaning |
|---|---|
algorithm |
The proof-of-work function. PBKDF2/SHA-256 is the default; SHA-256, SHA-384, SHA-512, ARGON2ID and SCRYPT also exist. |
challenge |
The hash the browser's answer has to reproduce. |
salt |
Input to the hash. It may carry a query-like suffix such as ?...&expires=.... |
signature |
The server's signature over the challenge. |
maxnumber |
Upper bound of the search space (name varies between deployments). |
The solved result adds the found number to algorithm, challenge, salt and signature.
Two consequences for you. Challenges are fresh and single-use, and some carry an expiry, so capture one right before you use it and never reuse an old one. And ARGON2ID and SCRYPT are memory-hard (64 to 128 MB) and run in WASM workers, so expect those sites to take longer to solve than the default.
Capture the challenge
Altcha has no sitekey. The closest equivalent is the challenge URL, which can carry its own sitekey or apiKey query value; that value belongs to the URL, not to a separate parameter.
- In DevTools, open the Elements panel and find
<altcha-widget>. Thechallengeurlattribute, or thechallengeattribute when it holds an address, tells you where the widget gets its challenge. - Open the Network tab, reload, and find that request. The endpoint differs from site to site: you may see
/altcha,/api/challenge?sitekey=...or a Sentinel/v1/challenge?apiKey=...URL. - Open the response. It should be the JSON object described above. Copy it byte for byte.
- Note the
websiteURL: the full address of the page that hosts the widget.

If no challenge request shows up, the challenge attribute may hold the challenge data inline instead of a URL. In that case copy the JSON from the attribute and send it as challengeJSON; challengeURL stays required, so take the address from the page's challengeurl attribute or the request that serves it. Identify the captcha and extract its parameters covers the general DevTools routine.
Create the task
The task type is AltchaTokenProxyLess. AltchaToken is accepted as well, and both spellings are proxyless: Altcha never takes a proxy, so there is nothing about proxies to configure.
| Parameter | Required | Meaning |
|---|---|---|
websiteURL |
yes | The page that hosts the widget. |
challengeURL |
yes | The public https URL the widget fetches the challenge from. |
challengeJSON |
no | The challenge JSON exactly as the endpoint returned it, as a string or an object. When present it is solved as given and the URL is not fetched. |
challengeURL is always required. Add challengeJSON when you captured the response and want that exact single-use challenge solved; nothing is fetched then. Without it the solver fetches a fresh challenge from challengeURL itself. Send the browser's userAgent in the task and keep it on replay. challengeURL must be a public https address: the solver refuses URLs that resolve to private or local addresses, so a staging or local endpoint cannot be used. The public catalog (GET /v1/task-types) and the API reference list no separate field for maxnumber, salt or signature: they stay inside the JSON, so pass the JSON through unmodified. Truncating or editing salt, including its query-like suffix, is likely to break verification on the server.
{
"clientKey": "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task": {
"type": "AltchaTokenProxyLess",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
"websiteURL": "https://example.com/form",
"challengeURL": "https://example.com/api/challenge",
"challengeJSON": "{\"algorithm\":\"SHA-256\",\"challenge\":\"4f2d...\",\"salt\":\"8b9a...\",\"signature\":\"MEUCIQ...\",\"maxnumber\":1000000}"
}
}
An accepted task answers {"errorId":0,"taskId":"tsk_...","status":"idle"}.
Read the result
Poll getTaskResult every 3 seconds. It answers {"errorId":0,"status":"processing"} until the solve finishes, then:
{
"errorId": 0,
"status": "ready",
"solution": { "token": "..." }
}
The solution has one key, token, and no userAgent. There is no separate number key either. The docs do not spell out the encoding of the token string, so treat it as opaque: do not decode it, trim it or re-encode it. If you want to see the shape the server expects, solve the widget once in your own browser and look at the value the widget writes into the altcha field after it shows as verified.
API errors arrive as HTTP 200 with errorId: 1 and an errorCode; stop polling on the first one. A non-200 status or a body without errorId is a transport failure. Because every accepted task is charged, and a task that finishes as failed automatically returns its original charge once, capture a fresh challenge and check the points below before you create a retry. See errors and the task lifecycle.
Put the token in the form
The widget writes into a hidden input named altcha by default, so that is where the token goes. Check three things on the page first:
- The widget's
nameattribute can rename the field. Confirm the name in the Elements panel. - A site can configure the widget to use a cookie instead of a field. If it expects an
altchacookie, set that. - Submit the full token. Some servers accept only a bare number, but the solution has no separate number field, only
token. Puttokenin the field unchanged.

For general rules on placing tokens and calling callbacks, see how to submit a captcha token.
Node.js
The generated script has constants at the top for CLIENT_KEY, TARGET_URL, CHALLENGE_URL, FORM_URL and SUCCESS_TEXT; FORM_FIELDS is an optional JSON object with the form's other fields.
// altcha-node.js - solve Altcha and post the token with the form.
// Install: Node.js 18 or newer (no packages).
// Run: node altcha-node.js
const { setTimeout: sleep } = require('node:timers/promises');
// Your SurSolver API key.
const CLIENT_KEY = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// The page that renders the widget, with its path and query string.
const TARGET_URL = 'https://example.com/page';
// The challengeurl attribute of the <altcha-widget> element.
const CHALLENGE_URL = 'https://example.com/altcha/challenge';
// The User-Agent the solve runs with; send the result with this same user agent.
const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36';
// Current application session as a Cookie header value; used on form submission.
const SESSION_COOKIES = '';
// Where the page posts the form (the form action, or the request in DevTools, Network).
const FORM_URL = 'https://example.com/submit';
// The form's other fields as a JSON object, such as {"username":"demo"}.
const FORM_FIELDS = undefined;
// Text that appears only in a response the site accepted.
const SUCCESS_TEXT = 'PASTE_ACCEPTED_MARKER';
const API = 'https://api.sursolver.com';
const POLL_ATTEMPTS = 60;
// API errors are HTTP 200 with errorId 1; anything else is a transport failure.
async function call(path, body) {
const res = await fetch(`${API}${path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
if (data.errorId !== 0) throw new Error(`${data.errorCode}: ${data.errorDescription}`);
return data;
}
async function solve(task) {
const created = await call('/createTask', { clientKey: CLIENT_KEY, task });
for (let attempt = 0; attempt < POLL_ATTEMPTS; attempt += 1) {
const result = await call('/getTaskResult', {
clientKey: CLIENT_KEY,
taskId: created.taskId,
});
if (result.status === 'ready') return result.solution;
await sleep(3000);
}
throw new Error(`task ${created.taskId} was not ready in ${POLL_ATTEMPTS} polls`);
}
// Optional task fields are sent only when they have a value.
function withoutEmpty(fields) {
return Object.fromEntries(
Object.entries(fields).filter(([, value]) => value !== undefined && value !== ''),
);
}
async function main() {
const solution = await solve({
type: 'AltchaTokenProxyLess',
websiteURL: TARGET_URL,
challengeURL: CHALLENGE_URL,
userAgent: USER_AGENT,
});
// Send the token the way the page does; some sites name it differently or send JSON.
// The solve ran with USER_AGENT; the submit presents the same one.
const headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': USER_AGENT,
...(SESSION_COOKIES ? { Cookie: SESSION_COOKIES } : {}),
};
const body = new URLSearchParams({
...(FORM_FIELDS ?? {}),
['altcha']: solution.token,
});
const response = await fetch(FORM_URL, { method: 'POST', headers, body });
const text = await response.text();
if (!response.ok || !text.includes(SUCCESS_TEXT)) {
throw new Error(`The site did not accept the result (HTTP ${response.status}).`);
}
console.log('The site accepted the result.');
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
What it does: creates an AltchaTokenProxyLess task with the page URL and the challenge URL, and the solver fetches a fresh challenge from that URL itself, so what it solves is current rather than a copy you captured earlier. When the result is ready it posts the form with the token in the altcha field — renamed through FORM_FIELDS ordering or your own field handling if the site uses another name — presents the task's required userAgent, and only reports success when the response body contains text that appears on the accepted path (SUCCESS_TEXT), not merely on HTTP 200. If your target needs a browser instead, the generated Playwright variant in the examples hub fills the hidden altcha field — a hidden input is not something fill() can type into, so it writes the value through the DOM — and submits the form.
The proof-of-work check itself holds end to end: in a local run, a solver token obtained with challengeJSON was accepted by the official altcha-lib verifySolution — the verification a site's server runs — while an empty payload, a tampered payload and an already-used payload were each rejected. A token produced by the real widget passed the same check.
Python
pip install requests is the only dependency: fill in the constants at the top and run python altcha-python.py. The solved token is posted into the altcha field of the form URL, and acceptance is judged by the response body containing SUCCESS_TEXT.
# altcha-python.py - solve Altcha and post the token with the form.
# Install: pip install requests
# Run: python altcha-python.py
import time
from urllib.parse import urlsplit
import requests
# Your SurSolver API key.
CLIENT_KEY = "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# The page that renders the widget, with its path and query string.
TARGET_URL = "https://example.com/page"
# The challengeurl attribute of the <altcha-widget> element.
CHALLENGE_URL = "https://example.com/altcha/challenge"
# The User-Agent the solve runs with; send the result with this same user agent.
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
# Current application session as a Cookie header value; used on form submission.
SESSION_COOKIES = None
# Where the page posts the form (the form action, or the request in DevTools, Network).
FORM_URL = "https://example.com/submit"
# The form's other fields as a JSON object, such as {"username": "demo"}.
FORM_FIELDS = None
# Text that appears only in a response the site accepted.
SUCCESS_TEXT = "PASTE_ACCEPTED_MARKER"
API = "https://api.sursolver.com"
POLL_ATTEMPTS = 60
def call(path, body):
# API errors are HTTP 200 with errorId 1; anything else is a transport failure.
response = requests.post(f"{API}{path}", json=body, timeout=30)
response.raise_for_status()
data = response.json()
if data["errorId"] != 0:
raise RuntimeError(f'{data["errorCode"]}: {data["errorDescription"]}')
return data
def solve(task):
created = call("/createTask", {"clientKey": CLIENT_KEY, "task": task})
for _ in range(POLL_ATTEMPTS):
result = call("/getTaskResult", {"clientKey": CLIENT_KEY, "taskId": created["taskId"]})
if result["status"] == "ready":
return result["solution"]
time.sleep(3)
raise TimeoutError(f'task {created["taskId"]} was not ready in {POLL_ATTEMPTS} polls')
def main():
session = requests.Session()
if SESSION_COOKIES:
for part in SESSION_COOKIES.split(";"):
if "=" in part:
name, value = part.strip().split("=", 1)
session.cookies.set(name, value, domain=urlsplit(FORM_URL).hostname, path="/")
solution = solve({
"type": "AltchaTokenProxyLess",
"websiteURL": TARGET_URL,
"challengeURL": CHALLENGE_URL,
"userAgent": USER_AGENT,
})
# The solve ran with USER_AGENT; the submit presents the same one.
headers = {"User-Agent": USER_AGENT}
# Send the token the way the page does; some sites name it differently or send JSON.
response = session.post(
FORM_URL,
data={**(FORM_FIELDS or {}), "altcha": solution["token"]},
headers=headers,
timeout=30,
)
session.close()
if not response.ok or SUCCESS_TEXT not in response.text:
raise SystemExit(f"The site did not accept the result (HTTP {response.status_code}).")
print("The site accepted the result.")
if __name__ == "__main__":
main()
Why a solution gets rejected
| Symptom | Likely cause | Check / fix |
|---|---|---|
ERROR_INVALID_REQUEST mentioning challengeURL on createTask |
The address is missing, private, local or not https | Send the public https challenge endpoint; staging and local endpoints are not reachable |
| Rejection right after a solve that took a while | The challenge expired or was already used | Challenges are single-use and may carry an expires value; fetch a new one, create a new task, submit promptly |
| Rejection with a hand-edited payload | The JSON was altered | Pass salt, signature and the rest through exactly as the endpoint returned them |
| Token present but the site still refuses | The field or cookie is wrong | Check the name attribute and whether the site uses a cookie instead |
| Rejection only on a site that shows text/audio codes sometimes | The site escalated to an interactive challenge | Sites on Altcha Cloud or Sentinel can require a code a proof-of-work result cannot satisfy; an unexplained rejection on such a site is the likely cause |
Next steps
Capture one challenge from your target in DevTools, send it to createTask with the page URL, and compare the returned token with what the widget produces in your browser. The public catalog (GET /v1/task-types) has the full parameter list. If your target uses Friendly Captcha instead, the Friendly Captcha guide covers its sitekey, script URL and token fields.