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.
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.
npm install -g @musistudio/claude-code-router
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.
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.
| Model | Input $/1M | Output $/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.
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.
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.
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.