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

# Error Handling

> Understanding API error responses

# Error Handling

All error responses follow a consistent JSON structure:

```json theme={null}
{
  "status": "error",
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "Quote not found",
    "details": null
  },
  "meta": {
    "request_id": "req_a1b2c3d4",
    "timestamp": "2026-05-01T12:00:00Z",
    "version": "v1"
  }
}
```

## HTTP Status Codes

| Code | Meaning           | When                                                |
| ---- | ----------------- | --------------------------------------------------- |
| 200  | Success           | Request completed successfully                      |
| 201  | Created           | Resource created (e.g., new API key)                |
| 400  | Bad Request       | Invalid parameters or request body                  |
| 401  | Unauthorized      | Missing or invalid API key / auth token             |
| 403  | Forbidden         | Insufficient permissions or inactive subscription   |
| 404  | Not Found         | Resource doesn't exist                              |
| 409  | Conflict          | Duplicate resource (e.g., email already registered) |
| 422  | Unprocessable     | Validation error in request body                    |
| 429  | Too Many Requests | Rate limit or quota exceeded                        |
| 500  | Server Error      | Unexpected internal error                           |

## Error Codes

| Code                     | Description                                |
| ------------------------ | ------------------------------------------ |
| `INVALID_API_KEY`        | The provided API key is invalid or revoked |
| `SUBSCRIPTION_INACTIVE`  | Your subscription is not active            |
| `RATE_LIMIT_EXCEEDED`    | Per-minute rate limit exceeded             |
| `MONTHLY_QUOTA_EXCEEDED` | Monthly request quota exhausted            |
| `RESOURCE_NOT_FOUND`     | The requested resource was not found       |
| `VALIDATION_ERROR`       | Request body or parameters are invalid     |

## Request ID

Every response includes a `request_id` in the `meta` object and the `X-Request-ID` response header. Include this ID when contacting support.
