YouTip LogoYouTip

Claude Code Setup

When using Claude domestically in China, the API is actually not very friendly. Besides Claude's official models, can I use other AI models? This section will teach you in detail how to configure APIs for multiple mainstream domestic AI models, enabling Claude Code to support: | Vendor/Brand | Introduction | API Application Entry (Click to Access) | | --- | --- | --- | | DeepSeek (High Cost-Performance Domestic) | Official models: deepseek-v4-flash deepseek-v4-pro deepseek-chat (will be deprecated on 2026/07/24) deepseek-reasoner (will be deprecated on 2026/07/24) | [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys) | | Alibaba Bailian (Tongyi Qianwen) | Alibaba Cloud's unified large model entry point, supporting latest versions of Qwen, GLM, Kimi, MiniMax and more | [https://bailian.console.aliyun.com](https://bailian.console.aliyun.com/?userCode=i5mn5r7m) | | GLM (Zhipu Qingyan) | Tsinghua's ChatGLM series, supporting GLM-4, GLM-3-Turbo, etc. | [https://open.bigmodel.cn](https://www.bigmodel.cn/glm-coding?ic=EMWK7IPUCE) | | MiniMax | Domestic multimodal, supporting text, voice, and image mixed calls | [https://platform.minimaxi.com](https://platform.minimaxi.com/) | After entering the corresponding console, register/login β†’ complete real-name verification β†’ create API Key to start calling. ### API Management Tool With so many platforms, configuration becomes troublesome. We can use the third-party tool CC Switch to easily manage API configurations for these popular tools: [https://github.com/farion1231/cc-switch/](https://github.com/farion1231/cc-switch/), with full support for Windows / macOS / Linux. CC Switch is a comprehensive auxiliary tool for Claude Code / Codex / Gemini CLI. CC Switch can help us easily manage API configurations for these popular tools, like an intelligent organization assistant for your development toolbox, where all tool configurations can be managed in an orderly manner. !(#) Download links for each platform's installation package: [https://github.com/farion1231/cc-switch/releases](https://github.com/farion1231/cc-switch/releases). !(#) For specific operation settings, refer to: [ If you don't mind the trouble, you can follow the instructions below to configure manually. * * * ## DeepSeek Integration with Claude Code **Required Information:** * API key: Apply for API keys at [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys). * BASE_URL: The API request URL is https://api.deepseek.com/anthropic. ### Configure in Environment Variables Linux / Mac users execute the following commands to configure DeepSeek Anthropic API environment variables, where the API Key is obtained from (https://platform.deepseek.com/api_keys): export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropicexport ANTHROPIC_AUTH_TOKEN=export ANTHROPIC_MODEL=deepseek-v4-proexport ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-proexport ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-proexport ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash export CLAUDE_CODE_EFFORT_LEVEL=max Windows users execute: $env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic" $env:ANTHROPIC_AUTH_TOKEN="" $env:ANTHROPIC_MODEL="deepseek-v4-pro" $env:ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro" $env:ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro" $env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash" $env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-flash" $env:CLAUDE_CODE_EFFORT_LEVEL="max" > Note: Model configuration requires adding , and remember to set effort level to max to enable full-power operation. **Parameter Explanation:** Condensed to the first three columns (Parameter Name / Example Value / Description) as follows: | Parameter Name | Example Value | Description | | --- | --- | --- | | `ANTHROPIC_BASE_URL` | `https://api.deepseek.com/anthropic` | Specifies the API gateway address, forwarding Anthropic SDK requests to DeepSeek | | `ANTHROPIC_AUTH_TOKEN` | `` | API authentication token for accessing DeepSeek services | | `ANTHROPIC_MODEL` | `deepseek-v4-pro` | Default main model to use | | `ANTHROPIC_DEFAULT_OPUS_MODEL` | `deepseek-v4-pro` | Maps to Claude Opus model | | `ANTHROPIC_DEFAULT_SONNET_MODEL` | `deepseek-v4-pro` | Maps to Claude Sonnet model | | `ANTHROPIC_DEFAULT_HAIKU_MODEL` | `deepseek-v4-flash` | Maps to Claude Haiku model (lightweight and fast) | | `CLAUDE_CODE_SUBAGENT_MODEL` | `deepseek-v4-flash` | Model used by sub-agent (typically for quick tasks) | | `CLAUDE_CODE_EFFORT_LEVEL` | `max` | Controls reasoning intensity and thinking depth | Then enter the project directory and execute the claude command to start using. cd my-project claude !(#) After starting Claude Code, specify to use DeepSeek: claude --model deepseek-v4-pro Or switch in interactive mode: > /model deepseek-v4-pro Enter /model to view supported models: !(#) Reference documentation: [https://api-docs.deepseek.com/zh-cn/guides/coding_agents](https://api-docs.deepseek.com/zh-cn/guides/anthropic_api) * * * ## Alibaba Bailian Integration with Claude Code Alibaba Cloud Bailian's Tongyi Qianwen series models support Anthropic API-compatible interfaces. By modifying the following parameters, you can call Tongyi Qianwen series models in Claude Code. * ANTHROPIC_API_KEY (or ANTHROPIC_AUTH_TOKEN): Replace with Bailian API Key, application address: [https://bailian.console.aliyun.com/cn-beijing/?tab=model#/api-key](https://bailian.console.aliyun.com/cn-beijing/?userCode=i5mn5r7m&tab=model#/api-key). * ANTHROPIC_BASE_URL: Replace with Bailian's compatible endpoint address https://dashscope.aliyuncs.com/apps/anthropic. You can directly purchase resource packages for better value: [https://cn.aliyun.com/benefit?from_alibabacloud=&userCode=i5mn5r7m](https://cn.aliyun.com/benefit?from_alibabacloud=&userCode=i5mn5r7m) * Model name: Replace with Bailian-supported model names (e.g., qwen3-max, qwen3-coder-plus, etc.) **macOS/Linux:** Create and open the configuration file ~/.claude/settings.json. ~ represents the user's home directory. If the .claude directory doesn't exist, you need to create it first. You can execute mkdir -p ~/.claude in the terminal to create it. Edit the configuration file: vim ~/.claude/settings.json Replace YOUR_API_KEY with your exclusive API Key. { "env": { "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY", "ANTHROPIC_BASE_URL": "https://dashscope.aliyuncs.com/apps/anthropic", "ANTHROPIC_MODEL": "qwen3-coder-plus" }} Open a new terminal to make the environment variable configuration take effect. **Windows:** In CMD, run the following commands to set environment variables: setx ANTHROPIC_AUTH_TOKEN "YOUR_API_KEY" setx ANTHROPIC_BASE_URL "https://dashscope.aliyuncs.com/apps/anthropic" setx ANTHROPIC_MODEL "qwen3-coder-plus" Replace YOUR_API_KEY with your exclusive API Key. Open a new CMD window and run the following commands to check if environment variables are effective. echo %ANTHROPIC_AUTH_TOKEN% echo %ANTHROPIC_BASE_URL% echo %ANTHROPIC_MODEL% In PowerShell, run the following commands to set environment variables: # Replace YOUR_API_KEY with your exclusive API Key::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "YOUR_API_KEY", ::User)::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://dashscope.aliyuncs.com/apps/anthropic", ::User)::SetEnvironmentVariable("ANTHROPIC_MODEL", "qwen3-coder-plus", ::User) Open a new PowerShell window and run the following commands to check if environment variables are effective. echo $env:ANTHROPIC_AUTH_TOKEN echo $env:ANTHROPIC_BASE_URL echo $env:ANTHROPIC_MODEL ### Integrating Tongyi Qianwen Series Models in Claude Code During conversation, execute /model command to switch models. /model qwen3-coder-plus You can also create a .claude/settings.json file in the project root directory and write model configuration information for permanent configuration. !(#) { "env": { "ANTHROPIC_MODEL": "qwen3-coder-plus", "ANTHROPIC_SMALL_FAST_MODEL": "qwen-flash" }} Start Claude, and you can see the configuration information: !(#) * * * ## Zhipu Large Model Integration with Claude Code In this section, we use the ~/.claude/settings.json file to configure the large model. Before starting, you need to obtain the API key from the official platform: (https://www.bigmodel.cn/claude-code?ic=EMWK7IPUCE). Edit or create the Claude Code configuration file ~/.claude/settings.json, adding or modifying the env field inside # Note: Replace your_zhipu_api_key inside with the API Key obtained in the previous step{ "env": { "ANTHROPIC_AUTH_TOKEN": "your_zhipu_api_key", "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic", "API_TIMEOUT_MS": "3000000", "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1 }} Run claude to start Claude Code, enter /status to confirm model status: !(#) If not, you can enter /config to switch models. !(#)
← Claude Code CliVue3 Taskhub Config β†’