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

# Error Codes

> HTTP status codes returned by the UncensoredGPT API and how to handle them.

The API uses conventional HTTP status codes. Error responses have a consistent JSON body:

```json theme={null}
{
  "error": {
    "message": "Incorrect API key provided.",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
```

## Status codes

| Code | Meaning | Common cause and what to do |
| - | - | - |
| `400` | Bad Request | Malformed request body. Check the JSON and parameter types. |
| `401` | Unauthorized | Missing, invalid, or deleted API key. Check the `Authorization` header. |
| `403` | Forbidden | The key is not allowed to call this endpoint or model — for example, a key restricted to specific models or routes. |
| `404` | Not Found | Unknown model or resource ID. List models with `/v1/models` to confirm the name. |
| `422` | Unprocessable Entity | The request is syntactically valid but fails validation. The response details which field is wrong. |
| `429` | Too Many Requests | You hit a [rate limit](https://docs.uncensoredgpt.ai/api-reference/rate-limits.md). Retry with exponential backoff. |
| `500` | Server Error | Something failed on our side. Retry with backoff; contact support if it persists. |
| `502` / `503` | Service Unavailable | The model is temporarily overloaded or restarting. Retry with backoff. |

## Timeouts and long generations

Long generations can be interrupted by client timeouts. Set a generous client timeout, and prefer [streaming](https://docs.uncensoredgpt.ai/api-reference/endpoints/chat/create-chat-completion.md) (`"stream": true`) so tokens arrive continuously and connections stay alive.

## Still stuck?

Send us the request ID (when present in the error), the model, and a timestamp, and we'll investigate: [info@uncensoredgpt.ai](mailto:info@uncensoredgpt.ai).


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