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

# Authentication

> How to authenticate requests to the Tokenomist API with your API key.

The Tokenomist API authenticates every request with an API key sent in a request
header. All requests must be made over HTTPS.

<Info>
  Don't have a key yet? See [Setting up your API key](/api-documents/setting-up-your-api-key).
</Info>

## Base URL

```
https://api.tokenomist.ai
```

<Warning>
  The previous domain `https://api.unlocks.app` still works, but we recommend
  updating integrations to `https://api.tokenomist.ai`.
</Warning>

## Authenticating a request

Send your key in the `x-api-key` header on every request:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.tokenomist.ai/v5/token/list \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  resp = requests.get(
      "https://api.tokenomist.ai/v5/token/list",
      headers={"x-api-key": "YOUR_API_KEY"},
  )
  print(resp.json())
  ```

  ```javascript JavaScript theme={null}
  const resp = await fetch("https://api.tokenomist.ai/v5/token/list", {
    headers: { "x-api-key": "YOUR_API_KEY" },
  });
  const data = await resp.json();
  ```
</CodeGroup>

<Warning>
  Keep your API key server-side. Don't embed it in client-side code or expose it
  in URLs, logs, or browser history.
</Warning>

## Failed authentication

Requests with a missing or invalid key are rejected with `401 Unauthorized` and
are **not** counted against your quota. See
[Rate limits, quotas & errors](/api-documents/rate-limits) for the full error
reference.

<Info>
  The quota state returned in `metadata.credit` only appears on authenticated
  requests. Unauthenticated requests do not include it.
</Info>
