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

# Authentication

> API keys, bearer tokens, environment variables, and key safety.

## How do I authenticate API requests?

Pass your API key as a bearer token:

```bash theme={null}
Authorization: Bearer <YOUR_API_KEY>
```

## Where do I get an API key?

Create and manage keys in the [Dashboard](https://linkmodel.ai/en/dashboard).

## Should I put the API key in client-side code?

No. Treat API keys as secrets. Keep them on your server, in environment variables, or in a secret manager.

## Can I use an environment variable?

Yes. For local scripts:

```bash theme={null}
export LINKMODEL_API_KEY="<YOUR_API_KEY>"
```

The LinkModel CLI can also read `LINKMODEL_API_KEY`.

## What should I do if a key leaks?

Rotate the key immediately from the Dashboard, update your deployment secrets, and remove the leaked key from logs or repositories.
