# Create a sandbox task without a key

> POST /v1/sandbox/tasks: Create a sandbox task without a key. NoptCHA API reference.

Source: https://noptcha.com/docs/api-reference/create-sandbox-task/

POST https://api.noptcha.com/v1/sandbox/tasks

Native API (v1). [Guide](https://noptcha.com/docs/native-api.md). Operation ID `createSandboxTask`.

The keyless sandbox: the same request and response as `POST /v1/tasks` with a test key, but without `Authorization` (it is ignored if sent), so documentation examples run before you sign up. Parameters and `metadata` are validated exactly like `POST /v1/tasks`; answers are the fixed sandbox answers and the magic values (`test-unsolvable`, `test-timeout`, `test-proxy-error`, `test-slow-<seconds>`) work the same way. No solver is called and nothing is charged or recorded in usage.

Task IDs look like `sbx_` followed by 26 characters (`A`–`Z`, `2`–`7`); they are random, so only whoever created a task can read it. Poll `Location` (`/v1/sandbox/tasks/{id}`). Results are kept for 10 minutes.

`Prefer: wait=N` or `?wait=N` waits up to N seconds (at most 90) as in `POST /v1/tasks`. Differences from a test key: `callback_url` is not supported (`422 invalid_params`, pointer `/callback_url`); `Idempotency-Key` is checked but requests are not deduplicated (a retry creates a new sandbox task); the request body may be at most 256 KB, and `params` (with images counted as a few bytes) and `metadata` together may hold at most 4 KB (both `413 request_too_large`).

Limits (starting values): per client IP (per /64 for IPv6, and 10 times as much per /48) 30 new tasks per minute with bursts of 10, and 5 `test-slow-*` tasks still processing; for everyone together 10 requests per second (invalid ones count too) and 100 slow tasks still processing. Over a limit: `429 rate_limited` or `429 concurrency_limited` with `Retry-After`. Use a test key for more.

Browsers may call it from any origin (`Access-Control-Allow-Origin: *`); there is no CORS preflight (`OPTIONS` is not served), so send a simple request: a JSON body as `text/plain` (the default for a string body in `fetch`) and `?wait=` instead of `Prefer`.

## Request

Authentication: the key in the `clientKey` body field ([Keys](https://noptcha.com/docs/authentication.md)).

| Parameter | In | Description |
| --- | --- | --- |
| `Prefer`  optional  | header |  `wait=N`: wait up to N seconds (capped at 90) for the result, RFC 7240.  string · e.g. wait=60  |
| `wait`  optional  | query |  Seconds to wait for the result (capped at 90). Takes precedence over `Prefer: wait`. Values that are not a non-negative integer are ignored.  integer · ≥ 0  |
| `Idempotency-Key`  optional  | header |  1–64 visible ASCII characters (`!` to `~`, no spaces), unique per logical request; kept for 24 hours. Anything else is `400 invalid_request`.  string · pattern: ^\[!-~\]{1,64}$ · e.g. 3f6c2b9e-8d41-4a7f-b0c5-1e2d3a4b5c6d  |

Body (`application/json`, required):

One of (selected by `type`):

-   [`CreateAlibabaTaskRequest`](https://noptcha.com/docs/task-types/alibaba.md) — Alibaba Cloud Captcha (`alibaba`, family `alibaba`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateAltchaTaskRequest`](https://noptcha.com/docs/task-types/altcha.md) — Altcha (`altcha`, family `altcha`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateArcaptchaTaskRequest`](https://noptcha.com/docs/task-types/arcaptcha.md) — ARCaptcha (`arcaptcha`, family `arcaptcha`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateAwsWafTaskRequest`](https://noptcha.com/docs/task-types/aws-waf.md) — AWS WAF (`aws.waf`, family `aws`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateCloudflareChallengeTaskRequest`](https://noptcha.com/docs/task-types/cloudflare-challenge.md) — Cloudflare challenge page (`cloudflare.challenge`, family `cloudflare`, active). Variants: `proxy` (`params.proxy` is required). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateCloudflareWaitingroomTaskRequest`](https://noptcha.com/docs/task-types/cloudflare-waiting-room.md) — Cloudflare Waiting Room (`cloudflare.waitingroom`, family `cloudflare`, beta). Variants: `proxy` (`params.proxy` is required). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateDatadomeTaskRequest`](https://noptcha.com/docs/task-types/datadome.md) — DataDome (`datadome`, family `datadome`, beta). Variants: `proxy` (`params.proxy` is required). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateFengkongTaskRequest`](https://noptcha.com/docs/task-types/fengkong.md) — Shumei (FengkongCloud) (`fengkong`, family `fengkong`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateFriendlycaptchaTaskRequest`](https://noptcha.com/docs/task-types/friendly-captcha.md) — Friendly Captcha (`friendlycaptcha`, family `friendlycaptcha`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateFuncaptchaTaskRequest`](https://noptcha.com/docs/task-types/funcaptcha.md) — FunCaptcha (Arkose Labs) (`funcaptcha`, family `arkose`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 180 seconds fail with `timeout`.
-   [`CreateGeetestTaskRequest`](https://noptcha.com/docs/task-types/geetest.md) — GeeTest (`geetest`, family `geetest`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateHcaptchaTaskRequest`](https://noptcha.com/docs/task-types/hcaptcha.md) — hCaptcha (`hcaptcha`, family `hcaptcha`, active). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateHeytapTaskRequest`](https://noptcha.com/docs/task-types/heytap.md) — HeyTap Captcha (`heytap`, family `heytap`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateHuntTaskRequest`](https://noptcha.com/docs/task-types/hunt.md) — Hunt Captcha (`hunt`, family `hunt`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateImageFuncaptchaTaskRequest`](https://noptcha.com/docs/task-types/image-funcaptcha.md) — FunCaptcha image (`image.funcaptcha`, family `image`, beta). Variants: `proxyless`. Tasks not solved within 60 seconds fail with `timeout`.
-   [`CreateImageGridAwsTaskRequest`](https://noptcha.com/docs/task-types/image-grid-aws.md) — AWS WAF image grid (`image.grid.aws`, family `image`, beta). Variants: `proxyless`. Tasks not solved within 60 seconds fail with `timeout`.
-   [`CreateImageGridHcaptchaTaskRequest`](https://noptcha.com/docs/task-types/image-grid-hcaptcha.md) — hCaptcha image grid (`image.grid.hcaptcha`, family `image`, active). Variants: `proxyless`. Tasks not solved within 60 seconds fail with `timeout`.
-   [`CreateImageGridRecaptchaTaskRequest`](https://noptcha.com/docs/task-types/image-grid-recaptcha.md) — reCAPTCHA image grid (`image.grid.recaptcha`, family `image`, active). Variants: `proxyless`. Tasks not solved within 60 seconds fail with `timeout`.
-   [`CreateImageTextTaskRequest`](https://noptcha.com/docs/task-types/image-to-text.md) — Image to text (`image.text`, family `image`, active). Variants: `proxyless`. Tasks not solved within 60 seconds fail with `timeout`.
-   [`CreateImpervaTaskRequest`](https://noptcha.com/docs/task-types/imperva.md) — Imperva (Incapsula) (`imperva`, family `imperva`, beta). Variants: `proxy` (`params.proxy` is required). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateMtcaptchaTaskRequest`](https://noptcha.com/docs/task-types/mtcaptcha.md) — MTCaptcha (`mtcaptcha`, family `mtcaptcha`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateRecaptchaV2TaskRequest`](https://noptcha.com/docs/task-types/recaptcha-v2.md) — reCAPTCHA v2 (`recaptcha.v2`, family `recaptcha`, active). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateRecaptchaV2EnterpriseTaskRequest`](https://noptcha.com/docs/task-types/recaptcha-v2-enterprise.md) — reCAPTCHA v2 Enterprise (`recaptcha.v2.enterprise`, family `recaptcha`, active). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateRecaptchaV3TaskRequest`](https://noptcha.com/docs/task-types/recaptcha-v3.md) — reCAPTCHA v3 (`recaptcha.v3`, family `recaptcha`, active). Variants: `proxyless`. Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateRecaptchaV3EnterpriseTaskRequest`](https://noptcha.com/docs/task-types/recaptcha-v3-enterprise.md) — reCAPTCHA v3 Enterprise (`recaptcha.v3.enterprise`, family `recaptcha`, active). Variants: `proxyless`. Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateTencentTaskRequest`](https://noptcha.com/docs/task-types/tencent.md) — Tencent Captcha (`tencent`, family `tencent`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateTspdTaskRequest`](https://noptcha.com/docs/task-types/tspd.md) — TSPD (F5) (`tspd`, family `tspd`, beta). Variants: `proxy` (`params.proxy` is required). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateTurnstileTaskRequest`](https://noptcha.com/docs/task-types/turnstile.md) — Cloudflare Turnstile (`turnstile`, family `cloudflare`, active). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.
-   [`CreateYidunTaskRequest`](https://noptcha.com/docs/task-types/yidun.md) — NetEase Yidun (`yidun`, family `yidun`, beta). Variants: `proxyless`, `proxy` (the `proxy` variant when `params.proxy` is given). Tasks not solved within 120 seconds fail with `timeout`.

Example

```json
{
  "params": {
    "website_key": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
    "website_url": "https://example.com/login"
  },
  "type": "recaptcha.v2"
}
```

## Responses

### 200

The task is final (solved or failed).

Headers: `Access-Control-Allow-Origin`, `Location` (optional), `Noptcha-Request-Id`, `Preference-Applied` (optional).

Content: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `completed_at`  optional  | `string` |  When the task became final; absent while processing.  format: date-time · pattern: ^\[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}\\.\[0-9\]{3}Z$  |
| `cost`  required  | `object` |  What the task cost (zero unless solved and charged).  |
| `cost.amount`  required  | `string` |  Decimal US dollars with 6 places.  pattern: ^-?\[0-9\]+\\.\[0-9\]{6}$  |
| `cost.currency`  required  | `const "USD"` |  |
| `created_at`  required  | `string` |  format: date-time · pattern: ^\[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}\\.\[0-9\]{3}Z$  |
| `error`  required  | `one of | null` |  Why the task failed when `status` is `failed`, else `null`.  one of: `TaskError`  |
| `id`  required  | `string` |  Task ID: a 53-bit integer as a string; for the keyless sandbox (`/v1/sandbox/tasks`) `sbx_` and 26 random characters.  pattern: ^(\[0-9\]+|sbx\_\[A-Z2-7\]{26})$  |
| `metadata`  optional  | `object` |  Your own key-value pairs, returned with the task. At most 16 keys; keys 1–64 characters, values strings of at most 256 characters (Unicode code points, as JSON Schema counts them). A value that is not a string is `422 invalid_params` with pointer `/metadata/<key>`.  max 16 keys  |
| `metadata.<any key>`  optional  | `string` |  max length 256  |
| `params`  required  | `object | null` |  The task's parameters with secrets removed (proxy login and password, cookies where the type marks them sensitive) and strings longer than 256 bytes (images) replaced by `"[N bytes]"`. `null` when not available.  |
| `sandbox`  optional  | `const true` |  Present (true) on tasks created with a test key or in the keyless sandbox.  |
| `solution`  required  | `one of | null` |  The answer when `status` is `solved`, else `null`. Its shape depends on `type`.  one of: `Solution`  |
| `status`  required  | `enum` |  one of "processing", "solved", "failed"  |
| `type`  required  | `string` |  Canonical task type, e.g. `recaptcha.v2` (see `CreateTaskRequest`).  |

### 202

The task is still processing; poll `Location`.

Headers: `Access-Control-Allow-Origin`, `Location` (optional), `Noptcha-Request-Id`, `Preference-Applied` (optional).

Content: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `completed_at`  optional  | `string` |  When the task became final; absent while processing.  format: date-time · pattern: ^\[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}\\.\[0-9\]{3}Z$  |
| `cost`  required  | `object` |  What the task cost (zero unless solved and charged).  |
| `cost.amount`  required  | `string` |  Decimal US dollars with 6 places.  pattern: ^-?\[0-9\]+\\.\[0-9\]{6}$  |
| `cost.currency`  required  | `const "USD"` |  |
| `created_at`  required  | `string` |  format: date-time · pattern: ^\[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}\\.\[0-9\]{3}Z$  |
| `error`  required  | `one of | null` |  Why the task failed when `status` is `failed`, else `null`.  one of: `TaskError`  |
| `id`  required  | `string` |  Task ID: a 53-bit integer as a string; for the keyless sandbox (`/v1/sandbox/tasks`) `sbx_` and 26 random characters.  pattern: ^(\[0-9\]+|sbx\_\[A-Z2-7\]{26})$  |
| `metadata`  optional  | `object` |  Your own key-value pairs, returned with the task. At most 16 keys; keys 1–64 characters, values strings of at most 256 characters (Unicode code points, as JSON Schema counts them). A value that is not a string is `422 invalid_params` with pointer `/metadata/<key>`.  max 16 keys  |
| `metadata.<any key>`  optional  | `string` |  max length 256  |
| `params`  required  | `object | null` |  The task's parameters with secrets removed (proxy login and password, cookies where the type marks them sensitive) and strings longer than 256 bytes (images) replaced by `"[N bytes]"`. `null` when not available.  |
| `sandbox`  optional  | `const true` |  Present (true) on tasks created with a test key or in the keyless sandbox.  |
| `solution`  required  | `one of | null` |  The answer when `status` is `solved`, else `null`. Its shape depends on `type`.  one of: `Solution`  |
| `status`  required  | `enum` |  one of "processing", "solved", "failed"  |
| `type`  required  | `string` |  Canonical task type, e.g. `recaptcha.v2` (see `CreateTaskRequest`).  |

### 400

`invalid_request`: the body is not valid JSON or misses a field, a parameter is wrong, `callback_url` is not a string, the result would be too large (usage). `unsupported_type`: the task type does not exist or is not available.

Headers: `Noptcha-Request-Id`, `RateLimit` (optional), `RateLimit-Policy` (optional).

Content: `application/problem+json`

| Field | Type | Description |
| --- | --- | --- |
| `code`  required  | `string` |  Machine-readable error code (see the table).  |
| `detail`  optional  | `string` |  Human-readable explanation of this occurrence.  |
| `request_id`  required  | `string` |  Same as the `Noptcha-Request-Id` header.  |
| `status`  required  | `integer` |  The HTTP status code.  |
| `title`  required  | `string` |  |
| `type`  required  | `string` |  format: uri  |

### 403

`forbidden` (problem details): the request reached the API without passing through our edge network. Infrastructure, not part of the compatibility protocol.

Headers: `Noptcha-Request-Id`.

Content: `application/problem+json`

| Field | Type | Description |
| --- | --- | --- |
| `code`  required  | `string` |  Machine-readable error code (see the table).  |
| `detail`  optional  | `string` |  Human-readable explanation of this occurrence.  |
| `request_id`  required  | `string` |  Same as the `Noptcha-Request-Id` header.  |
| `status`  required  | `integer` |  The HTTP status code.  |
| `title`  required  | `string` |  |
| `type`  required  | `string` |  format: uri  |

### 413

`request_too_large`: the body exceeds the limit (1 MB for image types, 64 KB otherwise). Any request with a body over 1 MB gets this, GET requests included.

Headers: `Noptcha-Request-Id`, `RateLimit` (optional), `RateLimit-Policy` (optional).

Content: `application/problem+json`

| Field | Type | Description |
| --- | --- | --- |
| `code`  required  | `string` |  Machine-readable error code (see the table).  |
| `detail`  optional  | `string` |  Human-readable explanation of this occurrence.  |
| `request_id`  required  | `string` |  Same as the `Noptcha-Request-Id` header.  |
| `status`  required  | `integer` |  The HTTP status code.  |
| `title`  required  | `string` |  |
| `type`  required  | `string` |  format: uri  |

### 422

`invalid_params`: `params` or `metadata` do not match the schema; `errors` lists each problem.

Headers: `Noptcha-Request-Id`, `RateLimit` (optional), `RateLimit-Policy` (optional).

Content: `application/problem+json`

| Field | Type | Description |
| --- | --- | --- |
| `code`  required  | `string` |  Machine-readable error code (see the table).  |
| `detail`  optional  | `string` |  Human-readable explanation of this occurrence.  |
| `request_id`  required  | `string` |  Same as the `Noptcha-Request-Id` header.  |
| `status`  required  | `integer` |  The HTTP status code.  |
| `title`  required  | `string` |  |
| `type`  required  | `string` |  format: uri  |
| `errors`  required  | `array of FieldError` |  One entry per problem, sorted by `pointer`. At most 50 entries; when there are more, `detail` ends with "and N more errors".  max items 50  |
| `errors.[item]`  optional  | `object` |  |
| `errors.[item].message`  required  | `string` |  |
| `errors.[item].pointer`  required  | `string` |  JSON Pointer (RFC 6901) to the offending value, from the root of the request body: `/params/website_key`, `/params/proxy/port`, `/params` for the parameters object itself, `/metadata/order`, `/metadata` for the metadata object itself.  |
| `errors.[item].reason`  optional  | `enum` |  Machine-readable kind, present for image problems: `image_too_large` (over 1,000,000 characters, the pixel or frame limits, or the images of the task together over the per-task limit; the pointer is the image that went over), `image_empty`, `image_base64` (not valid base64), `image_format` (not a PNG, JPEG, GIF, WebP or BMP image, a multi-picture JPEG, or malformed or truncated). New values may be added.  one of "image\_too\_large", "image\_empty", "image\_base64", "image\_format"  |

### 429

`rate_limited`: too many tasks created per second by this key, the same task polled too often, the sandbox's per-organization rate, usage queried too often, the catalog fetched too often from this IP, or this IP sent too many invalid keys. `concurrency_limited`: the organization has too many tasks in flight for this captcha family (or, with a test key, too many sandbox tasks still processing). Wait `Retry-After` seconds.

Headers: `Noptcha-Request-Id`, `RateLimit` (optional), `RateLimit-Policy` (optional), `Retry-After`.

Content: `application/problem+json`

| Field | Type | Description |
| --- | --- | --- |
| `code`  required  | `string` |  Machine-readable error code (see the table).  |
| `detail`  optional  | `string` |  Human-readable explanation of this occurrence.  |
| `request_id`  required  | `string` |  Same as the `Noptcha-Request-Id` header.  |
| `status`  required  | `integer` |  The HTTP status code.  |
| `title`  required  | `string` |  |
| `type`  required  | `string` |  format: uri  |

### 500

`internal`: an error on our side.

Headers: `Noptcha-Request-Id`, `RateLimit` (optional), `RateLimit-Policy` (optional).

Content: `application/problem+json`

| Field | Type | Description |
| --- | --- | --- |
| `code`  required  | `string` |  Machine-readable error code (see the table).  |
| `detail`  optional  | `string` |  Human-readable explanation of this occurrence.  |
| `request_id`  required  | `string` |  Same as the `Noptcha-Request-Id` header.  |
| `status`  required  | `integer` |  The HTTP status code.  |
| `title`  required  | `string` |  |
| `type`  required  | `string` |  format: uri  |

### 503

`service_unavailable`: no capacity right now (all solvers busy or failing, the gateway is overloaded, a dependency is unavailable). For `POST /v1/tasks` nothing was created or charged. Wait `Retry-After`.

Headers: `Noptcha-Request-Id`, `RateLimit` (optional), `RateLimit-Policy` (optional), `Retry-After`.

Content: `application/problem+json`

| Field | Type | Description |
| --- | --- | --- |
| `code`  required  | `string` |  Machine-readable error code (see the table).  |
| `detail`  optional  | `string` |  Human-readable explanation of this occurrence.  |
| `request_id`  required  | `string` |  Same as the `Noptcha-Request-Id` header.  |
| `status`  required  | `integer` |  The HTTP status code.  |
| `title`  required  | `string` |  |
| `type`  required  | `string` |  format: uri  |

Header descriptions and every schema: [Schemas](https://noptcha.com/docs/api-reference/schemas.md). Machine-readable: [openapi.json](https://noptcha.com/openapi.json), [openapi.yaml](https://noptcha.com/openapi.yaml).
