# Claude Code Setup (CLI)

Point Claude Code at the NovAPI gateway via its config file to use the platform's Claude-compatible models.

> 💡 Beginner tip: graphical setup with **CC-Switch** is easier (see "CC-Switch Setup" on the left). The manual setup is below.

## Prerequisites

- You've obtained a NovAPI APIKey (created in the console under "APIKey Management").
- You've installed Claude Code (`npm i -g @anthropic-ai/claude-code`).

## Step 1: Open the config folder

Open your terminal (PowerShell / CMD on Windows, Terminal on macOS), and run the command for your OS to open the Claude Code config folder:

```bash
# Windows (CMD)
start "" "%USERPROFILE%\.claude"

# macOS / Linux
open "$HOME/.claude"
```

![Open the .claude config folder](https://www.novapi.ai/docs/cli/rc-1.webp)

## Step 2: Create settings.json

Manually create `settings.json` in that folder with the following content:

```json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "",
    "ANTHROPIC_BASE_URL": "https://api.novapi.ai",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
```

## Step 3: Fill in the APIKey

Replace the value of `ANTHROPIC_AUTH_TOKEN` with the APIKey you created in the console, and save the file.

## Step 4: Verify

Run `claude` in the terminal and chat to test that the setup works:

```bash
claude
```

![Run claude to verify](https://www.novapi.ai/docs/cli/rc-2.webp)

## Field reference

- `ANTHROPIC_BASE_URL`: the NovAPI gateway address `https://api.novapi.ai`.
- `ANTHROPIC_AUTH_TOKEN`: your APIKey.
- `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`: disables non-essential telemetry; keeping `"1"` is recommended.

## FAQ

- **401 authentication failed**: Check that `ANTHROPIC_AUTH_TOKEN` is correct with no extra spaces, and confirm the APIKey isn't disabled.
- **Connection failed**: Confirm `ANTHROPIC_BASE_URL` is `https://api.novapi.ai` and the network is reachable.
- **Config doesn't take effect**: Confirm `settings.json` is inside the `.claude` folder with valid JSON (no trailing commas), then reopen the terminal after saving.
