惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 【当耐特】
A
About on SuperTechFans
Last Week in AI
Last Week in AI
雷峰网
雷峰网
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements

Crazyrouter Blog (English)

Ideogram AI Guide 2026: Product Mockups, Text Rendering, and API Automation Akool AI Voice Generator Review 2026: API Alternatives for Developers GLM 4.6 API Guide 2026: Build Chinese-English Agents with Tool Calling Google Veo3 API Guide 2026: Batch Video Generation, QA, and Fallbacks Claude Opus 4.8 vs Opus 4.7: Real API Benchmark Results for Developers Opus 4.8 vs Opus 4.7 Coding Test: What Changed for Developers? Opus 4.8 vs Opus 4.7 for Agents: JSON, Tool Use, and Structured Output Gemini 2.5 Flash-Lite for RAG, Agent Routing, and Cost per Successful Task Gemini 2.5 Flash-Lite for Support Automation and Ticket Triage Gemini 2.5 Flash-Lite Use Cases: The Practical Automation Tier for Developers Claude Jupiter v1-p vs GPT-5.5 Benchmark: Real API Test on Reasoning and Coding Claude Jupiter v1-p vs Claude Opus 4.7 vs Sonnet 4.6: Live API Test Claude Jupiter v1-p vs Claude Opus 4.7 vs Sonnet 4.6: Live API Test Claude Code Pricing 2026: Pro vs Max vs Team vs API Costs Claude Opus 4.7 vs DeepSeek V4 Pro: Real API Compatibility and Coding Benchmark Gemini CLI Complete Guide 2026: Repo Automation, CI Agents, and Multi-Model Routing Ideogram AI Guide 2026: Brand Design Automation, API Workflows, and Alternatives GLM 4.6 API Guide 2026: Agents, RAG, Tool Calling, and Bilingual Apps WAN 2.2 Animate Tutorial 2026: Character Consistency, Shot Control, and API Workflows Google Veo3 API Guide 2026: Production Video Pipelines, Prompts, Pricing, and Fallbacks AI API Pricing Comparison 2026: Text, Image, Video, Caching, and Router Costs Codex CLI Installation Guide 2026: Windows, macOS, Linux, Proxies, and CI Setup How to Get a Claude API Key in 2026: Secure Setup for Teams, CI, and Alternatives Gemini Advanced Review 2026: Is It Worth It for Coding, Research, and API Teams? Claude Code Pricing Guide 2026: Team Agent Budgets, API Fallbacks, and Cost Control Seedance 2.0 Pricing: Convert 46 CNY per Million Tokens to Cost per Second Qwen2.5-Omni Guide 2026: Real-Time Voice, Vision, and Multimodal Agents Kimi K2 Thinking Guide 2026: Reasoning Workflows, Evals, and Cost Control Google Veo3 API Guide 2026: Batch Video Pipelines, Pricing, and Fallbacks Codex CLI Installation Guide 2026: macOS, Linux, WSL, Proxies, and Dev Containers
05|Use Crazyrouter to Access Chinese Models in Claude Code
Crazyrouter Team · 2026-06-10 · via Crazyrouter Blog (English)

30 viewsEnglishClaude Code

05|Use Crazyrouter to Access Chinese Models Uniformly in Claude Code#

This is Part 05 of the Crazyrouter Claude Code series. This article focuses on “using Crazyrouter to access Chinese models uniformly in Claude Code,” covering why you should route everything through Crazyrouter, the correct Claude Code configuration, and the correct configuration for OpenAI-compatible applications.

Unified access pattern: Claude Code / Anthropic native clients use ANTHROPIC_BASE_URL=https://cn.crazyrouter.com; OpenAI-compatible SDKs, HTTP requests, and frontend/backend applications use base_url=https://cn.crazyrouter.com/v1.

What This Article Covers#

  • Who this is for: developers who are using Claude Code, preparing to connect Chinese models, or want to unify their team’s model calls through Crazyrouter.
  • What you will learn: how to configure environment variables according to the Crazyrouter documentation, organize your workflow, and avoid /v1/v1/... issues caused by an incorrect Base URL.
  • Recommended preparation: first create a separate API Token in the Crazyrouter console, then follow the Claude Code integration documentation to complete the basic setup.

