Skip to main content
Dari API keys are scoped. Use the narrowest scope that matches the work a client needs to perform.

Scopes

ScopeUse It ForSend It To
platformManaging agents, sessions, files, webhooks, organizations, API keys, and credentials.https://api.dari.dev/v1
routingSending OpenAI-compatible chat completion requests through a router.https://routing.dari.dev/{router_id}/chat/completions
A key can have both scopes. Use a dual-scope key only when the same backend service needs Platform API access and router traffic access.

Create A Platform Key With The CLI

dari auth login
dari api-keys create --name github-actions
Store the returned api_key as DARI_API_KEY in your environment or CI secret store.
export DARI_API_KEY=dari_...

Create A Routing Key

Use the CLI from a logged-in shell:
dari api-keys create --name router-client --scope routing
You can also open the Dari dashboard, go to API Keys, choose Create Key, select the Routing scope, and copy the key immediately. The full key is shown only once. Use the key as a bearer token when calling a router endpoint:
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": "Summarize this release note."}]
  }'
To create a dual-scope key, repeat --scope or pass a comma-separated list:
dari api-keys create --name backend-service --scope platform --scope routing

Provider Keys Are Different

OpenAI, Anthropic, and OpenRouter keys are provider credentials, not Dari API keys. For router traffic, you can either use Dari-managed provider keys or store your own encrypted provider keys under Configure Provider Keys. Dari uses the configured provider key source after the router selects a model.