Use Alibaba Cloud Model Studio in Claude Code
Generate a Claude Code config from the Anthropic-compatible endpoint in Alibaba Cloud Model Studio's docs. The API key in the config is a placeholder; replace it with a key you create at Alibaba Cloud Model Studio.
Endpoints
- Pay as you go
https://dashscope.aliyuncs.com/apps/anthropicThe docs now recommend the workspace endpoint (https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/apps/anthropic); this older endpoint still works.Docs · verified 2026-11-09 - Plan only: Model Studio Coding Plan Pro
https://coding.dashscope.aliyuncs.com/apps/anthropicThe Coding Plan only offers Chat Completions for Codex, which current Codex versions cannot use.Docs · verified 2026-11-09 - Plan only: Model Studio Token Plan Lite, Essential, Standard, Pro
https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropicDocs · verified 2026-11-09
Generate the config
{
"env": {
"ANTHROPIC_BASE_URL": "https://dashscope.aliyuncs.com/apps/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_MODEL": "qwen3.7-max",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3.7-max",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.7-max",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "qwen3.7-max",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3.6-flash"
}
}
Models and prices
How to check it works
Restart Claude Code and send a message. If it replies and the request shows up in Alibaba Cloud Model Studio's console, it is using this endpoint.
FAQ
settings.json or environment variables?
settings.json applies every time Claude Code starts, for long-term use; the environment variables apply to the current terminal only, for a quick try.
How do I switch back to Anthropic?
Remove these variables from settings.json (or close the terminal where you set them), then restart Claude Code.
Does my key pass through this site?
No. The page only generates config text and never asks for your key; the key only goes into the config file or terminal on your own machine.