> ## 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.

# Claude Code

> Run Claude Code through a Dari Router.

Create a [Routing API key](/api-keys#create-a-routing-key), then start Claude Code with your organization's default router:

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

ANTHROPIC_BASE_URL="https://routing.dari.dev" \
ANTHROPIC_AUTH_TOKEN="$DARI_ROUTING_API_KEY" \
ANTHROPIC_API_KEY="" \
CLAUDE_CODE_EFFORT_LEVEL="auto" \
CLAUDE_CODE_SUBAGENT_MODEL="dari/routing" \
claude --model dari/routing
```

Claude Code sends Anthropic Messages requests to `/v1/messages`. `CLAUDE_CODE_EFFORT_LEVEL="auto"` prevents a saved local effort setting from overriding the router. `CLAUDE_CODE_SUBAGENT_MODEL="dari/routing"` pins every subagent to the router — it overrides both a per-invocation `model` and a custom agent definition's `model`, so delegated work stays on the router instead of falling back to the claude.ai/Anthropic namespace. The default router chooses from its current managed model set, including a reasoning level for each request. Check **Activity** in the dashboard to see each selection.

### Reusable shell function

For a one-word launcher that keeps all of the environment in one place, wrap the invocation in a shell function:

```bash theme={null}
claude-dari() {
  # Read your Routing key from wherever you keep secrets locally.
  local key
  key="$(cat "$DARI_ROUTING_KEY_FILE" 2>/dev/null)"
  if [[ -z "$key" ]]; then
    echo "claude-dari: set DARI_ROUTING_KEY_FILE to your Routing key" >&2
    return 1
  fi

  ANTHROPIC_BASE_URL="https://routing.dari.dev" \
  ANTHROPIC_AUTH_TOKEN="$key" \
  ANTHROPIC_API_KEY="" \
  CLAUDE_CODE_EFFORT_LEVEL="auto" \
  CLAUDE_CODE_SUBAGENT_MODEL="dari/routing" \
    command claude --model dari/routing "$@"
}
```

`--model dari/routing` selects the router for the main session and `CLAUDE_CODE_SUBAGENT_MODEL="dari/routing"` pins subagents to it. Routing `dari/routing` selects the router's model set — it does not force one particular upstream model. The router picks the model and reasoning level per request.

To use a different model set, edit the default router or [Create A Router](/router/create-a-router) with public or [Custom Models](/router/configure-models#custom-models). Set that router as the default to keep this same configuration, or point `ANTHROPIC_BASE_URL` at `https://routing.dari.dev/{router_id}`.
