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

# Claude Code

> Use Auriko as your LLM provider in Claude Code

Auriko connects to Claude Code through environment variables, giving you access to multiple models through a single API key.

## Prerequisites

* [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and working
* An [Auriko API key](https://auriko.ai/signup?redirectTo=%2Fdashboard%3Ftab%3Dapi-keys)

## Clear existing Anthropic login

If you've previously logged in to Claude Code with an Anthropic account, cached credentials take precedence over environment variables. Clear them first:

```bash theme={null}
claude auth logout
```

If you haven't logged in with Anthropic directly, skip this step.

## Set your API key

Add these three lines to your shell profile (`~/.zshrc` on macOS, `~/.bashrc` on Linux):

```bash theme={null}
export ANTHROPIC_BASE_URL="https://api.auriko.ai"
export ANTHROPIC_AUTH_TOKEN="ak_live_..."   # your Auriko API key
export ANTHROPIC_API_KEY=""
```

`ANTHROPIC_API_KEY=""` must be an empty string. If it contains any value, Claude Code uses it directly against Anthropic, bypassing Auriko.

The base URL must not include `/v1`. Claude Code appends `/v1/messages` itself.

Reload your shell after saving:

```bash theme={null}
source ~/.zshrc   # or: source ~/.bashrc
```

Or open a new terminal.

<Accordion title="Use Auriko alongside a direct Anthropic subscription">
  To keep `claude` connected to your Anthropic account, create a wrapper command instead of modifying your shell profile.

  Add your Auriko API key to your shell profile (`~/.zshrc` or `~/.bashrc`):

  ```bash theme={null}
  export AURIKO_API_KEY="ak_live_..."
  ```

  Create the wrapper script:

  ```bash theme={null}
  mkdir -p ~/.local/bin
  cat > ~/.local/bin/claude-auriko << 'EOF'
  #!/usr/bin/env bash
  export ANTHROPIC_BASE_URL="https://api.auriko.ai"
  export ANTHROPIC_AUTH_TOKEN="${AURIKO_API_KEY}"
  export ANTHROPIC_API_KEY=""
  exec claude "$@"
  EOF
  chmod +x ~/.local/bin/claude-auriko
  ```

  Add `~/.local/bin` to your `PATH` if it isn't already:

  ```bash theme={null}
  export PATH="$HOME/.local/bin:$PATH"
  ```

  Reload your shell, then verify:

  ```bash theme={null}
  claude-auriko -p "Say exactly: setup-ok" --model claude-haiku-4-5-20251001
  ```

  Use `claude-auriko` for Auriko sessions and `claude` for your Anthropic subscription. You don't need to clear your Anthropic login.

  <Warning>
    **Model defaults are shared.** The `/model` command saves your choice to `~/.claude/settings.json`, which both `claude` and `claude-auriko` read. Setting `/model deepseek-v4-pro` in an Auriko session changes the default for your Anthropic subscription too.

    To avoid this, set a default model in the wrapper script so Auriko sessions start with the right model without touching `settings.json`:

    ```bash theme={null}
    #!/usr/bin/env bash
    export ANTHROPIC_BASE_URL="https://api.auriko.ai"
    export ANTHROPIC_AUTH_TOKEN="${AURIKO_API_KEY}"
    export ANTHROPIC_API_KEY=""

    # Default to deepseek-v4-pro unless --model is passed explicitly
    has_model=false
    for arg in "$@"; do
      [[ "$arg" == "--model" ]] && has_model=true
    done

    if $has_model; then
      exec claude "$@"
    else
      exec claude --model deepseek-v4-pro "$@"
    fi
    ```

    The `--model` flag is session-only and does not persist. You can still switch models mid-session with `/model`, but be aware it saves globally.
  </Warning>
</Accordion>

## Verify

```bash theme={null}
claude -p "Say exactly: setup-ok" --model claude-haiku-4-5-20251001
```

Claude Code includes a system prompt on every request. The first request in a session costs more than follow-ups due to [prompt caching](/guides/prompt-caching). Factor this into your cost estimates.

## Use different models

Pass any Auriko model ID with the `--model` flag:

```bash theme={null}
claude --model deepseek-v4-flash
claude --model gemini-2.5-flash
claude --model grok-4.3
```

Model IDs must be exact. Claude Code requires reasoning support from every model.

Models that don't support reasoning return a `400` error. Browse per-model capabilities in the [directory API](https://api.auriko.ai/v1/directory/models).

These are some of the models available through Auriko:

| Model                    | Author    | Context |
| ------------------------ | --------- | ------- |
| `claude-sonnet-4-6`      | Anthropic | 1M      |
| `claude-opus-4-6`        | Anthropic | 1M      |
| `claude-opus-4-7`        | Anthropic | 1M      |
| `deepseek-v4-flash`      | DeepSeek  | 1M      |
| `deepseek-v4-pro`        | DeepSeek  | 1M      |
| `gemini-2.5-flash`       | Google    | 1M      |
| `gemini-2.5-pro`         | Google    | 1M      |
| `gemini-3.1-pro-preview` | Google    | 1M      |
| `glm-5.1`                | Z.AI      | 200K    |
| `grok-4.3`               | xAI       | 1M      |
| `kimi-k2.5`              | Moonshot  | 262K    |
| `kimi-k2.6`              | Moonshot  | 262K    |
| `minimax-m2-7`           | MiniMax   | 205K    |
| `minimax-m2-7-highspeed` | MiniMax   | 205K    |
| `qwen-3.6-plus`          | Alibaba   | 1M      |

To list available models:

```bash theme={null}
curl -s -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
  https://api.auriko.ai/v1/models | jq '.data[].id'
```

The `/model` picker in interactive sessions lists only Claude tier names (Opus, Sonnet, and Haiku). To switch to a non-Claude model mid-session, type the full ID: `/model deepseek-v4-flash`. You can also remap the tier aliases (next section) so picker entries route through Auriko.

## Override model tier aliases

Claude Code uses three model tiers (sonnet, opus, haiku). You can override which model each tier maps to:

```bash theme={null}
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-flash"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-7"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5-20251001"
```

Add these to your shell profile alongside the other environment variables. If you're using the `claude-auriko` wrapper, add these exports to the wrapper script instead.

## Switch back to direct Anthropic

Remove or comment out the three environment variables from your shell profile, then reload and re-authenticate:

```bash theme={null}
source ~/.zshrc
claude auth login
```

## Troubleshoot

| Symptom                                                          | Cause                                                                                  | Fix                                                              |
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| "model may not exist or you may not have access"                 | Model ID isn't exact (e.g., `claude-haiku-4-5` instead of `claude-haiku-4-5-20251001`) | Use the full model ID from `GET /v1/models`                      |
| Requests go to Anthropic directly, not Auriko                    | `ANTHROPIC_API_KEY` contains a value                                                   | Set `ANTHROPIC_API_KEY=""` (empty string, not unset)             |
| "Invalid API Key" or auth errors                                 | Cached Anthropic OAuth credentials                                                     | Run `claude auth logout`, then verify env vars are set           |
| Requests hang or timeout                                         | `ANTHROPIC_BASE_URL` includes `/v1`                                                    | Use `https://api.auriko.ai` only                                 |
| "does not support reasoning/extended thinking"                   | Claude Code requires reasoning support but this model doesn't have it                  | Use a reasoning-capable model (see "Use different models" above) |
| `apiKeySource: none` in session events                           | Claude Code doesn't classify `ANTHROPIC_AUTH_TOKEN` as a key source                    | Expected behavior. Requests authenticate correctly               |
| `/model` in `claude-auriko` changes the default for `claude` too | Both commands share `~/.claude/settings.json` and `/model` saves globally              | Use `--model` in the wrapper script (see wrapper section above)  |
