createTask
Create a new CAPTCHA-solving task.
Submit a new CAPTCHA task. AnySolver picks a provider based on your routing strategy, deducts the estimated cost, and returns a taskId to poll on.
/createTaskAuthentication
Pass your AnySolver API key as clientKey in the JSON body. Send Content-Type: application/json.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
clientKey* | string | Yes | Your API key. Create one in the AnySolver dashboard. |
task* | object | Yes | The task body. Required fields depend on the task type. See Tasks for per-task schemas. |
settings | object | No | Per-request settings for routing, auto retry, auto fallback, and proxy behavior. See Routing Strategies. |
Per-task fields go inside task. Browse the full schema for each captcha in Tasks.
Example
{ "clientKey": "your-api-key-from-dashboard", "task": { "type": "ReCaptchaV2TokenProxyLess", "websiteURL": "https://www.google.com/recaptcha/api2/demo", "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-", "pageTitle": "reCAPTCHA demo" }}curl -X POST https://api.anysolver.com/createTask \ -H 'Content-Type: application/json' \ -d '{"clientKey":"your-api-key-from-dashboard","task":{"type":"ReCaptchaV2TokenProxyLess","websiteURL":"https://www.google.com/recaptcha/api2/demo","websiteKey":"6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-","pageTitle":"reCAPTCHA demo"}}'const res = await fetch('https://api.anysolver.com/createTask', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ "clientKey": "your-api-key-from-dashboard", "task": { "type": "ReCaptchaV2TokenProxyLess", "websiteURL": "https://www.google.com/recaptcha/api2/demo", "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-", "pageTitle": "reCAPTCHA demo" }}),});const data = await res.json();import requestsres = requests.post( 'https://api.anysolver.com/createTask', json={ "clientKey": "your-api-key-from-dashboard", "task": { "type": "ReCaptchaV2TokenProxyLess", "websiteURL": "https://www.google.com/recaptcha/api2/demo", "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-", "pageTitle": "reCAPTCHA demo" }},).json()task.proxy
For tasks that require IP matching, task.proxy accepts a single proxy or an array of up to 100 (strings, objects, or a mix). Pass an array when retry or fallback is enabled, so each attempt gets a fresh IP.
{
"task": {
"proxy": [
"http://user:[email protected]:8080",
{ "type": "http", "host": "5.6.7.8", "port": 8080, "username": "user", "password": "pass" }
]
}
}Formats, the sticky-IP requirement, and rotation rules are covered in Proxy Configuration.
Settings
settings is optional. It controls routing, auto retry, auto fallback, proxy reuse, and response statistics for this request, overriding the API key defaults.
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "ReCaptchaV2TokenProxyLess",
"websiteURL": "https://example.com",
"websiteKey": "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
},
"settings": {
"routing": { "mode": "autoCheapest", "keyPoolMode": "all" },
"retry": { "enabled": true, "maxRetries": 2 },
"fallback": { "enabled": true, "maxFallbacks": 2 },
"statistics": true
}
}Defaults and limits
Auto retry and auto fallback are disabled unless you enable them here or on the API key. A task never runs more
than 30 attempts in total, and every attempt re-sends the original task payload: single-use parameters
(one-time tokens, short-lived session values) cannot be refreshed mid-run. Full behavior: Routing
Strategies.
settings.routing
Schema not found: RoutingSettingsSchema
settings.retry
Retries the same provider after a retryable error. maxRetries accepts 0 to 10 extra attempts per provider.
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | No | Enable auto retry. Disabled by default. |
maxRetries | number | No | Maximum retries per provider (additional attempts after the first). |
onErrors | enum[] | No | Error codes that trigger a retry. Defaults to a safe set of transient errors when omitted. |
providerRules | Record<string, unknown> | No | Per-provider retry overrides. A provider only overrides the fields it defines; others inherit the defaults. |
{
"retry": {
"enabled": true,
"maxRetries": 1,
"onErrors": ["TASK_TIMEOUT", "SERVICE_UNAVAILABLE"],
"providerRules": {
"CapSolver": { "maxRetries": 3 }
}
}
}settings.fallback
Moves to the next provider in the routing order after a fallbackable error. maxFallbacks accepts 0 to 20 extra providers.
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | No | Enable auto fallback. Disabled by default. Cannot be combined with a forced provider. |
maxFallbacks | number | No | Maximum number of additional providers to try after the first one. |
onErrors | enum[] | No | Error codes that trigger a fallback. Defaults to a safe set when omitted. |
onErrors only accepts refundable provider-failure codes. The default sets are listed in Error handling.
settings.allowProxyReuse
Boolean, default false. Controls what happens when retry or fallback runs on a proxy task:
false: attempts rotate through thetask.proxyarray. A one-proxy task is rejected, so the same IP is never sent to every attempt by accident.true: a single proxy is allowed and reused on every attempt.
See proxy rotation across attempts.
settings.statistics
Boolean, default false. When enabled, getTaskResult includes the per-attempt retry history:
- Returned while the task is still processing, so you can see why a slow task is taking long.
- Enable it per request here, or key-wide with the Response statistics toggle in the dashboard.
Response body
| Field | Type | Required | Description |
|---|---|---|---|
errorId* | Yes | 0 = success, 1 = external error, 2 = internal error. | |
taskId | string | No | Unique identifier returned when the task was created. |
errorCode | No | Machine-readable error code. | |
errorDescription | string | No | Human-readable error message with resolution hints. |
Examples
{ "errorId": 0, "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"}{ "errorId": 1, "errorCode": "ERROR_ZERO_BALANCE", "errorDescription": "Insufficient account balance. Top up and retry."}Errors
| Error code | Cause | Fix |
|---|---|---|
ERROR_KEY_DOES_NOT_EXIST | API key invalid or missing. | Check the key in API Keys. |
ERROR_ZERO_BALANCE | Insufficient account balance. | Top up in Billing. |
INVALID_TASK_DATA | Missing or invalid task parameters. | Verify the task body matches the schema in Tasks. |
TASK_NOT_SUPPORTED | None of your routing config supports the task type. | Switch to an auto* mode or add a supporting provider in Priority mode. |
NO_PROVIDERS_AVAILABLE | No providers available for this task type. | Try again, or contact support. |
Full list: Error handling.
Validation errors
Invalid settings fail fast with errorCode: "VALIDATION_ERROR" and a precise message. The most common ones:
| Message | Fix |
|---|---|
settings.routing.providerOrder can only be used when settings.routing.mode is "priority". | Drop providerOrder, or set mode to priority. |
settings.routing.provider cannot be used with settings.routing.mode "autoCheapest". … | Remove the auto* mode, or remove the forced provider. |
Priority routing requires a provider order. … | Add providerOrder, or save a priority order on the API key. |
Provider "CapSolver" cannot be in both … providerOrder and … excludedProviders. | Remove the provider from one of the two lists. |
settings.routing.excludedProviders excludes every provider that supports this task type. | Exclude fewer providers, or pick a broader task type. |
A single proxy with auto retry or fallback enabled would reuse the same IP … | Pass multiple proxies, or set allowProxyReuse: true. |
Unknown field settings.allowProxyReUse. Did you mean settings.allowProxyReuse? | Fix the field name. settings rejects unknown keys. |
Notes
- Responses always return HTTP 200. Branch on
errorId, not the HTTP status. - The estimated cost is deducted at create time. Failed tasks are refunded automatically. See Pricing & Billing.
- After receiving
taskId, wait three to five seconds before the firstgetTaskResultpoll.