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

# API Keys

> Create and manage API keys

# API Keys

API keys connect your app to the burn0 dashboard. Each key is linked to a project and your user account.

## Creating a key

1. Go to [burn0.dev/dashboard/keys](https://burn0.dev/dashboard/keys)
2. Click **"New key"**
3. Enter a name (e.g., "dev laptop", "staging", "production")
4. Optionally set a project name
5. **Copy the key immediately** — it's only shown once

## Key format

```
b0_sk_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
```

Keys start with `b0_sk_` followed by 32 hex characters.

## Using the key

Add it to your project's `.env` file:

```bash theme={null}
BURN0_API_KEY=b0_sk_your_key_here
```

Or use the CLI:

```bash theme={null}
npx burn0 connect
```

## Multiple keys

You can create multiple keys for different environments:

| Key name   | Project        | Environment       |
| ---------- | -------------- | ----------------- |
| dev laptop | my-app         | Local development |
| staging    | my-app-staging | Staging server    |
| production | my-app         | Production        |

Each key's events appear separately in the dashboard, grouped by project name.

## Revoking a key

Click **"Revoke"** next to any key in the dashboard. The key is deactivated immediately — any SDK using that key will get 401 errors. Revoked keys cannot be reactivated.

<Warning>
  Revoking a key cannot be undone. Create a new key if you need to re-enable tracking.
</Warning>

## Security

* Keys are shown in full only at creation time
* The dashboard only shows the first 10 characters
* Add `.env` to `.gitignore` to prevent accidental commits
* `burn0 init` and `burn0 connect` add `.env` to `.gitignore` automatically
