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

# Handle VoidAI API Errors

> Diagnose authentication, eligibility, validation, rate-limit, and provider errors from VoidAI API responses.

Check the HTTP status and response body before reading a success payload. Gateway and upstream errors can use different fields; do not assume every failure includes an identical error envelope or a reference ID.

| Status | What to check |
| - | - |
| 400 | Request shape, required parameters, model-specific constraints, and policy restrictions. |
| 401 | Missing, expired, or invalid credentials; see [authentication](https://docs.voidai.app/authentication.md). |
| 403 | Account, IP, plan, or model access restrictions. |
| 404 | Unknown resource/model or an unavailable endpoint. |
| 429 | Rate or usage limits; inspect any retry guidance. |
| 5xx | Gateway/provider errors or temporary availability problems. |

A public model listing does not prove that your account can call it. Claude access requires an additional grant. The [moderation endpoint](https://docs.voidai.app/api-reference/moderations/create.md) is unavailable to normal accounts, and [video routes](https://docs.voidai.app/api-reference/video/create.md) are not currently registered.

## Handle SDK exceptions

```python theme={null}
import os
from openai import OpenAI, APIError, AuthenticationError, RateLimitError

client = OpenAI(
    api_key=os.environ['VOIDAI_API_KEY'],
    base_url='https://api.voidai.app/v1',
)
try:
    response = client.chat.completions.create(
        model='gpt-4o-mini',
        messages=[{'role': 'user', 'content': 'Hello'}],
    )
except AuthenticationError:
    print('Check the credential and authentication header.')
except RateLimitError:
    print('Inspect retry guidance and account limits before retrying.')
except APIError as error:
    print('Request failed with status:', error.status_code)
```

For transient failures, use bounded retries with exponential backoff and jitter. Avoid blindly retrying validation, authentication, or access failures. A failed connection does not always establish whether an inference request completed, so repeated requests can create additional usage.

## Get support

Save the status, endpoint, time, and any `reference_id` or request/response ID returned. Remove API keys and sensitive prompt content before sharing diagnostics through [support](https://discord.gg/pQab7kukfu). Check account state in your [dashboard](https://voidai.app/dashboard).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.