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

# Errors

> Every Notra Labs Platform API error code with its HTTP status and what to do, the OpenAI error shape, backend errors and how cancelled requests are recorded.

Errors use OpenAI's shape, so OpenAI's SDKs raise them as their usual error types:

```json theme={"system"}
{
  "error": {
    "message": "This workspace doesn't have enough credits for this request. Add credits in the console, or lower the maximum answer length.",
    "type": "insufficient_quota",
    "param": null,
    "code": "insufficient_credits"
  }
}
```

`param` names the request field that caused the error, when there is one. Every response has an `x-request-id` header; include it when you contact support.

| Status | Code | What to do |
| - | - | - |
| 400 | `invalid_request` | Fix the request; `param` names the field. |
| 400 | `unsupported_parameter` | Remove the parameter that `param` names. |
| 400 | `context_length_exceeded` | Shorten the prompt so there is room for the answer. |
| 401 | `invalid_api_key` | Check the key and the Authorization header. |
| 402 | `insufficient_credits` | Add credits in the console, or lower the maximum answer length. |
| 404 | `model_not_found` | Use a model from `GET /v1/models`. |
| 405 | `method_not_allowed` | Use POST for generation and GET for models. |
| 413 | `request_too_large` | Send at most 1.45 MB of JSON. |
| 429 | `rate_limit_exceeded` | Wait for `retry-after` seconds; the `x-ratelimit-*` headers show the limits. |
| 400, 413, 422, 502 | `upstream_error` | At 400, 413 or 422 the model backend rejected the request: fix it. At 502, retry with exponential backoff. |
| 504 | `upstream_timeout` | Retry with exponential backoff, or stream the answer. |
| 503 | `model_starting` | Retry after `retry-after` seconds for up to 10 minutes. |
| 503 | `model_overloaded` | Retry after `retry-after` seconds. |
| 503 | `model_unavailable` | Retry later. |
| 503 | `service_unavailable` | Key checks or billing are unavailable; retry. |

## Notes

* **Backend errors.** When the model backend rejects a request with 400, 413 or 422, the error comes back at that status with code `upstream_error`. Long or technical backend messages are replaced with a short one.
* **Cancelled requests.** Requests you cancel appear in Logs as 499 `client_closed`. The API never returns that status.
* **Failed requests are free.** They don't use credits.
* **Retries.** OpenAI's SDKs retry 429 and 5xx responses on their own, but not long enough for a cold start. See [Cold starts and retries](https://www.usenotra.com/docs/platform/guides/cold-starts-and-retries.md).


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