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

# Claude Code

> This guide will get you up and running with Claude Code powered by Harogo in just a few minutes.

### 1. Install Claude Code

#### Local Installation

<CodeGroup>
  ```shellscript macOS theme={null}
  curl -fsSL https://claude.ai/install.sh | bash
  ```

  ```shellscript Windows theme={null}
  irm https://claude.ai/install.ps1 | iex
  ```
</CodeGroup>

#### Install via npm

Requires [Node.js 18 or later](https://nodejs.org/en/download/)

```shellscript theme={null}
npm install -g @anthropic-ai/claude-code
```

### 2. Configure the Harogo API

To connect to Harogo's model service through the Anthropic-compatible API, set the following environment variables.

1. Set `ANTHROPIC_BASE_URL` to `https://api.harogo.ai/`
2. Set `ANTHROPIC_AUTH_TOKEN` to the API key you got from the [Harogo platform](https://console.harogo.ai/keys)
3. Set `ANTHROPIC_MODEL` to a Claude model supported by Harogo, for example `claude-sonnet-5`.

<Tabs>
  <Tab title="macOS">
    1) Run the following command in your terminal to check your default shell.

    ```shellscript theme={null}
    echo $SHELL
    ```

    2. Set the environment variables based on your shell type:

    <CodeGroup>
      ```shellscript Zsh theme={null}
      # Replace <HAROGO_API_KEY> with the real key from your Harogo platform
      echo 'export ANTHROPIC_BASE_URL="https://api.harogo.ai"' >> ~/.zshrc
      echo 'export ANTHROPIC_AUTH_TOKEN="<HAROGO_API_KEY>"' >> ~/.zshrc
      echo 'export ANTHROPIC_MODEL="claude-sonnet-5"' >> ~/.zshrc
      ```

      ```shellscript Bash theme={null}
      # Replace <HAROGO_API_KEY> with the real key from your Harogo platform
      echo 'export ANTHROPIC_BASE_URL="https://api.harogo.ai"' >> ~/.bash_profile
      echo 'export ANTHROPIC_AUTH_TOKEN="<HAROGO_API_KEY>"' >> ~/.bash_profile
      echo 'export ANTHROPIC_MODEL="claude-sonnet-5"' >> ~/.bash_profile
      ```
    </CodeGroup>

    3. Run the following command in your terminal to apply the environment variables.

    <CodeGroup>
      ```shellscript Zsh theme={null}
      source ~/.zshrc
      ```

      ```shellscript Bash theme={null}
      source ~/.bash_profile
      ```
    </CodeGroup>

    4. Open a new terminal and run the following commands to confirm the environment variables took effect.

    ```shellscript theme={null}
    echo $ANTHROPIC_BASE_URL
    test -n "$ANTHROPIC_AUTH_TOKEN" && echo "ANTHROPIC_AUTH_TOKEN is set"
    echo $ANTHROPIC_MODEL
    ```
  </Tab>

  <Tab title="Windows">
    On Windows, you can set Harogo's base URL and [API key](https://console.harogo.ai/keys) as environment variables using either CMD or PowerShell.

    <Tabs>
      <Tab title="CMD">
        1. Run the following command in CMD to set the environment variables.

        ```shellscript theme={null}
        REM Replace <HAROGO_API_KEY> with the real key from your Harogo platform
        setx ANTHROPIC_AUTH_TOKEN "<HAROGO_API_KEY>"
        setx ANTHROPIC_BASE_URL "https://api.harogo.ai"
        setx ANTHROPIC_MODEL "claude-sonnet-5"
        ```

        2. Open a new CMD window and run the following commands to confirm the environment variables took effect.

        ```shellscript theme={null}
        if defined ANTHROPIC_AUTH_TOKEN echo ANTHROPIC_AUTH_TOKEN is set
        echo %ANTHROPIC_BASE_URL%
        echo %ANTHROPIC_MODEL%
        ```
      </Tab>

      <Tab title="PowerShell">
        1. Run the following command in PowerShell to set the environment variables.

        ```shellscript theme={null}
        # Replace <HAROGO_API_KEY> with the real key from your Harogo platform
        [Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "<HAROGO_API_KEY>", [EnvironmentVariableTarget]::User)
        [Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.harogo.ai", [EnvironmentVariableTarget]::User)
        [Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-sonnet-5", [EnvironmentVariableTarget]::User)
        ```

        2. Open a new PowerShell window and run the following commands to confirm the environment variables took effect.

        ```shellscript theme={null}
        if ($env:ANTHROPIC_AUTH_TOKEN) { "ANTHROPIC_AUTH_TOKEN is set" }
        echo $env:ANTHROPIC_BASE_URL
        echo $env:ANTHROPIC_MODEL
        ```
      </Tab>
    </Tabs>
  </Tab>
</Tabs>

<Note>
  If you're going to manage Claude Code through CC Switch, we recommend not also setting global `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, or `ANTHROPIC_MODEL` values. System- or user-level environment variables can override the provider config CC Switch writes, so the UI shows the correct provider selected while Claude Code is still actually running on an old key or model.
</Note>

### 3. Verify the Configuration

After setting up environment variables or CC Switch, send one minimal request first to confirm the key, model, and Anthropic-compatible endpoint are all working, before starting a longer session.

<CodeGroup>
  ```bash macOS/Linux theme={null}
  curl https://api.harogo.ai/v1/messages \
    -H "content-type: application/json" \
    -H "anthropic-version: 2023-06-01" \
    -H "x-api-key: $ANTHROPIC_AUTH_TOKEN" \
    -d '{
      "model": "claude-sonnet-5",
      "max_tokens": 16,
      "messages": [{"role": "user", "content": "1+1, output only the answer"}]
    }'
  ```

  ```powershell Windows theme={null}
  curl.exe https://api.harogo.ai/v1/messages `
    -H "content-type: application/json" `
    -H "anthropic-version: 2023-06-01" `
    -H "x-api-key: $env:ANTHROPIC_AUTH_TOKEN" `
    -d "{\"model\":\"claude-sonnet-5\",\"max_tokens\":16,\"messages\":[{\"role\":\"user\",\"content\":\"1+1, output only the answer\"}]}"
  ```
</CodeGroup>

### 4. Start Using Claude Code

Once configured, go to your working directory and run the `claude` command in your terminal to get started.

```bash theme={null}
$ cd /path/your-project
> claude
```

If you see `Not logged in · Please run /login` on startup, or you're dropped into the Anthropic login flow, it usually means Claude Code didn't pick up a working Harogo configuration, or first-time onboarding hasn't been completed. First confirm the minimal request from the previous step returns `2`, and check whether `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, or `ANTHROPIC_MODEL` are being overridden by old global environment variables. Once you've confirmed the key works, if you're still sent to the login flow, you can skip first-time onboarding with the steps below:

<img alt="Terminal showing the login-or-continue prompt on Claude Code's first launch" width="1622" height="438" data-path="public/cn/cc-7.jpg" lightAlt="Terminal showing the login-or-continue prompt on Claude Code's first launch" darkAlt="Terminal showing the login-or-continue prompt on Claude Code's first launch" src="https://mintcdn.com/harogo/Dt737E3V5bGf-GFy/images/cc-7.avif?fit=max&auto=format&n=Dt737E3V5bGf-GFy&q=85&s=7225b5f369b0cbd6031bbf70504d35cb" className="dark:hidden" data-path="images/cc-7.avif" />

<img alt="Terminal showing the login-or-continue prompt on Claude Code's first launch" width="1622" height="438" data-path="public/cn/cc-7.jpg" lightAlt="Terminal showing the login-or-continue prompt on Claude Code's first launch" darkAlt="Terminal showing the login-or-continue prompt on Claude Code's first launch" src="https://mintcdn.com/aihubmix/HZpz50Qb6hBBcBVb/public/cn/cc-7.jpg?fit=max&auto=format&n=HZpz50Qb6hBBcBVb&q=85&s=0d1309bcea8f4170809d104bc2b380a6" className="hidden dark:block" />

1. Locate the `.claude.json` file in your home directory:
   * macOS / Linux: `~/.claude.json`
   * Windows: `C:\Users\%USERNAME%\.claude.json`
2. Set the `hasCompletedOnboarding` field to `true`

```json theme={null}
{
  "hasCompletedOnboarding": true
}
```

3. Save the file, then run `claude` again in your terminal.

#### (Optional) More Ways to Configure the Model

Claude Code supports the following ways to configure the model, **listed from highest to lowest priority** — a higher-priority setting overrides a lower-priority one.

1. **During a conversation:** run the `/model <model-name>` command to switch models. Good for a one-off switch.

```text theme={null}
/model claude-sonnet-5
```

2. **When starting Claude Code:** run `claude --model <model-name>` to specify a model. Good for a single session.

```text theme={null}
claude --model claude-sonnet-5
```

3. **Set environment variables:** configure different tiers of models by task complexity, and Claude Code will automatically pick the right one for the task. Applies globally.

```shellscript theme={null}
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
```

Where:

* `ANTHROPIC_DEFAULT_OPUS_MODEL`: for complex reasoning, architecture design, and other high-difficulty tasks.
* `ANTHROPIC_DEFAULT_SONNET_MODEL`: for writing code, implementing features, and other everyday tasks.
* `ANTHROPIC_DEFAULT_HAIKU_MODEL`: for syntax checks, file search, and other simple tasks.

4. **Set permanently in settings.json:** write the model configuration into Claude Code's user config file (e.g. `~/.claude/settings.json`, or `C:\Users\%USERNAME%\.claude\settings.json` on Windows) or into a project-level config, for a permanent user-level or project-level setting.

## Configuring via CC Switch

1. Launch CC Switch, select **Claude Code** on the left, then click "Add Provider."

<img alt="Add Provider entry point on the CC Switch home screen" width="2068" height="1370" data-path="public/cn/cc-1.jpg" lightAlt="Add Provider entry point on the CC Switch home screen" darkAlt="Add Provider entry point on the CC Switch home screen" src="https://mintcdn.com/harogo/Dt737E3V5bGf-GFy/images/1.png?fit=max&auto=format&n=Dt737E3V5bGf-GFy&q=85&s=2a836038cfa57987927f888a03ce804d" className="dark:hidden" data-path="images/1.png" />

<img alt="Add Provider entry point on the CC Switch home screen" width="2068" height="1370" data-path="public/cn/cc-1.jpg" lightAlt="Add Provider entry point on the CC Switch home screen" darkAlt="Add Provider entry point on the CC Switch home screen" src="https://mintcdn.com/aihubmix/l2uHw7hd14guDu0f/public/cn/cc-1.jpg?fit=max&auto=format&n=l2uHw7hd14guDu0f&q=85&s=257b71ad7c6f876ac31147b7fd81f169" className="hidden dark:block" />

2. From the preset list, choose "Custom Configuration" as the provider.

<img alt="Selecting AiHubMix in the CC Switch provider preset list" width="2072" height="1376" data-path="public/cn/cc-2.jpg" lightAlt="Selecting AiHubMix in the CC Switch provider preset list" darkAlt="Selecting AiHubMix in the CC Switch provider preset list" src="https://mintcdn.com/harogo/Dt737E3V5bGf-GFy/images/iShot_2026-08-07_16.51.01.png?fit=max&auto=format&n=Dt737E3V5bGf-GFy&q=85&s=498c3e627d89252d449547cf0dc2592f" className="dark:hidden" data-path="images/iShot_2026-08-07_16.51.01.png" />

<img alt="Selecting AiHubMix in the CC Switch provider preset list" width="2072" height="1376" data-path="public/cn/cc-2.jpg" lightAlt="Selecting AiHubMix in the CC Switch provider preset list" darkAlt="Selecting AiHubMix in the CC Switch provider preset list" src="https://mintcdn.com/aihubmix/l2uHw7hd14guDu0f/public/cn/cc-2.jpg?fit=max&auto=format&n=l2uHw7hd14guDu0f&q=85&s=16dcb0697fdbf6438d4452ff8c39e485" className="hidden dark:block" />

3. Fill in the provider name, API key, and endpoint ([https://api.harogo.ai](https://api.harogo.ai)), etc. Once everything is filled in, click "Add."

<img alt="Entering the API key on the CC Switch AiHubMix configuration form" width="2070" height="1372" data-path="public/cn/cc-3.jpg" lightAlt="Entering the API key on the CC Switch AiHubMix configuration form" darkAlt="Entering the API key on the CC Switch AiHubMix configuration form" src="https://mintcdn.com/harogo/Dt737E3V5bGf-GFy/images/iShot_2026-08-07_16.55.17.png?fit=max&auto=format&n=Dt737E3V5bGf-GFy&q=85&s=c0bfb3797e93b7c667e7f3e3675d490f" className="dark:hidden" data-path="images/iShot_2026-08-07_16.55.17.png" />

<img alt="Entering the API key on the CC Switch AiHubMix configuration form" width="2070" height="1372" data-path="public/cn/cc-3.jpg" lightAlt="Entering the API key on the CC Switch AiHubMix configuration form" darkAlt="Entering the API key on the CC Switch AiHubMix configuration form" src="https://mintcdn.com/aihubmix/qVeqJ54P7wCzwnj-/public/cn/cc-3.jpg?fit=max&auto=format&n=qVeqJ54P7wCzwnj-&q=85&s=30deb64e7737ba515d70b161ee19ea58" className="hidden dark:block" />

4. Back on the home screen, select "harogo" from the provider list and click "Use."

<img alt="Selecting AiHubMix and clicking Launch on the CC Switch home screen" width="2068" height="1366" data-path="public/cn/cc-5.jpg" lightAlt="Selecting AiHubMix and clicking Launch on the CC Switch home screen" darkAlt="Selecting AiHubMix and clicking Launch on the CC Switch home screen" src="https://mintcdn.com/harogo/Dt737E3V5bGf-GFy/images/iShot_2026-08-07_17.00.16.png?fit=max&auto=format&n=Dt737E3V5bGf-GFy&q=85&s=f8c6626080c7eb41a72550116b226681" className="dark:hidden" data-path="images/iShot_2026-08-07_17.00.16.png" />

<img alt="Selecting AiHubMix and clicking Launch on the CC Switch home screen" width="2068" height="1366" data-path="public/cn/cc-5.jpg" lightAlt="Selecting AiHubMix and clicking Launch on the CC Switch home screen" darkAlt="Selecting AiHubMix and clicking Launch on the CC Switch home screen" src="https://mintcdn.com/aihubmix/l2uHw7hd14guDu0f/public/cn/cc-5.jpg?fit=max&auto=format&n=l2uHw7hd14guDu0f&q=85&s=4e765832e55e9737c91e2b40bf127c5d" className="hidden dark:block" />

> <Frame>
>   <img alt="Checking model configuration with the status and models commands in the Claude Code terminal" width="1142" height="1068" data-path="images/image-68.png" lightAlt="Checking model configuration with the status and models commands in the Claude Code terminal" darkAlt="Checking model configuration with the status and models commands in the Claude Code terminal" src="https://mintcdn.com/harogo/Dt737E3V5bGf-GFy/images/iShot_2026-08-07_17.03.17.png?fit=max&auto=format&n=Dt737E3V5bGf-GFy&q=85&s=aceca650e7f586a17db31cb77f526477" className="dark:hidden" data-path="images/iShot_2026-08-07_17.03.17.png" />
>
>   <img alt="Checking model configuration with the status and models commands in the Claude Code terminal" width="1142" height="1068" data-path="images/image-68.png" lightAlt="Checking model configuration with the status and models commands in the Claude Code terminal" darkAlt="Checking model configuration with the status and models commands in the Claude Code terminal" src="https://mintcdn.com/aihubmix/mDZumr5HeEPTKpFC/images/image-68.png?fit=max&auto=format&n=mDZumr5HeEPTKpFC&q=85&s=a6dd56f69a939f0a6b174cefc371cee7" className="hidden dark:block" />
> </Frame>
>
> <Frame>
>   <img src="https://mintcdn.com/harogo/Dt737E3V5bGf-GFy/images/iShot_2026-08-07_17.04.52.png?fit=max&auto=format&n=Dt737E3V5bGf-GFy&q=85&s=c5d4b86d157ee5091257989812ada0d9" alt="I Shot 2026 08 07 17 04 52" width="1212" height="814" data-path="images/iShot_2026-08-07_17.04.52.png" />
> </Frame>
>
> Tip: once Claude Code is open in your terminal, type <kbd>/status</kbd> to check the model ID, or <kbd>/models</kbd> to pick another configured model.

<Warning>
  If CC Switch shows "System environment variable conflict detected," deal with `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, and `ANTHROPIC_MODEL` first. These global variables override the current provider config — a placeholder value like `ANTHROPIC_AUTH_TOKEN=AIHUBMIX_API_KEY` will cause authentication to fail outright. Once you're sure you no longer need the global variables, remove the conflicting entries in CC Switch, or manually delete the system/user environment variables and restart your terminal.
</Warning>
