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

# Claude Code

> Use Claude Code with Lyceum's inference models

Point Claude Code at Lyceum's inference endpoint to use it with any of our supported models and switch between them mid-session with `/model`, no restart needed.

## Setup

The recommended way is the Lyceum CLI. `lyceum code` launches Claude Code preconfigured, in its own profile that never touches an existing Anthropic login:

```bash theme={null}
pip install lyceum-cli
lyceum auth login --api-key lk_<your_api_key>   # one-time
lyceum code
```

Get your API key from the [dashboard](https://dashboard.lyceum.technology).

Trying it out in a single terminal without installing anything? Set these two environment variables before starting Claude Code:

```bash theme={null}
export ANTHROPIC_BASE_URL=https://api.lyceum.technology/api/v2/external/claude
export ANTHROPIC_API_KEY=lk_<your_api_key>
claude
```

Or write the same two values into `~/.claude/settings.json` yourself for a setup that persists across terminals:

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.lyceum.technology/api/v2/external/claude",
    "ANTHROPIC_API_KEY": "lk_<your_api_key>"
  }
}
```

Prefer a one-line script that does the settings.json edit for you? Run:

```bash theme={null}
curl -fsSL https://lyceum.technology/install-claude.sh | sh -s -- lk_<your_api_key>
claude
```

## Switching models mid-session

Pass any Lyceum model ID directly to `/model` inside Claude Code:

```
/model z-ai/glm-5.2
/model moonshotai/kimi-k2.6
/model deepseek/deepseek-v4-pro
```

The switch takes effect with your next message. No restart, your conversation context stays. Any model from the [serverless catalog](https://lyceum.technology/products/inference/models) works. IDs are case-insensitive, and slash-free variants (`z-ai-glm-5.2`) are accepted for clients that reject `/` in model names.

Note: the bare `/model` menu (without an argument) only lists Anthropic tier names and selecting there switches between the tiers mapped below, not the full catalog.

## Model mapping

Anthropic tier names map to Lyceum models automatically:

| Claude tier                      | Model          |
| -------------------------------- | -------------- |
| claude-fable-\* / claude-opus-\* | GLM-5.2        |
| claude-sonnet-\*                 | Kimi-K2.7-Code |
| claude-haiku-\*                  | MiniMax-M3     |

Model selection precedence, highest first:

1. A Lyceum model ID in the request's `model` field (what `/model <id>` sends)
2. A fixed-model endpoint path as the base URL, e.g. `.../external/claude-kimi` or `.../external/claude-deepseek`
3. The tier mapping above

## Switching from Anthropic to Lyceum

If you previously used Claude Code with a direct Anthropic key, make sure to update both variables - not just the base URL. Claude Code warns you if both a claude.ai session and `ANTHROPIC_API_KEY` are set at the same time. To avoid auth conflicts, run `/logout` inside Claude Code before setting the Lyceum key, or use `lyceum code`, which runs in a separate profile.

## Note on 1M context models

Avoid using `sonnet[1m]` or similar extended-context variants. The `[1m]` suffix is Anthropic-specific and Claude Code will not connect through the proxy with it set. Use `sonnet` instead, either via `/model` in Claude Code or by setting `"model": "sonnet"` in `~/.claude/settings.json`.

## Troubleshooting

**Selected "No (not recommended)" at the API key prompt?** On first start, Claude Code asks whether to use the configured API key. If you decline, it stores that choice and never asks again, so requests won't reach Lyceum. Reset the profile to get the prompt back:

```bash theme={null}
rm -rf ~/.lyceum/claude
lyceum code
```

Then select **Yes** at the API key prompt. This only resets the Lyceum profile (including its session history); an existing Anthropic Claude Code setup is untouched.
