Claude Code + GLM / Kimi / DeepSeek: The claude-code-router Setup (2026)

Published 2026-09-13 · NovAI Team

Claude Code is Anthropic's terminal coding agent, and it is hard-locked to Anthropic's API by default. But with the open-source claude-code-router (CCR), you can keep the Claude Code workflow while the actual inference runs on Chinese models through NovAI — at a fraction of Anthropic's token prices.

Why route Claude Code to Chinese models?

Important: NovAI speaks OpenAI format, not Anthropic format

NovAI's gateway is OpenAI-compatible (/v1/chat/completions) and does not serve /v1/messages. That's exactly what claude-code-router is for: it sits between Claude Code and any OpenAI-compatible backend, translating the protocol.

Step 1 - Install claude-code-router

npm install -g @musistudio/claude-code-router

Step 2 - Configure NovAI as a provider

Create ~/.claude-code-router/config.json:

{
  "Providers": [
    {
      "name": "novai",
      "api_base_url": "https://aiapi-pro.com/v1/chat/completions",
      "api_key": "nvai-YOUR_API_KEY",
      "models": [
        "kimi-k2.7-code",
        "glm-5.3",
        "deepseek-v4-pro",
        "glm-4.7-flash"
      ]
    }
  ],
  "Router": {
    "default": "novai,kimi-k2.7-code",
    "background": "novai,glm-4.7-flash",
    "think": "novai,glm-5.3"
  }
}

The Router section maps Claude Code's modes to models: default for normal turns, background for cheap auxiliary calls, and think for deep-reasoning turns.

Step 3 - Launch Claude Code through the router

ccr code

Claude Code starts as usual, but every request is served by your configured NovAI model. Switch models on the fly inside a session with /model novai,glm-5.3.

Best NovAI models for coding agents

ModelInput $/1MOutput $/1M
kimi-k2.7-code (agent-tuned)$0.67$3.40
glm-5.3 (1M context flagship)$1.25$4.00
deepseek-v4-pro$0.57$1.15
doubao-seed-2.0-code$0.448$2.24
glm-4.7-flash (free forever)$0$0

For long agent loops, kimi-k2.7-code and deepseek-v4-pro give the best cost-per-task; for repo-wide refactors that need the full codebase in context, glm-5.3's 1M window is unmatched. Use free glm-4.7-flash for planning and lightweight edits.

Run Claude Code on kimi-k2.7-code for $0.67/1M tokens — $2 free credit to start.

Get $2 Free Credit — No Credit Card →

Frequently Asked Questions

Can Claude Code use non-Anthropic models?

Yes, through the open-source claude-code-router (npm package @musistudio/claude-code-router). It translates Claude Code's Anthropic-format calls to any OpenAI-compatible backend, including NovAI at https://aiapi-pro.com/v1.

Does NovAI support the Anthropic /v1/messages endpoint directly?

No. NovAI serves the OpenAI-compatible API (chat completions, images, video). For Claude Code you need claude-code-router as the protocol translator - the setup takes about five minutes.

Which model is best for Claude Code on NovAI?

kimi-k2.7-code ($0.67/$3.40 per 1M tokens) is agent-tuned and the cheapest strong default. Use glm-5.3 when you need its 1M-token context for repo-wide work, and free glm-4.7-flash for background tasks.

Related guides: Codex CLI setup · Claude Code · Cline / Roo Code · Cursor · Chatbox · Cherry Studio