Claude Code can use Claude series models, and it can also use some Chinese models through the Anthropic Messages-compatible protocol. For readers of this site, the key point is not to register with each vendor platform, enable services, and copy keys one by one. Instead, you should route model access uniformly through Crazyrouter.

Use the following unified entry point:

Claude Code appends /v1/messages by itself, so ANTHROPIC_BASE_URL must be the root domain. Do not set it to https://cn.crazyrouter.com/v1, and do not include the full /v1/messages path.

Why Route Everything Through Crazyrouter#

Putting Claude Code and Chinese models behind Crazyrouter brings several practical benefits:

  • One Token can manage multiple types of models, so you do not need to copy keys across multiple platforms.
  • You can view logs, balance, failure reasons, and model usage in one console.
  • You can create a dedicated Token for Claude Code, set budgets and model allowlists, and avoid mixing it with other tools.
  • For networks in China, prioritize https://cn.crazyrouter.com to reduce cross-border routing instability.
  • When switching models later, you only need to adjust the model name or console configuration, without rewriting the entire integration flow.

Correct Claude Code Configuration#

macOS / Linux:

Windows PowerShell:

After reopening the terminal, run:

If you want to automatically check Git, Node.js, and Claude Code, and write the environment variables, you can use Crazyrouter’s one-click setup repository: Crazyrouter Claude Code one-click setup script.

Correct Configuration for OpenAI-Compatible Applications#

If you are not configuring Claude Code, but are calling OpenAI-compatible APIs from your own application, SDK, or backend service, use the /v1 address:

Example:

Model Selection Suggestions#

Do not understand “accessing Chinese models” as jumping to a specific vendor platform. Articles on this site use Crazyrouter’s model list and Token permissions as the default admission criteria.

Choose models based on the task:

  • Code reading, refactoring, and complex engineering tasks: prioritize Claude series models or Coding models that have been verified as compatible with Claude Code.
  • Chinese documentation, summaries, and content processing: choose general-purpose models with strong Chinese capability and moderate cost.
  • Long-context project analysis: choose models with longer context windows and stable output.
  • Batch tasks: prioritize models with lower cost and more stable throughput, and set a budget for the Token.

Available models are subject to the Crazyrouter console and the response from GET https://cn.crazyrouter.com/v1/models.

Common Mistakes#

1. Incorrect Base URL#

Claude Code:

OpenAI-compatible SDK:

If you see /v1/v1/messages or /v1/v1/models in the logs, it usually means /v1 was added to the Base URL twice.

2. The Token Does Not Have Permission for the Model#

If the response returns model not allowed or 403, check the Token allowlist in the Crazyrouter console. Creating a separate Token for Claude Code usually makes troubleshooting easier.

3. Putting the Example Key into Code#

Articles and examples use YOUR_CRAZYROUTER_API_KEY as a placeholder. Do not commit real Tokens to Git, and do not send them to AI tools as long-term context.

  1. Create a dedicated Claude Code Token in the Crazyrouter console.
  2. Configure ANTHROPIC_BASE_URL=https://cn.crazyrouter.com.
  3. Start Claude Code and use /status first to check the current model and status.
  4. Confirm in the Crazyrouter console that the request appears in the logs.
  5. Then switch models or adjust the Token allowlist based on the task.

This workflow works for Claude series models and also for Chinese models accessed compatibly through Crazyrouter. Readers do not need to be directed to other model platforms. All keys, billing, logs, and troubleshooting are handled inside Crazyrouter.


Getting Started with Crazyrouter#

If you want to connect Claude Code, Chinese models, or your own applications to Crazyrouter through a unified interface, follow this sequence:

  1. Go to the Crazyrouter console, create a dedicated API Token, and manage permissions separately by project or team.
  2. Use the root domain for Claude Code: https://cn.crazyrouter.com; use https://cn.crazyrouter.com/v1 for OpenAI-compatible SDKs.
  3. If you need to check the environment automatically or write configuration quickly, use the Crazyrouter one-click Claude Code configuration script.
  4. When debugging failures, check the console logs first, then verify the API Endpoint documentation. Pay special attention to whether the Base URL has an extra /v1.

When you need to evaluate model costs or choose different models, check the Crazyrouter pricing and models page first, then add the models you commonly use to the Token whitelist.