# Run Claude Code on KeepRouter — Claude plus cheaper models, one key

Claude Code speaks Anthropic's Messages API. KeepRouter serves that API natively at /v1/messages, so you can point Claude Code at KeepRouter and run Claude at cost — or drop in a cheaper model like Zhipu GLM, DeepSeek, or Kimi for routine work, with the same two-line setup. One prepaid key, 50+ models, no extra accounts.

## Setup (two lines)

Point Claude Code at KeepRouter with two environment variables:

```bash
export ANTHROPIC_BASE_URL=https://keeprouter.com
export ANTHROPIC_AUTH_TOKEN=sk-kr-your-key
```

Or add them to `~/.claude/settings.json`:

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://keeprouter.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-kr-your-key"
  }
}
```

Then run `claude` as usual. Streaming, tool use, and extended thinking pass straight through the native Messages API.

## Pick a model for the job

Switch models with `/model <id>`. These all work over the native Messages endpoint:

| Model | Maker | Price /1M (in / out) | Good for |
|---|---|---|---|
| `claude-opus-4-8` | Anthropic | $5.00 / $25.00 | hardest reasoning + long agentic coding |
| `claude-sonnet-4-6` | Anthropic | $3.00 / $15.00 | balanced daily driver |
| `claude-haiku-4-5` | Anthropic | $1.00 / $5.00 | fast, cheap edits |
| `glm-4.6` | Zhipu AI | $0.60 / $2.20 | strong coding at a fraction of Opus |
| `kimi-k2.6` | Moonshot AI | $0.68 / $3.41 | long-context work |
| `deepseek-v3.2` | DeepSeek | $0.23 / $0.34 | very cheap routine coding |
| `free` | — | $0 / $0 | testing the setup |

See the full list on [Models & pricing](https://keeprouter.com/models.md).

## What a turn costs

A typical turn — a 10,000-token prompt and a 2,000-token reply — at KeepRouter's at-cost prices:

| Model | Cost per turn |
|---|---|
| `claude-opus-4-8` | ~$0.100 |
| `claude-sonnet-4-6` | ~$0.060 |
| `glm-4.6` | ~$0.010 |
| `deepseek-v3.2` | ~$0.003 |
| `free` | $0 |

Route routine turns to a cheaper model and keep Opus for the hard ones — often 10–30× cheaper on the bulk of your turns. Tokens only, at cost, no monthly fee.

## Frequently asked questions

### Does tool use / function calling work?

Yes — tool calls pass through the native Messages API unchanged.

### Does streaming work?

Yes, over the same endpoint.

### Can I switch models mid-session?

Yes — /model <id> in Claude Code.

### Do I need a separate Anthropic account?

No. One KeepRouter key (sk-kr-…) covers Claude and every other model.

### Is it only for Claude models?

No — any model KeepRouter serves works through the same /v1/messages endpoint; just set the model id.

[Get an API key](https://keeprouter.com/login) · [Models & pricing](https://keeprouter.com/models.md)
