# Errors

When something goes wrong, the API answers with an HTTP status and a short JSON message. This page lists every error, what it means and what to do about it.

## What an error looks like

```
HTTP/1.1 429 Too Many Requests
{"error": "account limit reached (concurrent sandboxes, vCPU or memory)", "code": "quota"}
```

- `error` is a sentence for people and may change. `code` is stable – check the code, not the text. Some errors have no code; then the status says enough.
- Some errors add fields: `feature` (`feature_disabled`), `controller_until` (`human_in_control`). Rate limits and short outages send a `Retry-After` header in seconds.
- **Python SDK:** every API error raises `SandboxError` with `status`, `code`, `message`, `retry_after` and `body`. **TypeScript SDK:** `APIError` subclasses (`RateLimitError`, `NotFoundError`, `FeatureDisabledError`, …) with `status`, `code` and `retryAfter`.
- **MCP:** a tool returns the same message as text with `isError: true`, so the assistant can read it and react.
- A command that fails inside the sandbox is *not* an API error: you get `200` with its `exit_code`. Neither is a failed job: it has `status: "failed"` and an [`error` object](#job-failures).

## What to do first

| Status | Usually |
| --- | --- |
| 400 / 422 | Fix the request – the message names the field. |
| 401 / 403 | Check the key, the feature or the permission. |
| 402 | Credit, fair use or budget – see *Billing*. |
| 404 | Wrong ID, or the thing is gone. |
| 409 | Wrong state – wake, resume or wait, then retry. |
| 429 | A limit: free a slot (`quota`) or wait for `Retry-After`. |
| 5xx | Retry after a short pause. Nothing is ever started with less than you asked for. |

## Every endpoint

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 400 | `invalid_json` | The body is not valid JSON, or it is empty. | Send a JSON object; check quoting in your shell. |
| 400 | – | A parameter is missing or wrong. The message names it (for example an invalid name or network). | Fix the parameter the message names. |
| 400 | `invalid_request` | The request is incomplete – for example `POST /v1/jobs/wait` without IDs or with a wrong `until`. | Fix the request as the message says. |
| 401 | – | The API key is missing, wrong or revoked. | Send `Authorization: Bearer YOUR_API_KEY` with a valid key from *API keys*. |
| 403 | `feature_disabled` | An optional feature is not enabled for your account. The field `feature` names it: `desktop`, `metrics_history`, `snapshots` or `clones`. | `GET /v1/features` lists what is on. Desktop is enabled on request; for the others contact support. |
| 403 | `app_key_not_allowed` | The key of a connected app (an assistant signed in with OAuth) cannot change account settings such as the budget or the default compute class. | Use an API key created in the portal. |
| 404 | `not_found (or none)` | The sandbox, snapshot, job or batch does not exist, no longer exists, or belongs to another account. | Check the ID; list your resources to find it. |
| 413 | `body_too_large` | The request body is larger than the endpoint accepts. | Send less data – upload big files with `PUT …/files` instead of inside JSON. |
| 429 | `rate_limited` | Too many requests in a short time (metrics, desktop, live console). | Wait for the `Retry-After` header, then retry. |
| 500 | `internal (or none)` | Something failed on our side. | Retry; if it keeps happening, contact support with the time and the request. |
| 503 | `service_unavailable (or none)` | The service is restarting, or we are not accepting new jobs for a moment. | Retry after `Retry-After` or in a few seconds. |

## Account, plan and compute classes

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 402 | `account_suspended` | Starting new sandboxes and jobs is paused for your account. The message says why: your prepaid credit ran out; or the daily fair-use limit of a fixed-price plan is used up; or the operator paused the account. Running sandboxes continue. | Credit: top up in *Billing*. Fair use: wait until 00:00 UTC, or switch to continuing at usage rates in *Billing*. Otherwise contact support. |
| 429 | `quota` | Your plan's limit of concurrent sandboxes, vCPU or memory is reached – also when waking a sleeping sandbox. A paused (frozen) sandbox still counts; a sleeping one does not. | Put a sandbox to sleep or destroy one, or upgrade your plan. See [Limits](https://sandbox.wbx.cz/docs/limits.md). |
| 429 | – | The server has no free slot right now. | Retry in a few seconds. |
| 400 | `invalid_compute_class` | Unknown compute class. | `GET /v1/compute/preferences` lists the classes. |
| 403 | `class_not_allowed` | The compute class is not included in your plan (or is reserved for another organization). | Choose another class or change your plan. |
| 409 | `class_disabled` | The compute class is temporarily not available for new sandboxes and jobs. | Choose another class, or retry later. Your request is never moved to another class by itself. |
| 409 | `default_class_unavailable` | Your default compute class no longer exists. | Choose a new default in *Settings → Compute Preferences*, or pass `compute_class`. |
| 400 | `class_template_mismatch` | The template cannot run in this compute class (for example it is smaller than the class minimum). | Pick another class or template; the message says why. |

## Sandboxes, commands and files

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 409 | `name_taken` | Another sandbox of yours with this name was created at the same moment. | Retry the call – it then returns the existing sandbox. |
| 409 | – | The sandbox is in the wrong state, for example a command in a paused (frozen) sandbox, or a new lifetime for a sleeping one. | Resume or wake it first (`POST …/resume`), then retry. |
| 409 | `sandbox_sleeping` | A public URL, screenshot or live console of a sleeping sandbox – these never wake it. (The desktop status does not fail: it answers `200` with `available: false` and `reason: "sandbox_sleeping"`.) | Wake it (`POST …/resume` or any command), then retry. |
| 409 | `sandbox_not_running` | A public URL of a sandbox that is not running (for example paused). | Resume it. |
| 503 | `sandbox_unavailable` | A sleeping sandbox cannot be woken up right now (for example its server is full). A new, empty sandbox is never created in its place. | Retry shortly. |
| 503 | – | No server with what you asked for (a compute class, IPv6, free memory) is free right now. A sandbox is never started with less than you asked for. | Retry, or ask for less. |
| 500 | `create_rolled_back` | The sandbox could not be started and was cleaned up. | Retry. |
| 502 | – | The agent inside the sandbox did not respond – usually the sandbox ran out of memory. | Create a new sandbox, or use a bigger template or class. |
| 400 | `network_too_large` | The combined network rules (team, request and, for clones, the source) have more than 1000 allowed or blocked destinations. | Use fewer destinations, or IP ranges instead of single addresses. |
| 502 | `port_closed` | Public URL: nothing listens on that port in the sandbox. | Start the app in the background and make it listen on `0.0.0.0`, not only `127.0.0.1`. |
| 502 | `port_unreachable` | Public URL: the app on the port does not respond. | Check the app's log in the sandbox. |
| 501 | `public_urls_disabled` | Public URLs are not enabled on this server. | Contact support. |

## Snapshots and clones

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 409 | `sandbox_archived` | The sandbox has been asleep for long and was moved to long-term storage. | Wake it (`POST …/resume`), then retry. |
| 429 | `snapshot_limit` | You have as many snapshots as your plan allows. | Delete snapshots you no longer need. |
| 501 | `unsupported` | The server of the sandbox does not support snapshots right now (during an update). | Retry later. |
| 503 | `snapshot_pause_failed` | A running sandbox could not be paused for the copy, so no snapshot was taken. The sandbox keeps running. | Retry after `Retry-After`. |
| 503 | `snapshot_node_unavailable (or none)` | The server that stores the snapshot is full or does not respond. | Retry shortly. |
| 503 | `snapshot_count_unavailable` | Some servers are not reachable, so your snapshot count cannot be checked. | Retry shortly. |
| 503 | `clone_network_unknown` | The network settings of the source sandbox cannot be read right now, so no copy is started (a copy never gets wider access). | Retry shortly. |
| 500 | `snapshot_delete_failed` | The snapshot could not be deleted right now; it is kept and still listed. | Retry the deletion. |
| 207 | `(per copy)` | A clone created only some copies. The answer lists the created ones in `sandboxes` and one `{"index", "name", "status", "code", "error"}` per failed copy in `errors`. | Usually `quota` – free a slot and clone again. The SDKs raise an error only when no copy was created. |

## Desktop & Computer Use

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 409 | `human_in_control` | A person controls the desktop from the portal. The answer has `controller_until`. | Wait (screenshots and status still work), then retry. |
| 403 | `human_only` | Only a signed-in person in the portal can take control or open the live console – never an API key or MCP. | Use screenshots and actions from code. |
| 409 | `desktop_restarted` | The desktop restarted while the request waited. | Send the request again. |
| 409 | `display_unavailable` | The sandbox has no desktop (not the `desktop` template), or it is still starting. | Use the `desktop` template; after a start or wake-up wait a few seconds. |
| 502 | `invalid_screenshot` | The screenshot from the sandbox was not a valid image. | Retry. |
| 409 | `control_required` | Portal only: take control before sending input from the console. | Click *Take control*. |
| 409 | `vnc_unavailable / agent_unavailable` | Portal only: the live console cannot start in this sandbox (an older build of the template, or the agent does not respond). | Start a new desktop sandbox; the page falls back to screenshots. |

## Submitting jobs and batches

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 400 | `invalid_command, invalid_timeout, invalid_cwd, invalid_env, invalid_metadata, invalid_template, invalid_artifacts, invalid_network, invalid_retry, invalid_webhook, invalid_max_cost, invalid_optimize_for, invalid_placement, invalid_runtime, invalid_wasm, invalid_inputs, invalid_idempotency_key` | A field of the job is invalid; the code names the field and the message says what is allowed. | Fix that field. Limits: [Limits](https://sandbox.wbx.cz/docs/limits.md#jobs). |
| 400 | `invalid_batch, invalid_depends_on` | The batch is invalid: number of jobs, `max_concurrency`, a dependency on a job that is not in the batch, or a cycle. | Fix the batch. |
| 400 | `env_required` | Retrying a job that had environment variables – their values are not stored. | Send `{"env": {…}}` with the retry. |
| 400 | `invalid_mode, bad_since` | A wrong `mode` of the log, or a `since` that is not an RFC 3339 time. | Fix the parameter. |
| 402 | `budget_exceeded` | The job or batch does not fit into your monthly or daily budget. | Wait for the next period, or raise the budget. See [Budgets](https://sandbox.wbx.cz/docs/jobs/budget.md). |
| 403 | `runtime_not_allowed` | The runtime is reserved for internal tasks. | Use `firecracker` (default) or `wasi`. |
| 409 | `idempotency_conflict` | The idempotency key was already used for a different request. | Use a new key for a different job or batch. |
| 422 | `budget_too_low` | The worst-case cost of the job is above its `max_cost`. The message gives the longest `timeout_s` that fits. | Lower `timeout_s` or raise `max_cost`. |
| 422 | `cost_unavailable` | A price limit or budget is set, but prices are not available for your account or the limit is in another currency. | Use `max_cost` in your billing currency; contact support if it persists. |
| 422 / 409 | `budget_currency` | The budget is in another currency than your plan. | Set the budget again. |
| 429 | `queue_full` | You have too many queued jobs. | Wait for some to start. |
| 429 | `too_many_waiters` | Too many `POST /v1/jobs/wait` calls are waiting at the same time. | Retry in a few seconds. |
| 503 | `service_unavailable` | We are not accepting new jobs, batches or retries for a while (job storage is running low). | Retry after `Retry-After`. |

## Reading jobs, result files and receipts

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 404 | `job_not_found, batch_not_found, artifact_not_found` | No such job, batch or result file in your account. | Check the ID or the file name (`GET /v1/jobs/{id}/artifacts`). |
| 410 | `artifact_gone` | The result file is no longer stored (results are kept 7 days). | Run the job again. |
| 409 | `job_active` | Retrying a job that has not ended yet. | Cancel it or wait. |
| 409 | `receipt_not_final` | A signed receipt of a job that has not ended yet. | Wait until the job ends. |
| 409 | `module_unavailable` | Retrying a WebAssembly job whose module is no longer stored. | Submit the job again with the module. |
| 503 | `signing_unavailable` | Receipt signing is not available right now. | Retry later; the unsigned receipt still works. |

## Why a job failed

A failed job is not an API error. `GET /v1/jobs/{id}` returns `"status": "failed"` (or `expired`) with `"error": {"code", "message", "kind"}`. `kind` tells whose problem it was: `user` – the job itself (charged as usual); `system` – our side (credited back automatically, and run again when the job has `retry`).

| Code | Kind | Meaning |
| --- | --- | --- |
| `nonzero_exit` | user | The command exited with a non-zero exit code. |
| `timeout` | user | The job reached its time limit (status `expired`); files written so far are kept. |
| `artifact_missing` | user | A file from `required_artifacts` was not produced. |
| `dependency_failed` | user | A job of the same batch that this job depends on did not complete. |
| `input_unavailable, invalid_inputs` | user | An input file from another job is missing, too large or no longer stored. |
| `template_not_found` | user | The template does not exist on the server. |
| `capacity` | user / system | The job could not start with the size or class it asked for. |
| `prepare_timeout` | user | The job's sandbox could not be prepared in time. |
| `wasm_trap` | user | The WebAssembly module stopped with an error. |
| `account_suspended, account_disabled, start_rejected, quota_busy` | user | The account could not start the job at that moment (credit, fair use, limits). |
| `sandbox_lost, node_failure, start_failed, queue_timeout, cleanup, interrupted, runtime_unavailable, runtime_failed, module_unavailable, env_unavailable, input_corrupted, artifact_upload_failed, artifact_store_failed` | system | A failure on our side. With `retry` the job runs again; the cost of such attempts is credited back automatically. |

The job summary (`GET /v1/jobs/{id}/summary`, MCP `get_job_summary`) suggests a next step for each failure.

## Next steps

- [Limits](https://sandbox.wbx.cz/docs/limits.md): The numbers behind `quota`, `400` and `429`.
- [REST API](https://sandbox.wbx.cz/docs/api.md): Authentication, format and every endpoint.
- [Refunds](https://sandbox.wbx.cz/docs/jobs.md#cost): How failures on our side are credited back.

Source: https://sandbox.wbx.cz/docs/errors
