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:

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

Or add them to ~/.claude/settings.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 — no translator or proxy in the middle.

Pick a model for the job

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

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

See the full list on Models & pricing.

What a turn costs

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

ModelCost 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. You pay only for tokens, at cost (0% markup), with 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 · Models & pricing · This page as Markdown