Anthropic's terminal AI coding assistant
Claude Code is a command-line AI coding assistant developed by Anthropic. Connect it to Qwen Cloud via Token Plan (Team Edition), Coding Plan, or pay-as-you-go billing.
Edit or create
Create
Replace YOUR_API_KEY with the Token Plan (Team Edition) dedicated API Key. For available models, see supported models for Token Plan (Team Edition).
Replace YOUR_API_KEY with the Coding Plan dedicated API Key. For available models, see supported models for Coding Plan.
Replace YOUR_API_KEY with your Qwen Cloud API Key. For available models, see Anthropic API compatible.
After saving the configuration, open a new terminal window and run the following command to verify whether the connection is successful:
If the model returns a normal response, the configuration is successful.
Run
After completing the CLI configuration above, you can install the Claude Code plugin in your IDE, which directly reuses the configuration in
If you encounter errors during configuration, refer to the FAQ documentation for the corresponding billing plan:
This error indicates that Claude Code is attempting to connect to the official Anthropic service instead of the Qwen Cloud server, usually because the environment variables are not configured correctly or have not taken effect. Follow these steps to troubleshoot:
Install Claude Code
- macOS
- Windows
- Install or update Node.js (v18.0 or later).
- Run the following command in the terminal to install Claude Code.
- Run the following command to verify the installation. If a version number is displayed, the installation is successful.
Skip login verification
Edit or create ~/.claude.json (Windows path: C:\Users\<username>\.claude.json), and set hasCompletedOnboarding to true to skip the official Anthropic login verification.
Configure access credentials
Create ~/.claude/settings.json (Windows path: C:\Users\<username>\.claude\settings.json), and add the corresponding configuration based on your selected plan.
Token Plan (Team Edition)
Replace YOUR_API_KEY with the Token Plan (Team Edition) dedicated API Key. For available models, see supported models for Token Plan (Team Edition).
Coding Plan
Replace YOUR_API_KEY with the Coding Plan dedicated API Key. For available models, see supported models for Coding Plan.
Pay-as-you-go
Replace YOUR_API_KEY with your Qwen Cloud API Key. For available models, see Anthropic API compatible.
Verify configuration
After saving the configuration, open a new terminal window and run the following command to verify whether the connection is successful:
claude to enter interactive mode, which supports multi-turn conversations, file editing, and command execution. For details, see the Claude Code official documentation.
Claude Code IDE plugins
After completing the CLI configuration above, you can install the Claude Code plugin in your IDE, which directly reuses the configuration in settings.json.
VS Code
- Search for
Claude Code for VS Codein the extension marketplace and install it. - Restart VS Code and click the icon in the upper-right corner to open Claude Code.
- Type
/in the dialog box, select General config, and set the model in Selected Model.
JetBrains
- Search for
Claude Codein the extension marketplace and install it. - Restart the IDE and click the icon in the upper-right corner to start using it.
FAQ
Error codes
If you encounter errors during configuration, refer to the FAQ documentation for the corresponding billing plan:
- Pay-as-you-go: Anthropic API compatible - Error codes
- Coding Plan: Coding Plan FAQ
- Token Plan (Team Edition): Token Plan (Team Edition) FAQ
After starting Claude Code, the interface displays "Unable to connect to Anthropic services"
This error indicates that Claude Code is attempting to connect to the official Anthropic service instead of the Qwen Cloud server, usually because the environment variables are not configured correctly or have not taken effect. Follow these steps to troubleshoot:
-
Check the configuration: After starting Claude Code, run the
/statuscommand and verify that the values ofANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENcorrectly point to the Qwen Cloud address. If the output is empty or points to a non-Qwen Cloud address, check whether thesettings.jsonconfiguration is correct. -
Verify hasCompletedOnboarding: Check that
hasCompletedOnboardingis set totruein the~/.claude.jsonfile. Otherwise, Claude Code will attempt to connect to the official Anthropic service for login verification at startup. -
Reopen the terminal: After modifying the configuration file, open a new terminal window and run the
claudecommand for the configuration to take effect.