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

# Errors and rate limits

> What each gateway error means and what to do about it.

Errors use the OpenAI shape: `{"error": {"message": "...", "type": "...", "code": ...}}`. The HTTP status is the first thing to read; the `type` and `code` narrow it down.

| Status | Error | What to do |
| - | - | - |
| **400** | `invalid_request_error`: a malformed body, an unsupported capability (*Provider ... does not support capability ...*), an unknown `?kind` or `?capability`, or *Could not determine model from request* (`model_not_found`) | Check the body is valid JSON and has `model` (or `prompt.id`), and that the deployment supports this endpoint. |
| **400** | `content_filter` (type `invalid_request_error`): the input broke a guardrail | Change the input, or review the guardrail's probes and strictness. |
| **401** | *Missing authorization header* or *Invalid API key* | Send `Authorization: Bearer <key>`. Check the key has not expired or been deleted. `x-api-key` does not work. |
| **402** | `insufficient_quota`: a budget or usage quota is used up | Raise the key's budget or the user's quota, or wait for the next billing cycle. |
| **403** | Blocked by a gateway rule; the `x-block-reason` response header says why | Review the rule under Observability → Rules. |
| **404** | *Model not found: \<name>* or *Prompt not found: \<id>* | Use the exact deployment, router or agent name, a key from the project that owns it, and a published version. |
| **413** | `payload_too_large`: the body is over 100 MB | Send less data; upload large files separately. |
| **429** | `rate_limit_error`, code `rate_limit_exceeded` | Wait `Retry-After` seconds. Raise the deployment's rate limit if this is expected traffic. |
| **500** | `content_filter` (type `server_error`): the output broke a guardrail; or an internal gateway error | The model's answer was withheld. Review the prompt or the guardrail. For an internal error, retry, then contact your administrator with the request time. |
| **502** | `guardrail_failure`, `invalid_provider_response`, or the upstream model server failed. The body adds a `provider_error` with the provider's own message | Check the guardrail deployment or the model server. Add a fallback deployment. |
| **503** | Type `router_resolution_failed` with code `no_decision_matched` or `signal_not_ready`; or a provider that is overloaded | *no\_decision\_matched*: add a default route to the router. *signal\_not\_ready*: a platform issue; report the `request_id` in the body. Otherwise retry with backoff. |
| **504** | `timeout_error`: the model did not answer in time | Retry, add a fallback deployment, or add capacity. |

### Rate-limit headers

On a deployment with a rate limit, responses carry the headers below. A deployment with no limit sends none.

| Header | Meaning |
| - | - |
| `X-RateLimit-Limit` | The limit in force. |
| `X-RateLimit-Remaining` | Requests left in the current period. |
| `X-RateLimit-Reset` | When the limit resets, as a Unix timestamp. |
| `Retry-After` | On a 429 only: seconds until the next request will be accepted. |

> [!TIP]
>
> **Retrying.** Retry 429, 502, 503 and 504 with exponential backoff, and honour `Retry-After`. Do not retry 400, 401, 402, 403 or 404: the same request will fail again. Setting retries and a fallback on the deployment ([Operating a deployment](https://docs.budecosystem.com/deployments/operating-a-deployment.md)) does this for you inside the gateway.


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