Anthropic's terminal AI coding assistant
CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 if long output is truncated.Add a model
Choose your client and complete the configuration.
- CLI
- CC Switch
- IDE plugin
- Desktop
Configure the model
- Token Plan
- Pay-as-you-go
YOUR_API_KEY with your Token Plan API Key.Verify
Configure with a Configuration File
In addition to the options above, you can also connect using a configuration file.
Open or create the configuration file
- macOS / Linux:
~/.claude/settings.json - Windows:
C:\Users\<username>\.claude\settings.json
Add the configuration
- Token Plan
- Pay-as-you-go
YOUR_API_KEY with your Token Plan API Key.Verify
Configure Context Window Size
Claude Code defaults to a 200K context window. If the model supports 1M, extend it to 1M (1,000,000 tokens).
Method 1: Set via environment variable
Add CLAUDE_CODE_MAX_CONTEXT_TOKENS to the env field in ~/.claude/settings.json. The example uses the Singapore (ap-southeast-1) region; API keys are region-specific, see Regions and endpoints.
[1m] to the model name. This works with QwenCloud models that support a 1M context window. The example uses the Singapore (ap-southeast-1) region; see Regions and endpoints.
Permission modes
Claude Code provides six permission modes:
default: Prompts for confirmation before every operation.acceptEdits: Approves file edits automatically. Other operations still prompt for confirmation.plan: Read-only planning mode. No changes are executed.dontAsk: Does not prompt. An operation that would require a prompt is rejected directly.bypassPermissions: Bypasses all permission checks.delegate: Delegated mode.
--permission-mode to set the default permission mode for a session:
/permissions in a session to manage pre-approve and pre-deny rules for the bash, edit, and MCP tools.
Method 3: settings.json configuration
Configure the permissions field in ~/.claude/settings.json:
Integrate the QwenCloud CLI
Install the QwenCloud CLI, then configure your API key and describe the task in natural language.
Install the CLI
Configure the API Key
Get started
Error Codes
If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:
- Token Plan: Individual FAQ · Team Edition FAQ
- Pay-as-you-go: Anthropic API compatible - Error codes
FAQ
How do I skip the official Anthropic login verification?
How do I skip the official Anthropic login verification?
~/.claude.json (Windows path: C:\Users\<username>\.claude.json), and set hasCompletedOnboarding to true to skip the official Anthropic login verification.Requests return 401 invalid_api_key
Requests return 401 invalid_api_key
ANTHROPIC_BASE_URL. QwenCloud provides multiple access methods, and each access method uses a different base URL and a dedicated API key.Access method | Base URL | API key |
|---|---|---|
Token Plan | Token Plan API key | |
Pay-as-you-go | QwenCloud API key (starts with |
- Check the request URL. Check
ANTHROPIC_BASE_URLin~/.claude/settings.json. - Confirm the API key type. Using the table above, confirm that your API key type matches the base URL.
- Correct the configuration. When you use a QwenCloud Pay-as-you-go API key, set
ANTHROPIC_BASE_URLtohttps://ap-southeast-1.maas.qwencloudapi.com/apps/anthropic.
After starting Claude Code, the interface displays "Unable to connect to Anthropic services. Failed to connect to api.anthropic.com: ERR_BAD_REQUEST"
After starting Claude Code, the interface displays "Unable to connect to Anthropic services. Failed to connect to api.anthropic.com: ERR_BAD_REQUEST"
- Check the configuration. Run the
/statuscommand after starting Claude Code. Verify thatANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENpoint to the QwenCloud address. If the output is empty or shows a non-QwenCloud address, check thesettings.jsonconfiguration. - Verify hasCompletedOnboarding. Confirm that
hasCompletedOnboardingis set totruein~/.claude.json. Without this, Claude Code attempts to connect to the official Anthropic service for login verification on startup. - Open a new terminal. After editing the configuration file, open a new terminal window and run
claudefor the changes to take effect. - 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@latestto update to the latest version, then try again.
Model switching does not take effect when using the legacy interface
Model switching does not take effect when using the legacy interface
https://ap-southeast-1.maas.qwencloudapi.com/api/v2/apps/claude-code-proxy only supports deprecated models. Specifying other models has no effect. To use available models, migrate to the new interface by following the configuration in this document.CC Switch reports "No available model list endpoint found. Check the Base URL or confirm that the provider has opened the port" when adding a provider
CC Switch reports "No available model list endpoint found. Check the Base URL or confirm that the provider has opened the port" when adding a provider
/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.Model mapping in CC Switch returns AccessDenied
Model mapping in CC Switch returns AccessDenied
AccessDenied error (HTTP 403, code: access_denied) after you configure the model mapping, check whether the model is marked as Upcoming deprecation in QwenCloud console > Model Gallery. Models marked for upcoming deprecation still appear in the list, but API calls return 403 AccessDenied. Follow these steps:- Check whether the model is marked for deprecation. In QwenCloud console > Model Gallery, search for the model you are using and check its status label.
- Switch to the latest available model. Replace the legacy model (such as
qwen-coder-turbo-0919) in the model mapping with the latest available model (such asqwen3.8-max). - Reconfigure the model mapping and test. Update the model mapping under Advanced options in CC Switch, click Enable, and start a new Claude Code session to verify.