# Claude Code Setup Guide

> Install Claude Code, connect it to LLMoxy with CC Switch or environment variables, and code with Claude models in your terminal.

Claude Code is Anthropic's terminal agent: it reads your repository, edits files, and runs commands. It connects to the official API by default; just point the gateway at LLMoxy.

Before you start, get an [LLMoxy token](https://en.llmoxy.com/docs/get-started/get-token). The **auto** group is recommended.

## Install

Use the official script first (npm is no longer recommended):

```bash
# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
```

Alternatively:

```bash
brew install --cask claude-code          # macOS
winget install Anthropic.ClaudeCode      # Windows
```

Verify:

```bash
claude --version
```

## Connect to LLMoxy

Claude Code uses the Anthropic-compatible endpoint, and the URL does **not** include `/v1`.

| Variable | Value |
| --- | --- |
| `ANTHROPIC_BASE_URL` | `https://llmoxy.com` |
| `ANTHROPIC_AUTH_TOKEN` | Your LLMoxy API Key |

### Option 1: CC Switch (recommended)

Switch providers in a GUI without editing environment variables by hand. For the download and step-by-step screenshots, see the [CC Switch Tutorial](https://en.llmoxy.com/docs/code-tutorials/cc-switch).

- Provider name: LLMoxy
- API Key: your site token
- Request URL: `https://llmoxy.com`
- Main model: `claude-opus-5-5`

### Option 2: Environment variables

**macOS / Linux** (`~/.zshrc` for Zsh, `~/.bashrc` for Bash):

```bash
{
echo ''
echo '# LLMoxy'
echo 'export ANTHROPIC_BASE_URL="https://llmoxy.com"'
echo 'export ANTHROPIC_AUTH_TOKEN="your LLMoxy API Key"'
} >> ~/.zshrc
source ~/.zshrc
```

**Windows PowerShell** (open a new window after setting them):

```powershell
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL","https://llmoxy.com","User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN","your LLMoxy API Key","User")
```

Verify: `echo "$ANTHROPIC_BASE_URL"` should print `https://llmoxy.com`.

## Launch

Go to your project directory:

```bash
claude
```

Type `/model` and choose the model name you just configured (for example `claude-opus-5-5`). Type `/` to see all commands.

![Welcome screen](https://en.llmoxy.com/docs-assets/migrated/tutorial-claudecode-runoob/welcome.png)

![Slash commands](https://en.llmoxy.com/docs-assets/migrated/tutorial-claudecode-runoob/slash.png)

Optional: run `claude doctor` for an environment check.

## FAQ

**`claude: command not found`**
Make sure `claude --version` prints something, then reopen your terminal.

**Still asks me to sign in to a Claude account**
Make sure `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` are in effect. Once a custom gateway is configured, it uses the API Key and you don't need to sign in to claude.ai.

**Permission error on global npm install**
Don't use `sudo npm install -g`. Use the official script, Homebrew, or nvm instead.

**Can't connect**
Test the network with `curl -I https://llmoxy.com`; set `HTTPS_PROXY` if you need a proxy.

This is the markdown version of https://en.llmoxy.com/docs/code-tutorials/claude-code.
