> For the complete documentation index, see [llms.txt](https://docs.athenachat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.athenachat.ai/api-reference/en/errors-and-limits.md).

# Errors and limits

Error format, status codes and rate limits

## Error format

Errors are returned as JSON with a message and the status code:

```json
{
  "statusCode": 400,
  "message": "Tag already exist"
}
```

Authentication and rate-limit errors use `code` instead of `statusCode`, and validation errors can return `message` as a list of problems. Rely on the HTTP status of the response, and log `message` for troubleshooting.

## Status codes

| Status                    | When                                                                                        |
| ------------------------- | ------------------------------------------------------------------------------------------- |
| `200 OK`, `201 Created`   | The request succeeded                                                                       |
| `202 Accepted`            | The command was accepted and will be processed in the background                            |
| `400 Bad Request`         | Missing or invalid parameters, an unknown parameter, or the object (chat, tag) wasn't found |
| `401 Unauthorized`        | No API key, or the account can't be found                                                   |
| `402 Payment Required`    | The account's subscription is stopped                                                       |
| `403 Forbidden`           | The key is deactivated or has no access to the endpoint                                     |
| `404 Not Found`           | The API key is wrong                                                                        |
| `413 Payload Too Large`   | An attached file is larger than 10 MB                                                       |
| `429 Too Many Requests`   | The rate limit is exceeded                                                                  |
| `503 Service Unavailable` | A task-status command couldn't be queued — retry later                                      |

See [Authentication](/api-reference/en/authentication.md#authentication-errors) for the exact authentication messages.

## Rate limits

Each API key can make **300 requests per 10 seconds**. When you exceed the limit, the API returns:

```json
{
  "message": "Too many requests",
  "code": 429
}
```

Every response includes the `RateLimit-Policy`, `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers. When you get `429`, wait for the number of seconds in `RateLimit-Reset`, then retry.

## Files

When you [send a message](/api-reference/en/endpoints/messages.md) with attachments, you can upload up to **10 files** per request, **10 MB** each.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.athenachat.ai/api-reference/en/errors-and-limits.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
