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

# Errores

> Categorías de error estándar devueltas por APIAny.AI.

Cada endpoint de chat devuelve los errores con **la misma forma que el estándar
de API con el que es compatible** (OpenAI, Anthropic o Gemini). Toda respuesta de
error incluye además una cabecera `X-Request-Id` y devuelve únicamente la
información que necesitas para depurar tu solicitud.

## OpenAI — `/v1/chat/completions` (y endpoints de imagen/vídeo)

```json theme={null}
{
  "error": {
    "message": "Insufficient credits",
    "type": "insufficient_quota",
    "code": "insufficient_credits",
    "param": null
  }
}
```

## Anthropic — `/v1/messages`

```json theme={null}
{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "Invalid API key"
  }
}
```

## Gemini — `/v1beta/models/{model}:generateContent`

```json theme={null}
{
  "error": {
    "code": 400,
    "message": "model is required",
    "status": "INVALID_ARGUMENT"
  }
}
```

## Mapeo de estados

El `type` / `status` del error se deriva del estado HTTP:

| HTTP | OpenAI `type`           | Anthropic `type`               | Gemini `status`             |
| ---- | ----------------------- | ------------------------------ | --------------------------- |
| 400  | invalid\_request\_error | invalid\_request\_error        | INVALID\_ARGUMENT           |
| 401  | authentication\_error   | authentication\_error          | UNAUTHENTICATED             |
| 403  | permission\_error       | permission\_error              | PERMISSION\_DENIED          |
| 404  | not\_found\_error       | not\_found\_error              | NOT\_FOUND                  |
| 402  | insufficient\_quota     | invalid\_request\_error        | RESOURCE\_EXHAUSTED         |
| 429  | rate\_limit\_error      | rate\_limit\_error             | RESOURCE\_EXHAUSTED         |
| 5xx  | api\_error              | api\_error / overloaded\_error | SERVER\_ERROR / UNAVAILABLE |
