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

# Authentication

Every request to the ENLYZE API must be authenticated. The API uses API keys, which you pass in the `Authorization` header using the `Bearer` scheme.

## Create an API key

You manage API keys in the ENLYZE web app. See [Manage API keys](/en/administration/api-keys.md).

{% hint style="warning" %}
Treat your API key like a password. Do not share it, and do not store it in source code or public repositories.
{% endhint %}

## Use an API key

Pass the API key in the `Authorization` header. The scheme is `Bearer`, followed by a space and the key:

```http
Authorization: Bearer YOUR_API_KEY
```

{% hint style="info" %}
Replace only `YOUR_API_KEY` with your actual API key. The word `Bearer` stays unchanged. So `Bearer YOUR_API_KEY` becomes, for example, `Bearer sk_abc123…`.
{% endhint %}

Example request:

{% tabs %}
{% tab title="Python" %}

```python
import requests

response = requests.get(
    "https://app.enlyze.com/api/v2/machines",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl https://app.enlyze.com/api/v2/machines \
  -H "Authorization: Bearer YOUR_API_KEY"
```

{% endtab %}
{% endtabs %}

## Failed authentication

If the `Authorization` header is missing or malformed, or uses a scheme other than `Bearer`, the API responds with status code `401 Unauthorized`. See [Errors](/en/enlyze-api/errors.md).
