> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 2Captcha API reference

> API reference for the 2Captcha plugin in Corsair: every `twocaptcha.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Account

### balance

`account.balance`

Read the account balance in USD

**Risk:** `read`

```ts theme={null}
await corsair.twocaptcha.api.account.balance({});
```

**Input:** *empty object*

`balance` is in USD.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `errorId` | `number` | Yes | — |
| `balance` | `number \| string` | Yes | — |

***

### reportCorrect

`account.reportCorrect`

Report that the site accepted a task answer

**Risk:** `destructive`

```ts theme={null}
await corsair.twocaptcha.api.account.reportCorrect({ task_id: 734920165 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `number \| string` | Yes | A task whose answer the site accepted |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `errorId` | `number` | Yes | — |
| `status` | `string \| null` | No | — |

***

### reportIncorrect

`account.reportIncorrect`

Report that the site rejected a task answer; 2Captcha reviews it and may refund the task

**Risk:** `destructive`

```ts theme={null}
await corsair.twocaptcha.api.account.reportIncorrect({ task_id: 734920165 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `number \| string` | Yes | A task whose answer the site rejected; 2Captcha reviews the complaint and may refund it |

Files a complaint about the answer. 2Captcha reviews it and may refund the task; it does not solve it again.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `errorId` | `number` | Yes | — |
| `status` | `string \| null` | No | — |

***

## Tasks

### create

`tasks.create`

Create a captcha-solving task, which the account pays for; returns the task id to poll

**Risk:** `destructive`

```ts theme={null}
await corsair.twocaptcha.api.tasks.create({ type: 'RecaptchaV2TaskProxyless', task: { websiteURL: 'https://example.com/login', websiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `string` | Yes | The captcha kind, such as RecaptchaV2TaskProxyless, RecaptchaV3TaskProxyless, TurnstileTaskProxyless, GeeTestTaskProxyless or ImageToTextTask; the \*Task variants without "Proxyless" take your proxy fields |
| `task` | `object` | Yes | The fields for this kind, sent inside the task object next to `type` |
| `language_pool` | `string` | No | Worker language for image and text captchas, such as en |
| `soft_id` | `number` | No | Software catalog id; leave it out to send none |
| `callback` | `string` | No | A registered URL 2Captcha POSTs the result to; this plugin does not receive it, so poll tasks.result |

Charges the account per task. `type` names the captcha kind and `task` carries that kind's fields; returns `taskId`.

> [accordion] task full type
>
> ```ts theme={null}
> {
>   websiteURL?: string,
>   websiteKey?: string,
>   websitePublicKey?: string,
>   recaptchaDataSValue?: string,
>   pageAction?: string,
>   minScore?: number,
>   enterprisePayload?: Record<string, JsonValue>,
>   isInvisible?: boolean,
>   userAgent?: string,
>   cookies?: string,
>   proxyType?: http | https | socks4 | socks5,
>   proxyAddress?: string,
>   proxyPort?: number | string,
>   proxyLogin?: string,
>   proxyPassword?: string,
>   gt?: string,
>   challenge?: string,
>   body?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `errorId` | `number` | Yes | — |
| `taskId` | `number \| string` | Yes | — |

***

### result

`tasks.result`

Read a task result: processing while workers solve it, then ready with the solution and cost

**Risk:** `read`

```ts theme={null}
await corsair.twocaptcha.api.tasks.result({ task_id: 734920165 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `number \| string` | Yes | The task id `tasks.create` returned |

`status` is `processing` until workers finish, then `ready` with `solution` and `cost` (USD). Poll every 5-10 seconds.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `errorId` | `number` | Yes | — |
| `status` | `string` | Yes | `ready` or `processing` |
| `solution` | `Record<string, JsonValue> \| null` | No | — |
| `cost` | `number \| string \| null` | No | — |
| `ip` | `string \| null` | No | — |
| `createTime` | `number \| null` | No | — |
| `endTime` | `number \| null` | No | — |
| `solveCount` | `number \| null` | No | — |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.