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

# Authentication

> How to authenticate your requests.

Askr uses **API keys** to authenticate requests. Pass your key as a Bearer token
in the `Authorization` header on every call.

```bash theme={null}
Authorization: Bearer ASKR_API_KEY
```

## Getting a key

Create and manage keys from your [dashboard](https://heyaskr.ai). Each key draws
from the same account balance. You can:

* Create multiple keys (e.g. one per app or environment).
* Set a **spending limit** and reset period per key.
* Set an **expiry date**.
* Revoke a key at any time.

<Warning>
  Treat your API key like a password. Never commit it to source control or expose
  it in front-end code that users can view. For browser apps, route requests
  through your own backend, or use a per-user key funded by that user.
</Warning>

## Keys vs credit ID

Askr accounts have two identifiers:

<ParamField path="api_key" type="string">
  A secret token used to authenticate API calls (`Authorization: Bearer ...`).
</ParamField>

<ParamField path="credit_id" type="string">
  A public identifier for your balance, used for reading balance and for
  top-ups. It is not secret, but it cannot be used to make inference calls.
</ParamField>

## Test your key

```bash theme={null}
curl https://api.heyaskr.ai/v1/models \
  -H "Authorization: Bearer ASKR_API_KEY"
```

A `200` response with a list of models means your key works.
