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

# Errors

> One error shape on every failed response, with stable codes.

Every non-2xx response has the same shape:

```json theme={null}
{
  "error": {
    "type": "invalid_request",
    "code": "parameter_invalid",
    "message": "files[3].content_type must be image/png, image/jpeg or image/webp",
    "param": "files[3].content_type",
    "doc_url": "https://docs.relettr.com/errors#parameter_invalid",
    "request_id": "req_8f2a1b3c4d5e6f7a8b9c0d"
  }
}
```

* **`type`** is one of a small fixed set: `invalid_request`, `authentication`, `permission`, `not_found`, `conflict`, `payment_required`, `rate_limited`, `capacity`, `api_error`.
* **`code`** is the specific reason. Branch on `code`, not on `message`; messages may be reworded.
* **`param`** names the offending field, when there is one.
* Some codes add fields, listed below.

Every response, success or failure, has a `Request-Id` header. Include it when you email [support@relettr.com](mailto:support@relettr.com).

## Codes

| HTTP | `code` | Meaning |
| - | - | - |
| 400 | `parameter_invalid`, `parameter_missing`, `json_invalid` | Bad request body or query |
| 401 | `api_key_missing`, `api_key_invalid`, `api_key_revoked` | Authentication failed |
| 402 | `insufficient_credits` | Not enough available credits. Adds `required`, `available`. |
| 402 | `spend_limit_reached` | A monthly limit was hit. Adds `scope` (`key` / `account`), `limit`, `used_this_month`. |
| 403 | `scope_missing` | The key lacks the needed scope |
| 403 | `test_key_live_object`, `live_key_test_object` | Mixing test and live |
| 403 | `account_suspended` | The account can't make requests |
| 404 | `not_found` | Doesn't exist, or belongs to another account |
| 409 | `invalid_state` | Not allowed in the chapter's current status. Adds `status`, `allowed_from`. |
| 409 | `chapter_exists` | That `number` already exists in the series |
| 409 | `idempotency_key_reused` | Same key, different request |
| 409 | `idempotency_in_progress` | Same key, first request still running; retry shortly |
| 409 | `chapter_not_ready` | No result yet |
| 409 | `chapter_locked` | In `needs_review` with open zones |
| 409 | `quote_exceeds_max` | The quote is above your `max_credits` |
| 410 | `gone` | The chapter was deleted |
| 412 | `precondition_failed` | Stale `If-Match` on a regions edit; fetch again |
| 413 | `too_many_files`, `chapter_too_large`, `too_many_parts` | Over a [chapter limit](https://docs.relettr.com/chapter-lifecycle.md#limits) |
| 415 | `unsupported_media_type` | Declared content type isn't PNG, JPEG or WebP |
| 422 | `upload_incomplete` | Files missing at `uploads/complete`. Adds `missing_indexes`. |
| 422 | `invalid_image`, `image_too_large` | An image can't be decoded or is over the limits |
| 422 | `unsupported_language` | `source_language` other than `ko` |
| 422 | `nothing_to_translate` | No text found |
| 429 | `rate_limited` | Too many requests. See `Retry-After`. |
| 429 | `concurrency_limit` | Too many active chapters. Adds `limit`, `active`. |
| 503 | `capacity_unavailable` | The GPU queue is too long right now. Adds `estimated_wait_s`; see `Retry-After`. Nothing was held. |
| 500 | `internal_error` | Our fault. Retry with the same idempotency key; email us with the `request_id` if it persists. |

Going over 10 chapters in `awaiting_upload` returns `429 concurrency_limit`.

## Chapter errors

A chapter that fails has `status: "failed"` and an `error` object on the chapter itself (not an HTTP error):

```json theme={null}
"error": {"code": "translate_failed", "message": "Translation failed; the hold was refunded.", "step": "translate"}
```

| `chapter.error.code` | Meaning |
| - | - |
| `invalid_image` | An image failed validation. `file_index` says which. Nothing charged. |
| `read_failed` | Text detection or reading failed |
| `translate_failed` | Translation failed |
| `render_failed` | No part could be rendered |
| `gpu_unavailable_timeout` | The GPU was unavailable for 48 hours while the chapter was queued; it was canceled with a full refund |
| `internal_error` | Something else went wrong on our side |

Error messages never contain the Korean or English text of your chapter.

## Retrying

| Response | Retry? |
| - | - |
| `400`, `401`, `403`, `404`, `413`, `415`, `422` | No. Fix the request. |
| `402` | After buying credits or raising the limit, with a **new** idempotency key |
| `409 idempotency_in_progress` | Yes, after a short wait |
| `412` | After fetching the regions again |
| `429`, `503` | Yes, after `Retry-After` seconds |
| `500`, network errors | Yes, with exponential backoff and the **same** idempotency key |


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