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

# Authentication

> Understand CLI login, platform API keys, routing API keys, and provider keys.

Dari resources belong to an organization. An organization owns routers, API keys, stored credentials, and billing usage.

Dari uses three credential types. **Dashboard login** is for interactive dashboard access. **Platform API keys** authenticate requests to `https://api.dari.dev/v1` for router management, organizations, API keys, credentials, and billing. **Routing API keys** authenticate traffic sent to router chat completion endpoints. Provider keys, such as OpenAI, Anthropic, or Baseten keys, are used only when a router forwards a selected request to a provider. You can use Dari-managed provider keys or store your own keys on a router.

## Dashboard Login

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

This opens a browser, creates a personal organization on first login, and caches credentials locally for supported CLI management commands.

```bash theme={null}
dari auth status
dari org list
dari org create team-blue
dari org switch team-blue
```

## Platform API Keys

Use a platform API key when you call the Dari Platform API directly or run non-interactive CLI commands in CI.

```bash theme={null}
dari api-keys create --name github-actions
```

The plaintext `api_key` is returned once. Store it securely and pass it as a bearer token:

```bash theme={null}
export DARI_API_KEY=dari_...
```

When `DARI_API_KEY` is set, supported CLI commands use it instead of cached login state.

## Routing API Keys

Use a routing API key when your application sends requests to a Dari Router endpoint. Create one from a logged-in shell with `dari api-keys create --name router-client --scope routing`, or create a key with the **Routing** scope from the [Dari dashboard](https://app.dari.dev). Store it separately from platform keys and use a routing key from the same organization as the router.

```bash theme={null}
export DARI_ROUTING_API_KEY="dari_..."

curl "https://routing.dari.dev/rtr_123/chat/completions" \
  -H "Authorization: Bearer $DARI_ROUTING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dari/routing",
    "messages": [{"role": "user", "content": "Write a launch checklist."}]
  }'
```

A key can include both **Platform** and **Routing** scopes when one service needs both Platform API access and router traffic access.

## Provider Keys

Provider keys are not sent by your application on each request. When you create or edit a router, choose **Dari-managed** or **BYOK** for each OpenAI, Anthropic, or Baseten provider represented by the enabled models. Dari stores BYOK keys encrypted and uses the configured key source for the provider that owns the selected model.

See [API Keys](/api-keys) for the scope model and [Configure Provider Keys](/router/configure-provider-keys) for router-specific setup.
