Anthropic's CLI coding assistant
Claude Code is Anthropic's official CLI tool for AI-powered coding assistance. Connect it to Qwen Cloud's pay-as-you-go API for cost-effective access to powerful Qwen models through the Anthropic-compatible endpoint.
Get running in a few minutes:
You should see: Claude Code responds with Python code for hello world
Claude Code connects to Qwen Cloud using these environment variables:
Configure models for different task types by priority:
On first launch, skip the Anthropic login prompt:
Cannot connect to Anthropic services
Claude Code consumes more tokens than standard chat due to:
Quick start
Get running in a few minutes:
Configuration
Basic setup
Claude Code connects to Qwen Cloud using these environment variables:
- API endpoint:
https://dashscope-intl.aliyuncs.com/apps/anthropic - Authentication: API key required (get yours here)
- Model selection: Any Qwen model via the Anthropic-compatible API
Free quota and billing:
- First-time users get a free quota (valid for 90 days)
- Exceeding the quota or validity period will incur fees
- Enable Free quota only to prevent unexpected charges
- Actual costs based on real-time pricing and your final bill
For Coding Plan users: Use your exclusive base URL and API key instead. See Coding Plan for Claude Code.
Model configuration
Configure models for different task types by priority:
- During conversation: Use
/model <model_name>for temporary changes
- At startup: Use
--modelflag for single session
- Environment variables: Set different models for task complexity
- Settings file: Create
settings.jsonin project root
Platform-specific setup
- macOS/Linux
- Windows
Set environment variables in your shell profile:
First launch setup
On first launch, skip the Anthropic login prompt:
- Open
~/.claude.json(macOS/Linux) orC:\Users\%USERNAME%\.claude.json(Windows) - Set
hasCompletedOnboardingtotrue:
- Restart Claude Code
Limitations
- Does not support: Direct file uploads (use file paths in conversation)
- Requires: Node.js v18.0 or later
Examples
Basic code generation
Project-level assistance
Model switching
Troubleshooting
Cannot connect to Anthropic services
Solution: Verify environment variables are set correctly. Run echo $ANTHROPIC_BASE_URL to check.
High token usage
Solution:"You have not completed onboarding" message
- Start Claude Code from specific project directories
- Use
/compactto summarize long conversations- Use
/clearbefore starting new tasks- Be specific in your requests to avoid unnecessary file scans
Solution: EditModel not found error~/.claude.jsonand set"hasCompletedOnboarding": true
Solution: Check model name spelling. Use models from the supported list.
Token optimization tips
Claude Code consumes more tokens than standard chat due to:
- Project directory scanning
- Code file analysis
- Conversation history maintenance
- Focused directories: Start from your specific project folder
- Manual summarization: Type
/compactat 95% context limit - Clear instructions: Specific requests minimize file scanning
- Context resets: Type
/clearbetween unrelated tasks - Smaller tasks: Break complex work into steps
Related resources
- Coding Plan: Setup with subscription →
- Models: Available models →
- API docs: Anthropic-compatible reference →
- Official docs: Claude Code documentation →