# Errors and limits

| Status | Meaning | What an agent should do |
| --- | --- | --- |
| 400 | Invalid request or BYOK setup | Check the model ID, parameters, and that a provider key is saved for BYOK |
| 401 | Invalid account API key | Stop. Ask the account owner for an active key |
| 402 | Not enough credit for the reservation | Lower `max_tokens`, or ask the owner to add credit |
| 403 | Endpoint or model not allowed | Use a supported endpoint and a model from `/v1/models` |
| 429 | Rate limit (`rate_limit_exceeded`) or budget (`budget_exceeded`) | Rate limit: wait and retry with backoff. Budget: stop and tell the owner |
| 503 | Account or billing service unavailable | Retry later. Do not blindly retry paid work |

Providers can return other errors. Read the status and message together.

## Reservations

Before dispatch, ZRouter reserves credit for the workspace input allowance plus the requested `max_tokens`. After usage is reported it settles the real charge and releases the rest. So:

- Set `max_tokens` to what the task needs. It lowers the hold and avoids 402s.
- If a stream disconnects before final usage, credit can stay held until reconciled. Do not assume a disconnected request was free.

Workspace limits and live per-model prices: https://zrouter.si/pricing and [/capabilities.json](/capabilities.json).

Next: [Virtual models](/docs/virtual-models.md)
