> 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/authentication.md).

# Authentication

How to get an API key and authorize requests

Every request must include your API key. The key gives access to the chats of your Athena AI account, so keep it secret.

## Get an API key

API keys are issued by the Athena team. Write to <info@athenachat.ai> or message us on [WhatsApp](https://wa.me/447473396460), and tell us the email of your Athena account.

{% hint style="warning" %}
Store the key on your server only. Never put it in a website, mobile app or any other code that runs on your customers' devices. If the key leaks, ask support to deactivate it and issue a new one.
{% endhint %}

## Authorize requests

Pass the key in the `Authorization` header **as is, without the `Bearer` prefix**:

```bash
curl "https://hub.athenachat.ai/api/v1/chats/chat" \
  -H "Authorization: YOUR_API_KEY"
```

## Authentication errors

| Status                 | `message`                    | What it means                                                          |
| ---------------------- | ---------------------------- | ---------------------------------------------------------------------- |
| `401 Unauthorized`     | `Unauthorized`               | The `Authorization` header is missing, or the account can't be found   |
| `402 Payment Required` | `Payment Required`           | The subscription of the account is stopped — renew it in Athena        |
| `403 Forbidden`        | `Key not active`             | The key has been deactivated                                           |
| `403 Forbidden`        | `Forbidden scoupe/recources` | The key doesn't have access to this endpoint                           |
| `404 Not Found`        | `Key not found`              | The key is wrong — check it, and make sure there is no `Bearer` prefix |

See also [Errors and limits](/api-reference/en/errors-and-limits.md).


---

# 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/authentication.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.
