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

# Errors

> The error envelope every failed request returns, and the codes you are most likely to see with what each one means.

A failed request returns an HTTP status and a JSON body in OpenAI's error shape:

```json theme={null}
{
  "error": {
    "message": "Incorrect API key provided.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key"
  }
}
```

Branch on `code`. The `message` is for people and can change.

## Common codes

| Status | Code | What it means |
| - | - | - |
| 400 | `invalid_request_body` | The body isn't a JSON object, a field has the wrong JSON type, or `model` is missing. |
| 400 | `invalid_parameter` | A field has a value the endpoint refuses. The message names the field. |
| 400 | `context_length_exceeded` | The conversation is too long for this model. |
| 400 | `remote_media` | A message links media by URL. Send it as a `data:` URI. |
| 400 | `content_filter` | The model's vendor declined the request. |
| 401 | `invalid_api_key` | The key is missing, unknown, or revoked. |
| 401 | `login_required` | The endpoint manages an account. A key can't call it. |
| 402 | `insufficient_balance` | Your credits don't cover the request. See [Billing](/billing). |
| 403 | `account_disabled` | Morse disabled the account. Contact support. |
| 404 | `model_not_found` | No model has this id. List them with `GET /v1/models`. |
| 413 | `request_too_large` | The body is over 32 MiB, or too large for the model's vendor. |
| 429 | `rate_limit_exceeded` | The account used its requests for the minute. See [Rate limits](/rate-limits). |
| 429 | `concurrency_limit_exceeded` | The account has as many requests in flight as its plan allows. |
| 502 | `upstream_error` | The model's server failed. |
| 502 | `upstream_unavailable` | The model's vendor is unavailable right now. Retry later, or choose another model. |
| 503 | `upstream_busy` | The model's vendor is busy. Retry after a short wait. |
| 503 | `upstream_unattested` | Morse couldn't verify the enclave of a `tee` or `e2ee` model. |

Retry a `429` or a `503` after the seconds in its `Retry-After` header, when it has one. Retry a `502` after a short wait. Don't retry a `400`, `401`, `403`, or `404` unchanged. A retried request that reached the model is a new request, and Morse bills it again.

Each endpoint's page in the API reference lists every code it can return. See [Create a chat completion](/api-reference/create-a-chat-completion).


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