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

# Error codes and limitations

> Every status code the gateway returns, the shape of an error response body, and the features that are not supported yet so you can plan around them.

Errors are returned as JSON with a stable shape:

```json theme={null}
{ "error": { "message": "Insufficient credits. Top up to continue.", "type": "insufficient_quota" } }
```

## Status codes

| Status | `type`                    | When                                                      |
| ------ | ------------------------- | --------------------------------------------------------- |
| `400`  | `invalid_request_error`   | Malformed JSON, or missing `model` / `messages` / `input` |
| `401`  | `authentication_error`    | Missing or invalid API key                                |
| `402`  | `insufficient_quota`      | Credit balance is empty — [top up](/docs/models#topping-up)    |
| `404`  | `invalid_request_error`   | Unknown `model` id (see `GET /v1/models`)                 |
| `502`  | `upstream_error`          | The upstream provider returned an error                   |
| `503`  | `provider_not_configured` | No API key configured on the gateway for that provider    |

## Notes

* **402 is a pre-check.** The gateway verifies a positive balance *before* calling
  the provider, so an empty balance fails fast and costs nothing.
* **502 carries the upstream message.** When a provider rejects a request (e.g. its
  own rate limit or billing), the gateway forwards the provider's message under
  `error.message` with `type: upstream_error`.
* **Streaming errors.** If an error happens mid-stream, the gateway emits a final
  SSE event describing it and then closes the stream.
* **`/v1/messages` uses Anthropic's error shape.** The Messages surface returns
  `{"type": "error", "error": {...}}` with Anthropic error types instead of the
  table above — `not_found_error` for an unknown model, `api_error` for
  upstream/provider failures — and `max_tokens` is required there (`400` if missing).

## Not supported yet

* **The documented endpoints only.** The gateway implements Chat Completions,
  Responses, Messages, Gemini-native `generateContent`,
  [image generation](/docs/image-generation), [embeddings](/docs/embeddings), and
  [audio transcription](/docs/audio-transcription). Other OpenAI / Anthropic
  endpoints (assistants, batches, fine-tuning, files, text-to-speech, etc.) are
  not implemented, and models do not produce speech or file output.
* **Audio and video input is modality-gated.** Only models that declare the
  modality accept it — today the Gemini family; see
  [Audio & video input](/docs/audio-video).
* **No reranking** endpoint.
* **A fixed model catalog on the shared (operator) key path.** See
  [Models & pricing](/docs/models) for what's live. You can route any supported model
  through your own credential instead — see [BYOK](/docs/byok).
* **No rate limiting.** The gateway does not impose request or token rate limits;
  your effective limits are the upstream providers' (surfaced as `502
  upstream_error`). Spend is bounded by your credit balance.
