Skip to main content
Clients & tools

Claude Code

Anthropic's terminal AI coding assistant

Claude Code is a command-line AI coding assistant developed by Anthropic. Connect it to QwenCloud via Token Plan (Personal Edition), Token Plan (Team Edition), Coding Plan, or pay-as-you-go billing.

Install Claude Code

  • macOS
  • Windows
  1. Install or update Node.js (v18.0 or later).
  2. Run the following command in the terminal to install Claude Code.
npm install -g @anthropic-ai/claude-code
  1. Run the following command to verify the installation. If a version number is displayed, the installation is successful.
claude --version

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.
{
  "hasCompletedOnboarding": true
}

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 (Personal Edition)

Replace YOUR_API_KEY with the Token Plan (Personal Edition) dedicated API Key. Available models: qwen3.8-max, qwen3.7-max, qwen3.7-plus, qwen3.6-flash, glm-5.2, deepseek-v4-pro, deepseek-v4-flash-0731. For details, see supported models for Token Plan (Personal Edition).
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic",
    "ANTHROPIC_MODEL": "qwen3.8-max",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3.6-flash",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.8-max",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3.8-max",
    "CLAUDE_CODE_SUBAGENT_MODEL": "qwen3.7-max",
    "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "983616"
  }
}
qwen3.8-max thinking mode:
  • thinking: Supports both enabled and disabled (hybrid thinking mode).
  • temperature: Defaults to 0.6 in thinking mode. Values below 0.6 are automatically adjusted to 0.6.
  • reasoning_effort: Controls reasoning depth. Options: xhigh, medium, low. Default: xhigh.

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).
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic",
    "ANTHROPIC_MODEL": "qwen3.8-max",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3.6-flash",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.8-max",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3.8-max",
    "CLAUDE_CODE_SUBAGENT_MODEL": "qwen3.7-max",
    "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "983616"
  }
}
qwen3.8-max thinking mode:
  • thinking: Supports both enabled and disabled (hybrid thinking mode).
  • temperature: Defaults to 0.6 in thinking mode. Values below 0.6 are automatically adjusted to 0.6.
  • reasoning_effort: Controls reasoning depth. Options: xhigh, medium, low. Default: xhigh.

Coding Plan

Replace YOUR_API_KEY with the Coding Plan dedicated API Key. For available models, see supported models for Coding Plan.
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",
    "ANTHROPIC_MODEL": "qwen3.7-plus",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3.7-plus",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.7-plus",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3.7-plus",
    "CLAUDE_CODE_SUBAGENT_MODEL": "qwen3.7-plus"
  }
}

Pay-as-you-go

Replace YOUR_API_KEY with your QwenCloud API Key. For available models, see Anthropic API compatible.
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://dashscope-intl.aliyuncs.com/apps/anthropic",
    "ANTHROPIC_MODEL": "qwen3.7-max",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3.6-flash",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.7-max",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3.7-max",
    "CLAUDE_CODE_SUBAGENT_MODEL": "qwen3.7-max"
  }
}

Configure Context Window Size

Claude Code uses a 200K context window by default. To handle large codebases or long conversations, you can expand the context window to 1M (1,000,000 tokens), provided the model supports that context length. Two configuration methods are available: Method 1: Set via environment variable Add CLAUDE_CODE_MAX_CONTEXT_TOKENS to the env field in ~/.claude/settings.json:
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://dashscope-intl.aliyuncs.com/apps/anthropic",
    "ANTHROPIC_MODEL": "qwen3.7-plus",
    "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "1000000"
  }
}
Method 2: Use a model name suffix Append [1m] to the model name. This works with QwenCloud models that support a 1M context window:
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://dashscope-intl.aliyuncs.com/apps/anthropic",
    "ANTHROPIC_MODEL": "qwen3.7-plus[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.7-plus[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3.7-plus[1m]",
    "CLAUDE_CODE_SUBAGENT_MODEL": "qwen3.7-plus[1m]"
  }
}
After modifying the configuration, open a new terminal window to restart Claude Code for the changes to take effect. For more environment variable details, see the Claude Code official environment variables documentation.

Verify configuration

After saving the configuration, open a new terminal window and run the following command to verify whether the connection is successful:
claude "Hello"
If the model returns a normal response, the configuration is successful. Run claude to enter interactive mode, which supports multi-turn conversations, file editing, and command execution. For details, see the Claude Code official documentation.

Use CC Switch

CC Switch is a community open-source desktop GUI for managing multiple API keys or billing plans. Switch between providers with one click, without editing settings.json manually.

Install CC Switch

  • macOS: brew tap farion1231/ccswitch && brew install --cask cc-switch, or download the .dmg from Releases.
  • Windows: download the .msi installer or portable .zip from Releases.
  • Linux: on Arch, run paru -S cc-switch-bin; on other distributions, download .deb/.rpm/.AppImage from Releases.

Add a provider

  1. In the CC Switch main interface, select Claude Code in the top icon bar (the orange star icon), then click + in the upper-right corner to open Add New Provider. Fill in the fields based on the table below, then click Add.
