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

# Anthale API Errors, Retries, and Failure Handling

> Handle Anthale API failures predictably with clear retry rules, status meanings, and error payload fields for production integrations.

Error handling is part of runtime safety. Your Anthale integration should distinguish bad requests from temporary service issues and should preserve enough context for debugging.

## Common statuses and failure types

| Status | Failure type           | Meaning                                                       | Recommended action                                                                           |
| ------ | ---------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `400`  | Bad request            | Malformed request shape or unsupported field values           | Fix the request payload                                                                      |
| `401`  | Authentication failure | Missing or invalid API key                                    | Fix the API key or auth configuration                                                        |
| `403`  | Authorization failure  | Authenticated, but not allowed to access the resource         | Verify access and ownership boundaries                                                       |
| `404`  | Missing resource       | The requested route or policy identifier was not found        | Verify the policy identifier or route                                                        |
| `422`  | Validation failure     | The request shape is valid JSON, but field values are invalid | Correct the payload values                                                                   |
| `429`  | Rate limit             | Too many requests in a short window                           | Retry with backoff, honor `retry-after`, and see [Usage Limits](/docs/api-reference/usage-limits) |
| `5xx`  | Service failure        | Anthale-side temporary issue                                  | Retry with backoff and alert if persistent                                                   |

## Retry guidance

Retryable:

* `429`.
* transient network failures.
* temporary `5xx` responses.

Do not retry without changing the request:

* `400`.
* `401`.
* `403`.
* `404`.
* `422`.

## Error payload shape

```text theme={null}
{
  "error": {
    "title": "Unauthorized",
    "machineCode": "Unauthorized",
    "message": "Authentication is required to access this resource."
  }
}
```

`title` is a short error name. `machineCode` is the stable code your application should key on for branching and logging. `message` is the human-readable explanation. `details` may be present when Anthale needs to return structured context for the error.

## Next steps

For rate limits and backoff behavior, read [Usage Limits](/docs/api-reference/usage-limits).
