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

# Error Handling

> Understand and handle API errors

## Common Error Codes

Apollo AI uses standard HTTP status codes to indicate the success or failure of your requests.

| Code  | Status            | Description                                                |
| :---- | :---------------- | :--------------------------------------------------------- |
| `200` | OK                | The request was successful.                                |
| `400` | Bad Request       | The request was invalid (e.g. missing parameters).         |
| `401` | Unauthorized      | Review your API key.                                       |
| `403` | Forbidden         | Your API key doesn't have permissions (e.g. invalid Tier). |
| `429` | Too Many Requests | You have hit a rate limit or daily quota.                  |
| `500` | Server Error      | Something went wrong on our end.                           |

## Handling Rate Limits (429)

If you receive a `429` error, you have exceeded your rate limit or daily quota.

* **Tier Limits**: Each tier (Starter, Economy, Pro, Ultimate) has different daily limits for images and requests.
* **Backoff**: Implement exponential backoff in your code to retry requests after a delay.

```python theme={null}
import time

def safe_request(url, headers, data):
    max_retries = 3
    for i in range(max_retries):
        response = requests.post(url, headers=headers, json=data)
        if response.status_code == 429:
            time.sleep(2 ** i)  # Exponential backoff
            continue
        return response
```
