---
url: /docs/coding-agents/claude-code.md
---
# Claude Code

Claude Code is Anthropic's terminal agent. Route it through Hyper using our
[Anthropic Messages API](/api/anthropic-messages.md) endpoints.

## Prerequisites

* A Hyper account with an API key
* [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed

## Configuration

### Option 1: Settings file (recommended)

Add this to `~/.claude/settings.json`. This persists across sessions without
needing shell env vars:

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://hyper.charm.land",
    "ANTHROPIC_API_KEY": "sk-hyper-xxxxxxxxxxxxxxxxxxxxxxxx",
    "ANTHROPIC_MODEL": "deepseek-v4-pro",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.7-max",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash"
  }
}
```

The alias variables let you use Claude Code's built-in `/model sonnet` and
`/model haiku` commands with Hyper models:

| Alias | Env Var | Suggested Model |
|-------|---------|-----------------|
| `sonnet` | `ANTHROPIC_DEFAULT_SONNET_MODEL` | A strong mid-tier model for daily coding |
| `haiku` | `ANTHROPIC_DEFAULT_HAIKU_MODEL` | A fast model for quick tasks and subagents |

You can also set `CLAUDE_CODE_SUBAGENT_MODEL` to route all subagent work to a
cheaper model:

```json
{
  "env": {
    "CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-flash"
  }
}
```

### Option 2: Environment variables

If you prefer shell config over a settings file:

```bash
export ANTHROPIC_BASE_URL="https://hyper.charm.land"
export ANTHROPIC_API_KEY="sk-hyper-xxxxxxxxxxxxxxxxxxxxxxxx"
export ANTHROPIC_MODEL="deepseek-v4-pro"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3.7-max"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"
```

## Running Claude Code

With configuration in place, start Claude Code normally:

```bash
claude
```

Use `/model` to switch between your configured aliases mid-session. All model
names map to the Hyper catalog.
