> For the complete documentation index, see [llms.txt](https://luw-ai.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luw-ai.gitbook.io/api/luw.ai-api-documentation/introduction/error-handling.md).

# Error Handling

Basically, if status is getting false, you can expect these errors.

If there was an error at the request or response, API will return **`status: false`**  also you can get details of the error with this parameters.

#### Common Error Responses

All endpoints can return the following error responses:

**Authentication Error**

```json
{
  "status": false,
  "errors": {
    "auth": ["Wrong credentials or expired token"]
  }
}
```

**Credit Limit Error**

```json
{
  "status": false,
  "insert_coin": true
}
```

#### Model-Specific Errors

**Generation Errors**

```json
{
  "status": false,
  "error": "Something wrong with main server",
  "response": "Detailed error message"
}
```

#### Response Status Codes

| Status Code | Description                             |
| ----------- | --------------------------------------- |
| 200         | Success                                 |
| 400         | Bad Request - Invalid parameters        |
| 401         | Unauthorized - Invalid or missing token |
| 403         | Forbidden - Insufficient permissions    |
| 404         | Not Found - Resource doesn't exist      |
| 429         | Too Many Requests - Rate limit exceeded |
| 500         | Internal Server Error                   |
