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

# Claude Code

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

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

## Quick start

<Steps>
  <Step title="Install Claude Code">
    Official docs: [Claude Code Overview](https://code.claude.com/docs/en/overview)

    <Tabs>
      <Tab title="Native install (macOS/Linux/WSL)">
        ```bash theme={null}
        curl -fsSL https://claude.ai/install.sh | bash
        ```
      </Tab>

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

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

  <Step title="Point Claude Code to NagaAI">
    Claude Code reads Anthropic-compatible environment variables. Configure:

    * Base URL: `https://api.naga.ac`
    * Auth token: your **NagaAI API key**
    * Ensure the default Anthropic API key is explicitly empty (prevents conflicts)
    * (Optional) Override Claude Code’s default model aliases (Haiku/Sonnet/Opus) to specific NagaAI models

    <Warning>
      Do not rely on a project-level `.env` file. Claude Code does not read standard `.env` files by default.
    </Warning>

    <Tabs>
      <Tab title="Shell (macOS/Linux/WSL)">
        ```bash theme={null}
        export ANTHROPIC_BASE_URL="https://api.naga.ac"
        export ANTHROPIC_AUTH_TOKEN="YOUR_NAGAAI_API_KEY"
        export ANTHROPIC_API_KEY="" # Important: must be explicitly empty

        # Optional: map Claude Code tiers to NagaAI 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"
        ```
      </Tab>

      <Tab title="Windows PowerShell">
        ```powershell theme={null}
        $env:ANTHROPIC_BASE_URL="https://api.naga.ac"
        $env:ANTHROPIC_AUTH_TOKEN="YOUR_NAGAAI_API_KEY"
        $env:ANTHROPIC_API_KEY="" # Important: must be explicitly empty

        # Optional: map Claude Code tiers to NagaAI 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"
        ```
      </Tab>

      <Tab title="Project settings file">
        Create a project-level settings file at `.claude/settings.local.json`:

        ```json theme={null}
        {
          "env": {
            "ANTHROPIC_BASE_URL": "https://api.naga.ac",
            "ANTHROPIC_AUTH_TOKEN": "YOUR_NAGAAI_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"
          }
        }
        ```

        <Note>
          Keep this file out of version control if it contains a real API key.
        </Note>
      </Tab>
    </Tabs>

    <Info>
      Need an API key? Create one in the [NagaAI Dashboard](https://naga.ac/dashboard), or start with [Quickstart](/get-started/quickstart).
    </Info>

    <Note>
      You can replace the example model IDs above with any model that supports function calling. See [models with tools support](https://naga.ac/models?parameters=tools).
    </Note>
  </Step>

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

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

    Your requests will be routed through NagaAI’s Anthropic-compatible endpoint (Messages API at `/v1/messages`).
  </Step>

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

    ```text theme={null}
    > /status
    ```

    You should see:

    ```text theme={null}
    Auth token: ANTHROPIC_AUTH_TOKEN
    Anthropic base URL: https://api.naga.ac
    ```
  </Step>
</Steps>

## Try it

* “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.”
