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

# Claude Code

> Route Claude Code through the Icelake OpenAI-compatible API with claude-code-router.

[Claude Code](https://docs.anthropic.com/en/docs/claude-code) is Anthropic's agentic coding CLI. Point it at Icelake for private, usage-based inference on OpenAI-compatible models.

Claude Code talks to Anthropic's API by default. To use Icelake you need a small local proxy: [claude-code-router](https://github.com/musistudio/claude-code-router) (`ccr`). It intercepts Claude Code traffic and forwards chat completions to Icelake.

## Prerequisites

* Node.js 18+
* An Icelake account with API credits
* An API key from [API keys](https://icelake.io/api/keys)

## Fastest setup

### 1. Install Claude Code and the router

```bash theme={null}
npm install -g @anthropic-ai/claude-code
# CLI config.json flow (recommended for docs / automation):
npm install -g @musistudio/claude-code-router@1.0.73
```

> **Note:** CCR `3.x` is the desktop/UI product and does not use `config.json` the same way. For the copy-paste JSON setup below, use **1.0.73** (or any 1.x with `ccr start` / `ccr code`).

### 2. Create the router config

```bash theme={null}
mkdir -p ~/.claude-code-router
```

Create `~/.claude-code-router/config.json` (Windows: `%USERPROFILE%\.claude-code-router\config.json`):

```json theme={null}
{
  "LOG": true,
  "LOG_LEVEL": "info",
  "API_TIMEOUT_MS": 600000,
  "HOST": "127.0.0.1",
  "Providers": [
    {
      "name": "icelake",
      "api_base_url": "https://icelake.io/api/v1/chat/completions",
      "api_key": "icl_YOUR_KEY_HERE",
      "models": [
        "claude-opus-4-8",
        "claude-opus-4-8-fast",
        "claude-opus-4-7",
        "claude-opus-4-7-fast",
        "claude-opus-4-6",
        "claude-opus-4-5",
        "claude-sonnet-4-6",
        "claude-sonnet-4-5",
        "claude-sonnet-5",
        "claude-fable-5",
        "zai-org-glm-5-2",
        "qwen3-coder-480b-a35b-instruct-turbo"
      ],
      "transformer": {
        "use": ["anthropic"]
      }
    }
  ],
  "Router": {
    "default": "icelake,claude-opus-4-8",
    "think": "icelake,claude-opus-4-8",
    "background": "icelake,claude-sonnet-4-6",
    "longContext": "icelake,claude-opus-4-8",
    "longContextThreshold": 100000
  }
}
```

Replace `icl_YOUR_KEY_HERE` with your key. Confirm model ids with:

```bash theme={null}
curl https://icelake.io/api/v1/models
```

Claude-family model ids work best with the `anthropic` transformer (same pattern as other OpenAI-compatible Claude hosts). For non-Claude coding models only, you can switch the transformer to `openrouter` and set Router defaults to that model id.

If you edit `config.json` while the router is running, apply changes with `ccr restart`.

### 3. Launch

```bash theme={null}
ccr start
ccr code
```

Or:

```bash theme={null}
eval "$(ccr activate)" && claude
```

## Staging / dev endpoint

Point the provider at the host that serves your preview/staging deployment of the platform API (same path shape: `/api/v1/chat/completions`). Production hosts:

| Environment    | Base (append `/chat/completions` for the router) |
| -------------- | ------------------------------------------------ |
| **Production** | `https://icelake.io/api/v1`                      |

Use a key created in that environment. For a Vercel preview URL, use `https://<preview-host>/api/v1/chat/completions`.

```json theme={null}
{
  "name": "icelake-dev",
  "api_base_url": "https://YOUR_STAGING_HOST/api/v1/chat/completions",
  "api_key": "icl_YOUR_DEV_KEY",
  "models": ["claude-opus-4-8", "claude-sonnet-4-6", "zai-org-glm-5-2"],
  "transformer": {
    "use": ["anthropic"]
  }
}
```

Then set Router defaults to `icelake-dev,claude-opus-4-8`.

## How the endpoint is used

| Piece     | Value                           |
| --------- | ------------------------------- |
| Protocol  | OpenAI Chat Completions         |
| Path      | `POST /api/v1/chat/completions` |
| Auth      | `Authorization: Bearer icl_…`   |
| Streaming | Supported (`stream: true`)      |
| Models    | From `GET /api/v1/models`       |

The router converts Claude Code's Anthropic-shaped requests into OpenAI chat completions for Icelake. You do **not** need a separate Icelake “Claude Code API” — the standard public chat endpoint is the integration surface.

## Supported Claude-family models (examples)

Ids available on the public catalog (verify with `GET /models`):

| Model                | Icelake id             |
| -------------------- | ---------------------- |
| Claude Opus 4.8      | `claude-opus-4-8`      |
| Claude Opus 4.8 Fast | `claude-opus-4-8-fast` |
| Claude Opus 4.7      | `claude-opus-4-7`      |
| Claude Opus 4.6      | `claude-opus-4-6`      |
| Claude Opus 4.5      | `claude-opus-4-5`      |
| Claude Sonnet 4.6    | `claude-sonnet-4-6`    |
| Claude Sonnet 4.5    | `claude-sonnet-4-5`    |
| Claude Sonnet 5      | `claude-sonnet-5`      |
| Claude Fable 5       | `claude-fable-5`       |

Non-Claude coding models (e.g. `zai-org-glm-5-2`, `qwen3-coder-480b-a35b-instruct-turbo`) also work through the same endpoint when listed in your provider config.

## Switch models inside Claude Code

```text theme={null}
/model icelake,claude-sonnet-4-6
```

Use any id listed under your provider's `models` array (and available from `GET /models`).

## GUI config (optional)

```bash theme={null}
ccr ui
```

Opens a browser UI for editing providers and routing without hand-editing JSON.

## Debugging

```bash theme={null}
# Server / HTTP logs
~/.claude-code-router/logs/ccr-*.log

# App / routing log
~/.claude-code-router/claude-code-router.log
```

Set `"LOG_LEVEL": "debug"` in config for more detail.

Common issues:

| Symptom   | Check                                                  |
| --------- | ------------------------------------------------------ |
| 401       | API key prefix `icl_`, not expired/revoked             |
| 402       | Wallet credits on that environment                     |
| 404 model | Model id from `GET /models` for that env               |
| Timeout   | Raise `API_TIMEOUT_MS`; long agent turns need headroom |

## Smoke-test the API (without Claude Code)

Before wiring the router, verify the endpoint:

```bash theme={null}
export ICELAKE_API_KEY='icl_...'

curl -sS https://icelake.io/api/v1/chat/completions \
  -H "Authorization: Bearer $ICELAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Reply with pong only"}],
    "stream": false
  }'
```

## Notes

* Claude Code is built around Claude-specific features (e.g. extended thinking). Non-Claude models on Icelake work for many coding tasks but may not match Anthropic behavior 1:1.
* Prefer a strong coding model from `GET /models` as your Router `default`. Claude-family models may require a paid plan; free tiers can use models like `zai-org-glm-5-2` or `qwen3-coder-480b-a35b-instruct-turbo` for smoke tests.
* Keep keys out of git; use a local config file only.

## Related

* [Quickstart](/quickstart)
* [OpenAI SDK](/guides/openai-sdk)
* [Tools & OpenRouter-style clients](/guides/openrouter)
* [Chat completions](/api-reference/chat)
* Marketing overview: [Claude Code with Icelake](https://icelake.io/use-cases/claude-code)