Billing planConfiguration
Token Plan (Personal Edition)Provider name: QwenCloud-Token Plan (Personal Edition)
API Key: get from console
Endpoint: https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
Token Plan (Team Edition)Provider name: QwenCloud-Token Plan (Team Edition)
API Key: get from console
Endpoint: https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
Coding PlanProvider name: QwenCloud-Coding Plan
API Key: get from console
Endpoint: https://coding-intl.dashscope.aliyuncs.com/apps/anthropic
Pay-as-you-goProvider name: QwenCloud-Pay-as-you-go
API Key: get from console
Endpoint: https://dashscope-intl.aliyuncs.com/apps/anthropic
  1. Expand Advanced Options to configure model mapping. Set the main model and the Haiku, Sonnet, and Opus default models to the supported models for your plan. Example mapping:
    • Main model: qwen3.7-max
    • Haiku default model: qwen3.6-flash
    • Sonnet default model: qwen3.7-max
    • Opus default model: qwen3.7-max
  2. Return to the main interface, click Enable next to the provider, then start a new Claude Code session for the configuration to take effect.

Connect Claude Code Desktop

Claude Code Desktop (Claude Desktop) and the Claude Code CLI are two separate entry points, shown in CC Switch as the Claude Code and Claude Desktop panels respectively. The desktop app reaches QwenCloud through the CC Switch local gateway: CC Switch automatically writes both the gateway address and the auth token into the desktop configuration, so you do not enter your QwenCloud API Key in the desktop app. The QwenCloud API Key is entered only in the CC Switch provider configuration and is injected automatically when the local router forwards the request.
Do not manually enter your QwenCloud API Key in the desktop app's third-party inference configuration. The token the desktop app uses to authenticate to the CC Switch local gateway (address http://127.0.0.1:15721/claude-desktop) is generated and written automatically by CC Switch; entering the QwenCloud API Key here fails authentication because the token does not match. Writing the desktop third-party configuration is currently supported only on macOS and Windows.
  1. Install Claude Code Desktop from the Claude download page.
  2. In CC Switch, switch to the Claude Desktop panel from the app switcher on the left. If the entry is not shown, go to Settings > General and make sure Claude Desktop is not hidden under app visibility.
  3. Add the QwenCloud provider: if you have already configured a QwenCloud provider in the Claude Code panel, click Import existing providers from Claude Code to reuse it; otherwise click + in the upper-right to add one. Because QwenCloud model IDs (such as qwen3.7-max) are not the three role IDs that Claude Desktop recognizes (claude-sonnet-* / claude-opus-* / claude-haiku-*), turn on Needs model mapping and map the Sonnet, Opus, and Haiku roles to the actual QwenCloud models to request (for example, Sonnet > qwen3.7-max).
  4. Enable local routing: go to Settings > Routing > Local Routing and turn on Show Routing Toggle on Main Page; return to the Claude Desktop panel and turn on the Claude Desktop local routing switch. The default listen address is 127.0.0.1:15721.
  5. Click Enable on the provider card. CC Switch automatically writes the third-party inference configuration into Claude Code Desktop.
  6. Keep CC Switch running, then fully quit and restart Claude Code Desktop for the changes to take effect. Select the configured model from the model menu to start using it.

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

  1. Search for Claude Code for VS Code in the extension marketplace and install it.
  2. Restart VS Code and click the icon in the upper-right corner to open Claude Code.
  3. Type / in the dialog box, select General config, and set the model in Selected Model.

JetBrains

  1. Search for Claude Code in the extension marketplace and install it.
  2. 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:

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 QwenCloud server, usually because the environment variables are not configured correctly or have not taken effect. Follow these steps to troubleshoot:
  1. Check the configuration: After starting Claude Code, run the /status command and verify that the values of ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN correctly point to the QwenCloud address. If the output is empty or points to a non-QwenCloud address, check whether the settings.json configuration is correct.
  2. Verify hasCompletedOnboarding: Check that hasCompletedOnboarding is set to true in the ~/.claude.json file. Otherwise, Claude Code will attempt to connect to the official Anthropic service for login verification at startup.
  3. Reopen the terminal: After modifying the configuration file, open a new terminal window and run the claude command for the configuration to take effect.
  4. Update Claude Code: If the issue persists after all the steps above, the Claude Code version may be outdated. Run npm install -g @anthropic-ai/claude-code@latest to update to the latest version, then try again.

CC Switch reports "No available model list endpoint found" when adding a provider

This message comes from the connectivity check CC Switch runs when saving a provider: it probes a model list endpoint (such as /v1/models) against the configured request URL. QwenCloud's Anthropic-compatible endpoint (ending in /apps/anthropic) only provides the messages endpoint /v1/messages and does not provide a model list endpoint, so the probe returns 404 and CC Switch reports "No available model list endpoint found". This message does not affect normal use of Claude Code and can be ignored. Claude Code sends conversations through /v1/messages, and the models it uses are specified directly by the model mapping in CC Switch's Advanced options, without relying on auto-discovery from a model list endpoint. When the request URL and API Key are configured correctly, simply click Enable and start a new Claude Code session to chat normally. If you still cannot chat, verify that the request URL ends in /apps/anthropic without an extra /v1, and that you have filled in the models supported by your plan in the model mapping under Advanced options.