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

# Errors

> Error types returned by the gateway.

All errors return JSON with this shape:

```json theme={null}
{
  "error": {
    "type": "gateway_error",
    "message": "Missing or invalid 'model' field. Expected format: 'provider/model-name'",
    "request_id": "req_abc123"
  }
}
```

## Error types

| Type             | When                                                    |
| ---------------- | ------------------------------------------------------- |
| `unauthorized`   | Missing, invalid, or expired auth token                 |
| `gateway_error`  | Bad request (missing field, invalid model format, etc.) |
| `provider_error` | Upstream provider returned an error or was unreachable  |

## HTTP status codes

| Status | Meaning                                                          |
| ------ | ---------------------------------------------------------------- |
| 400    | Bad request — fix the request body                               |
| 401    | Auth failed — check your token                                   |
| 404    | Endpoint or prompt not found                                     |
| 502    | Upstream provider error — may be transient, use a fallback chain |

## Fallback chains

For resilience against provider outages or rate limits, pass `x-gatelit-fallback-chain` in the request body. See [Chat completions](/gateway/api-reference/chat-completions) for the schema.
