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

# Authentication

> API key setup and authentication for the SimLab API

All API requests require an API key passed via the `API-Key` header.

```
API-Key: <your-api-key>
```

## Obtaining a Key

Via the CLI:

```bash theme={null}
simlab auth login
```

This opens [platform.collinear.ai](https://platform.collinear.ai) where you can find your key under **Developers → API Keys**. The key is stored in `~/.config/collinear/config.toml`.

Or set it as an environment variable:

```bash theme={null}
export COLLINEAR_API_KEY="<your-api-key>"
```

## Error Responses

| Status | Meaning                                    |
| ------ | ------------------------------------------ |
| `400`  | Invalid request - see response for details |
| `401`  | Invalid or missing API key                 |
| `403`  | Key valid but insufficient permissions     |
| `503`  | Service temporarily unavailable            |
