# Switch from another solver

> Use your 2Captcha, Anti-Captcha, CapMonster or CapSolver code with Peak Solutions by changing two settings.

Source: https://docs.peak.fo/docs/compat

Already using 2Captcha, Anti-Captcha, CapMonster Cloud or CapSolver? Peak Solutions answers the same `createTask` API they use, so your code works as it is. Change two settings:

1. **The API address:** `https://api.peak.fo`.
2. **The key:** your Peak Solutions key, which starts with `pk_`. Get one in [Dashboard → API keys](https://peak.fo/dashboard/keys).

Everything else stays the same: the task types, the field names, the polling loop, the error codes your code already handles.

## Supported services [#supported-services]

| Your code is written for            | Task types Peak Solutions accepts                              | `taskId`   |
| ----------------------------------- | -------------------------------------------------------------- | ---------- |
| 2Captcha (API v2)                   | `TurnstileTaskProxyless`, `TurnstileTask`                      | A number   |
| Anti-Captcha                        | `TurnstileTaskProxyless`, `TurnstileTask`                      | A number   |
| CapMonster Cloud                    | `TurnstileTask`, including `cloudflareTaskType: "cf_clearance"` | A number   |
| CapSolver                           | `AntiTurnstileTaskProxyLess`, `AntiCloudflareTask`             | A UUID     |

Task type names aren't case-sensitive. Any other task type gets `ERROR_TASK_NOT_SUPPORTED`.

## What each task type solves [#what-each-task-type-solves]

Each task runs as one of the Peak Solutions tasks, with that task's price and rules.

| Task type                                         | Runs as                                                      | Proxy                 |
| ------------------------------------------------- | ------------------------------------------------------------ | --------------------- |
| `TurnstileTaskProxyless`                          | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless)     | Not needed            |
| `AntiTurnstileTaskProxyLess`                      | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless)     | Not needed            |
| `TurnstileTask` with proxy fields                 | [Turnstile](/docs/tasks/turnstile)                           | Yours                 |
| `TurnstileTask` without proxy fields              | [Turnstile (Proxyless)](/docs/tasks/turnstile-proxyless)     | Not needed            |
| `TurnstileTask` with `cloudflareTaskType: "cf_clearance"` | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s) | Yours, required      |
| `AntiCloudflareTask`                              | [5-Second Challenge (WAF)](/docs/tasks/cloudflare-5s)        | Yours, required       |

## How it works [#how-it-works]

<Steps>
<Step>

### Create a task [#create-a-task]

`POST https://api.peak.fo/createTask` with your key and the task. You get a `taskId` back straight away. See [createTask](/docs/compat/create-task).

</Step>
<Step>

### Poll for the result [#poll-for-the-result]

Every 3 to 5 seconds, `POST https://api.peak.fo/getTaskResult` with the `taskId`. It answers `processing` until the solve finishes, then `ready` with the solution. See [getTaskResult](/docs/compat/get-task-result).

</Step>
<Step>

### Use the solution [#use-the-solution]

The solution has the same shape your code already reads: a `token` for Turnstile, or the `cf_clearance` cookie for the 5-second challenge.

</Step>
</Steps>

## Good to know [#good-to-know]

- **HTTP status is always `200`.** Check `errorId`: `0` means it worked, anything else is an error with an `errorCode` and an `errorDescription`. See [Error codes](/docs/compat/errors).
- **You're only charged for solves that work.** The charge happens when the solve finishes, whether or not you collect the result.
- **Collect results within 5 minutes.** A finished task is kept for 5 minutes, about as long as a Turnstile token stays valid. After that, or if Peak Solutions restarts, `getTaskResult` answers `ERROR_NO_SUCH_CAPCHA_ID`. Create a new task.
- **Results are private to your account.** Any of your keys can poll your tasks. Another account's key gets `ERROR_NO_SUCH_CAPCHA_ID`, exactly as for an unknown id.
- **Balance, rate limits and blocked sites** work as on the native API. When you're over your key's rate limit, `createTask` answers `ERROR_NO_SLOT_AVAILABLE` (`ERROR_RATE_LIMIT` for CapSolver code), which these clients already retry.
- **`callbackUrl` is ignored.** Peak Solutions doesn't call back, so poll `getTaskResult`.
- **`softId`, `languagePool`, `pagedata`, `chlPageData` and `pageData` are accepted and ignored.**

## Not supported [#not-supported]

- 2Captcha's older `in.php` / `res.php` API. Use its API v2 (`createTask`) instead.
- Captcha types other than Cloudflare Turnstile and the Cloudflare 5-second challenge.
- Anti-Captcha's `reportIncorrectRecaptcha` and `reportCorrectRecaptcha`. Use [`reportIncorrect`](/docs/compat/reports) instead.

## Or use the native API [#or-use-the-native-api]

The native [`POST /solve`](/docs/api/solve) returns the result in the same request, with no task to create and no polling. It's the simplest choice for new code. Both APIs use the same keys, balance and prices.
