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

# Authentication

> How to authenticate with the Clustr API

All API requests require a Bearer token in the `Authorization` header.

```
Authorization: Bearer <your_api_key>
```

## Creating an API key

1. Go to the [API settings page](https://app.clustr-ai.com/api)
2. Click **Create New Key**
3. Copy the key immediately. It won't be shown again

You can create up to 10 API keys per workspace.

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.clustr-ai.com/api/public/target-accounts \
    -H "Authorization: Bearer clstr_abc123..."
  ```

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

  headers = {"Authorization": "Bearer clstr_abc123..."}
  response = requests.get(
      "https://api.clustr-ai.com/api/public/target-accounts",
      headers=headers
  )
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.clustr-ai.com/api/public/target-accounts",
    { headers: { Authorization: "Bearer clstr_abc123..." } }
  );
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET",
      "https://api.clustr-ai.com/api/public/target-accounts", nil)
  req.Header.Set("Authorization", "Bearer clstr_abc123...")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Error responses

| Status | Meaning                                       |
| ------ | --------------------------------------------- |
| `401`  | Missing or invalid API key                    |
| `403`  | API key does not have access to this resource |
