Skip to content

Setting Up Claude Code - Domestic Provider Configuration Guide

Claude Code is a powerful AI-assisted programming tool that can significantly improve development efficiency and code quality. This guide will help you install Claude Code and select a suitable domestic model provider.

Claude Code provides two official installation methods:

  • Native Installation: Requires downloading binary files from GitHub Releases
  • Official Script Installation: Requires running the official installation script

Due to network restrictions, the above methods may not work properly in mainland China. Therefore, we recommend using the NPM installation method, which is more stable and performs better in mainland China network environments.

Installing Claude Code via NPM is very convenient. Make sure you have Node.js installed.

Terminal window
npm install -g @anthropic-ai/claude-code

After installation, verify the installation was successful:

Terminal window
claude --version

Claude Code supports two configuration methods:

  • Recommended: Using settings.json configuration file
  • Legacy: Using environment variables (still works)

The location of Claude Code’s settings.json file varies by operating system:

C:\Users\<Your Username>\.claude\settings.json

If you have not decided which provider to buy yet, start with AI Service Subscriptions. The new chapter gathers the currently recommended subscription entry points into one top-level section, so you can compare first and then return here to finish Claude Code configuration.

Zhipu AI provides GLM Coding Plan, specifically designed for AI programming tools like Claude Code. It offers good value and supports various advanced features.

To use ZAI, you need to purchase a subscription and get an API Key. For code writing, we recommend purchasing the Coding Plan for daily use, as it is more cost-effective.

Purchase through the following link for exclusive discounts: https://www.bigmodel.cn/claude-code?ic=14BY54APZA

Zhipu GLM Coding: 20+ Programming Tools Seamless Support

Claude Code, Cline, and 20+ other programming tools seamlessly supported, maximizing your coding productivity!

  • World-class Programming Models: GLM-5 achieves SOTA performance in reasoning, code, and agent capabilities among open-source models when released
  • Larger Capacity, Lower Price: 1/3 the price of Claude Code, 3x the usage, as low as 49 RMB per month
  • Free Exclusive MCP: Includes image/video understanding, web search, web page reading, open-source repository MCP
Section titled “Method One: Using settings.json Configuration File [Recommended]”

Add the following configuration to your settings.json file:

{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-api-key",
"ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.7"
}
}
Terminal window
# Set API Key
export ANTHROPIC_AUTH_TOKEN=your-api-key-here
# Set API URL
export ANTHROPIC_API_URL=https://open.bigmodel.cn/api/anthropic

Method Three: Using the coding-helper Tool

Section titled “Method Three: Using the coding-helper Tool”

ZAI provides a simple command-line tool coding-helper to help you configure Claude Code.

Terminal window
# Enter the command line interface and run the Coding Tool Helper
npx @z_ai/coding-helper

After running, you will enter an interactive command-line interface. Follow the prompts to enter your API Key and select Claude Code to complete the configuration.

Zhipu AI provides multiple model options, with the following mapping to Claude model tiers:

Claude TierZAI Model
Sonnetglm-4.7
Opusglm-5
Haikuglm-4.5-air

MiniMax provides Claude API-compatible service using a unified MiniMax-M2.5 model for all tiers.

Get your API Key through the following link: https://platform.minimaxi.com/subscribe/coding-plan?code=8wNck4etDM&source=link

MiniMax Claude API Compatible Service

MiniMax provides Claude API-compatible service with support for multiple model integrations, stable and reliable.

Section titled “Method One: Using settings.json Configuration File [Recommended]”

Add the following configuration to your settings.json file:

{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-api-key",
"ANTHROPIC_BASE_URL": "https://api.minimaxi.com/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M2.5",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M2.5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M2.5"
}
}
Terminal window
# Set API Key
export ANTHROPIC_AUTH_TOKEN=your-api-key-here
# Set API URL
export ANTHROPIC_API_URL=https://api.minimaxi.com/anthropic

MiniMax uses a unified model for all tiers:

Claude TierMiniMax Model
SonnetMiniMax-M2.5
OpusMiniMax-M2.5
HaikuMiniMax-M2.5

Alibaba Cloud’s DashScope platform provides Claude API-compatible service using a unified glm-4.7 model for all tiers.

Activate the service through the following link: https://www.aliyun.com/benefit/ai/aistar?userCode=vmx5szbq&clubBiz=subTask..12384055..10263..

Alibaba Cloud Qianwen Coding Plan Launched

Alibaba Cloud Qianwen Coding Plan is now available to meet daily development needs. Recommended + Hagicode, perfect for achieving various needs during development.

After successful activation, you can create an API Key in the Alibaba Cloud console.

Section titled “Method One: Using settings.json Configuration File [Recommended]”

Add the following configuration to your settings.json file:

{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-api-key",
"ANTHROPIC_BASE_URL": "https://coding.dashscope.aliyuncs.com/apps/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.7",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-4.7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.7"
}
}
Terminal window
# Set API Key
export ANTHROPIC_AUTH_TOKEN=your-api-key-here
# Set API URL
export ANTHROPIC_API_URL=https://coding.dashscope.aliyuncs.com/apps/anthropic

Alibaba Cloud uses a unified model for all tiers:

Claude TierAlibaba Cloud Model
Sonnetglm-4.7
Opusglm-4.7
Haikuglm-4.7