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

# Claude Code

> Use Claude Code on Windows, macOS, and Linux with TTAPI's Claude-compatible endpoint

<Callout type="info">
  TTAPI's Claude-compatible base URL is `https://cc.ttapi.io`. Once your local environment variables are set, Claude Code will send requests through TTAPI.
</Callout>

<Tabs sync={false} borderBottom>
  <Tab title="Windows" icon="desktop">
    ## 1. Install

    <CodeGroup>
      ```powershell title="PowerShell" theme={null}
      irm https://claude.ai/install.ps1 | iex
      ```

      ```bat title="CMD" theme={null}
      curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
      ```
    </CodeGroup>

    If `claude` is still not found after installation, reopen your terminal so the updated `PATH` can take effect.

    ## 2. Verify

    ```powershell theme={null}
    claude --version
    ```

    ## 3. Configure TTAPI

    Set the variables for the current session:

    ```powershell theme={null}
    $env:ANTHROPIC_BASE_URL = "https://cc.ttapi.io"
    $env:ANTHROPIC_API_KEY = "YOUR-TT-API-KEY"
    ```

    To persist them for the current Windows user:

    ```powershell theme={null}
    [Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://cc.ttapi.io", "User")
    [Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "YOUR-TT-API-KEY", "User")
    ```

    ## 4. Start

    ```powershell theme={null}
    claude
    ```
  </Tab>

  <Tab title="macOS" icon="apple">
    ## 1. Install

    Official install script:

    ```bash theme={null}
    curl -fsSL https://claude.ai/install.sh | bash
    ```

    Or with Homebrew:

    ```bash theme={null}
    brew install --cask claude-code
    ```

    ## 2. Verify

    ```bash theme={null}
    claude --version
    ```

    ## 3. Configure TTAPI

    ```bash theme={null}
    export ANTHROPIC_BASE_URL="https://cc.ttapi.io"
    export ANTHROPIC_API_KEY="YOUR-TT-API-KEY"
    ```

    Add those lines to `~/.zshrc` or `~/.bashrc` if you want them to persist across sessions.

    ## 4. Start

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

    ## Notes

    * Script installs usually update automatically
    * Homebrew installs require manual upgrades such as `brew upgrade claude-code`
  </Tab>

  <Tab title="Linux" icon="terminal">
    ## 1. Install

    ```bash theme={null}
    curl -fsSL https://claude.ai/install.sh | bash
    ```

    ## 2. Verify

    ```bash theme={null}
    claude --version
    ```

    ## 3. Configure TTAPI

    ```bash theme={null}
    export ANTHROPIC_BASE_URL="https://cc.ttapi.io"
    export ANTHROPIC_API_KEY="YOUR-TT-API-KEY"
    ```

    Add those lines to your shell profile such as `~/.bashrc` or `~/.zshrc` if you want them to persist.

    ## 4. Start

    ```bash theme={null}
    claude
    ```
  </Tab>
</Tabs>

## Required environment variables

```text theme={null}
ANTHROPIC_BASE_URL=https://cc.ttapi.io
ANTHROPIC_API_KEY=YOUR-TT-API-KEY
```

## Troubleshooting

### `claude` command not found

* Reopen the terminal
* Confirm the install path is on `PATH`
* Run `claude --version` again

### Auth or request error after launch

* Check that `ANTHROPIC_BASE_URL` is set to `https://cc.ttapi.io`
* Check that `ANTHROPIC_API_KEY` contains a valid TTAPI key
* Reopen the terminal to reload environment variables

### Can I still use the default Anthropic setup?

Yes. But if you want Claude Code traffic to go through TTAPI, both `ANTHROPIC_BASE_URL` and `ANTHROPIC_API_KEY` must point to the TTAPI-compatible endpoint and your TTAPI key.

### What models does Claude Code support?

Claude Code is not a single fixed model. Instead, it dynamically routes across multiple Claude models. Commonly used models include:

* Claude Opus (high-performance reasoning and complex coding)
* Claude Sonnet (balanced performance and cost for general development)
* Claude Haiku (lightweight and fast for simple tasks)

Click to view the [model list and pricing details](/grids/en/start/pricing/llm#claude-code-supported-models-&-pricing)
