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

# Authentication

> How to authenticate to the Edgee API

The Edgee API uses API keys to authenticate requests. You can view and manage your API keys in the
Edgee [Console](https://www.edgee.ai/). Please refer to the [Create an API Key](/quickstart/api-key) guide to know more about how to create an API key.

<Warning>
  Your API keys carry many privileges, so be sure to keep them secure!

  Do not share your API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
</Warning>

Authentication to the API is performed via Bearer authentication (also called token authentication).
It is an HTTP authentication scheme that involves security tokens called bearer tokens. The client must send this token
in the Authorization header when making requests to protected resources:

```bash theme={"dark"}
Authorization: Bearer <api_key>
```

If you need to authenticate via HTTP Basic Auth,
use `-u {{token}}:` instead of `-H "Authorization: Bearer {{token}}"`.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication
will also fail.

<RequestExample>
  ```bash cURL with Bearer theme={"dark"}
  curl 'https://api.edgee.ai/v1/chat/completions' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "openai/gpt-5.2",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
  ```

  ```bash cURL with Basic Auth theme={"dark"}
  curl 'https://api.edgee.ai/v1/chat/completions' \
  -u '<token>:' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "openai/gpt-5.2",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
  # The colon prevents curl from asking for a password.
  ```
</RequestExample>
