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

# Errors

> Error codes and how to handle them.

Askr uses standard HTTP status codes. Error responses include a JSON body with a
message.

```json theme={null}
{ "error": { "message": "Insufficient balance", "type": "payment_required" } }
```

| Status | Meaning                    | What to do                         |
| ------ | -------------------------- | ---------------------------------- |
| `400`  | Bad request                | Check your parameters.             |
| `401`  | Invalid or missing API key | Check the `Authorization` header.  |
| `402`  | Insufficient balance       | Top up and retry.                  |
| `404`  | Not found                  | Check the model id or resource id. |
| `429`  | Rate limited               | Back off and retry (see below).    |
| `5xx`  | Server error               | Retry with exponential backoff.    |

<Tip>
  Handle `402` in your app by prompting the user to top up, and `429` by retrying
  after a short delay.
</Tip>
