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

# Authentication

> How to authenticate with the Stardeck API using org-level API keys

## API Keys

All API requests require an org-level API key. Keys are created and managed in your organization's **Settings > API Keys** tab in the dashboard.

Each key is assigned a **role** that determines its permissions. The key inherits all permissions of its assigned role.

## Using Your Key

Pass the key in the `Authorization` header with a `Bearer` prefix:

```bash theme={null}
curl https://www.stardeck.ai/api/v1/knowledge \
  -H "Authorization: Bearer sk-org-your-key-here"
```

## Key Security

* Keys are shown **once** at creation time. Store them securely.
* Use environment variables — never hardcode keys in source code.
* Assign the minimum role needed for your use case.
* Revoke keys immediately if compromised.

## Error Responses

| Status | Meaning                                        |
| ------ | ---------------------------------------------- |
| `401`  | Missing, malformed, or revoked API key         |
| `403`  | Key is valid but lacks the required permission |
