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.
POST
/createTaskAuthentication
Pass your AnySolver API key as clientKey in the JSON body. Send Content-Type: application/json.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
clientKey | string | Yes | Your AnySolver API key (prefix anysolver_). |
task | object | Yes | Task configuration. Per-task fields documented in Tasks. |
task.type | string | Yes | The task type, for example ReCaptchaV2Token. |
selectionMode | string | No | Per-request routing override: autoCheapest, autoFastest, autoMostReliable, priority. Defaults to the API key's setting. |
keyPoolMode | string | No | all (default) or platformOnly. See Key Pool Mode. |
provider | string | No | Force a specific provider, bypassing routing. |
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()Response body
| Field | Type | Description |
|---|---|---|
errorId | number | 0 on success. See Error IDs for what 1 and 2 mean. |
taskId | string | ULID of the created task. Use it with getTaskResult. |
Example
{
"errorId": 0,
"taskId": "01KFNDF328KAN2AJ3BNHCQYE88"
}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.
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.