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

# Errors

> API error codes, what causes them, and what to do about each one.

## Error response shape

Every error has the same shape: `success: false`, a message for people in `error`, a stable `code` for your code to act on, and `field` when one option is the problem.

```json
{
  "success": false,
  "error": "This file is 4.1 MB. Uploads are limited to 4 MB, parse bigger documents from a URL instead.",
  "code": "file_too_large",
  "field": "file"
}
```

A request that fails costs nothing. In the SDKs, every error is a `ScreenshotRenderError` with `status`, `code` and the message: see the [Node](/sdks/node.md#error-handling) and [Python](/sdks/python.md#error-handling) SDKs.

## Errors

| Code | Status | Cause | What to do | Retry? |
| - | - | - | - | - |
| `invalid_request` | 400 | An option is missing or not valid, like a request with no `url`, or both a file and a `url` sent to `/parse`. `field` names it. | Fix the option named in `field`. | No |
| `invalid_api_key` | 401 | The API key is not valid. | Copy your key again from your [dashboard](https://www.screenshotrender.com/dashboard). | No |
| `insufficient_credits` | 402 | Your balance doesn't cover the request. The message says what it needs, like a crawl's reservation. | Lower `limit`, add credits, or turn on auto-recharge. See [Billing](/billing.md). | After adding credits |
| `not_found` | 404 | No crawl with this id, or its results are gone: they are kept for 24 hours. | Check the id. | No |
| `file_too_large` | 413 | The upload is over 4 MB. | Parse the document from a URL instead. | No |
| `unsupported_file_type` | 415 | The upload's file type is not supported. The message lists the types that are. | Convert the file to a [supported format](/features/parse.md#supported-formats). | No |
| `busy` | 429 | Too many requests are running right now. | Wait for the seconds in the `Retry-After` header, then retry. The SDKs do this for you. | Yes |
| `upstream_error` | 502 | Something went wrong while reading the page. | Try again. | Yes |

## Retry guidance

* Retry `busy` (429) after the `Retry-After` header's seconds, and `upstream_error` (502) after a short wait.
* Don't retry `400`, `401`, `404`, `413` or `415` as they are: change the request first.
* Retry `402` once your balance covers the request.

## Examples

A scrape with no URL:

```json
{
  "success": false,
  "error": "url is required.",
  "code": "invalid_request",
  "field": "url"
}
```

A crawl your balance doesn't cover:

```json
{
  "success": false,
  "error": "This crawl can use up to 10000 credits (10000 pages at 1 credit each) and your balance is 773. Lower the page limit or add credits.",
  "code": "insufficient_credits"
}
```

A busy moment:

```json
{
  "success": false,
  "error": "We're handling a lot of requests right now. Please retry in a few seconds.",
  "code": "busy"
}
```
