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

# Claude Code

> Use Claude Code with Routeway to access multiple models through a single Anthropic-compatible endpoint.

Claude Code connects to Routeway using the **Anthropic Messages API**. This lets you run Claude Code with your **Routeway API key** and choose any model that supports function calling (tools).

<Note>
  Requires a valid Routeway API key. Get yours from the [dashboard](https://routeway.ai/dashboard/api-keys).
</Note>

***

## Quick Start

<Steps>
  <Step title="Install Claude Code">
    Follow the [official installation guide](https://docs.anthropic.com/en/docs/claude-code/overview) for your platform:

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

      ```powershell Windows PowerShell theme={null}
      irm https://claude.ai/install.ps1 | iex
      ```

      ```bash npm theme={null}
      npm install -g @anthropic-ai/claude-code
      ```
    </CodeGroup>
  </Step>

  <Step title="Point Claude Code to Routeway">
    Claude Code reads Anthropic-compatible environment variables. Set the base URL to Routeway and provide your API key.

    <Warning>
      Claude Code does not read `.env` files by default. Set these variables in your shell profile or use the project settings file method below.
    </Warning>

    <CodeGroup>
      ```bash Shell (macOS / Linux / WSL) theme={null}
      export ANTHROPIC_BASE_URL="https://api.routeway.ai"
      export ANTHROPIC_AUTH_TOKEN="YOUR_ROUTEWAY_API_KEY"
      export ANTHROPIC_API_KEY="" # Must be explicitly empty to prevent conflicts

      # Optional: map Claude Code tiers to specific model IDs
      export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4.5"
      export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4.5"
      export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4.5"
      ```

      ```powershell Windows PowerShell theme={null}
      $env:ANTHROPIC_BASE_URL="https://api.routeway.ai"
      $env:ANTHROPIC_AUTH_TOKEN="YOUR_ROUTEWAY_API_KEY"
      $env:ANTHROPIC_API_KEY="" # Must be explicitly empty to prevent conflicts

      # Optional: map Claude Code tiers to specific model IDs
      $env:ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4.5"
      $env:ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4.5"
      $env:ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4.5"
      ```

      ```json Project Settings (.claude/settings.local.json) theme={null}
      {
        "env": {
          "ANTHROPIC_BASE_URL": "https://api.routeway.ai",
          "ANTHROPIC_AUTH_TOKEN": "YOUR_ROUTEWAY_API_KEY",
          "ANTHROPIC_API_KEY": "",

          "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5",
          "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4.5",
          "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.5"
        }
      }
      ```
    </CodeGroup>

    <Info>
      Keep the project settings file out of version control if it contains a real API key.
    </Info>

    You can replace the example model IDs with any model that supports function calling. See the [models list](https://routeway.ai/models).
  </Step>

  <Step title="Start Claude Code">
    In your project directory, run:

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

    Your requests will be routed through Routeway's Anthropic-compatible endpoint (`/v1/messages`).
  </Step>

  <Step title="Verify">
    Inside Claude Code, run:

    ```
    /status
    ```

    You should see output like:

    ```
    Auth token: ANTHROPIC_AUTH_TOKEN
    Anthropic base URL: https://api.routeway.ai
    ```
  </Step>
</Steps>

***

## Example Prompts

Try these once you're connected:

* *"Summarize this project: key folders, build system, and entry points."*
* *"Find where X is implemented and list the relevant files."*
* *"Run tests and fix the first failing test."*
* *"Refactor: extract helper Y and update all call sites."*
