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

# Authentication

> Learn how to authenticate your API requests to CubeStack.

# Authentication

CubeStack supports two access modes: **public access** and **API key authentication**.

## Public Access

If a cube has public access enabled, you can fetch records without authentication. Public access only exposes fields explicitly marked as public.

```bash theme={null}
curl "https://api.cubestack.app/api/v1/{project-slug}/{cube-slug}"
```

## API Key Authentication

For full access to your data, use an API key. Pass it in the `X-Api-Key` header:

```bash theme={null}
curl "https://api.cubestack.app/api/v1/{project-slug}/{cube-slug}" \
  -H "X-Api-Key: your-api-key"
```

## Getting Your API Key

1. Navigate to your project in the admin panel
2. Go to **Settings** > **API Keys**
3. Click **Generate New Key**
4. Copy and store the key securely — it won't be shown again

<Warning>
  Keep your API keys secret. Never expose them in client-side code or public repositories.
</Warning>

## Access Levels

| Access Mode     | Read | Write | Columns Available  |
| --------------- | ---- | ----- | ------------------ |
| Public (no key) | Yes  | No    | Public fields only |
| API Key         | Yes  | Yes   | All fields         |

## Next Steps

<Card title="First Request" icon="paper-plane" href="/getting-started/first-request">
  Make your first authenticated API request
</Card>
