获取KEY
bailian.console.aliyun.com/?tab=model#/api-key
安装 Qwen Code
安装或更新 Node.js(v20.0 或更高版本)。
在终端中执行以下命令安装或更新 Qwen Code(版本 ≥ 0.10.6 ):
npm config set registry https://registry.npmmirror.com
npm install -g @qwen-code/qwen-code@latest
qwen –version
配置 Qwen Code
编辑或新建 settings.json 文件,写入下面的内容并保存,请将 YOUR_API_KEY 替换为阿里云百炼API Key,具体路径如下:
macOS / Linux: ~/.qwen/settings.json
Windows: C:\Users\您的用户名.qwen\settings.json
{
"env": {
"BAILIAN_API_KEY": "YOUR_API_KEY"
},
"modelProviders": {
"openai": [
{
"id": "qwen3.5-plus",
"name": "[Bailian] qwen3.5-plus",
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"envKey": "BAILIAN_API_KEY",
"generationConfig": {
"extra_body": {
"enable_thinking": true
}
}
},
{
"id": "qwen3-coder-plus",
"name": "[Bailian] qwen3-coder-plus",
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"envKey": "BAILIAN_API_KEY"
},
{
"id": "qwen3-coder-next",
"name": "[Bailian] qwen3-coder-next",
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"envKey": "BAILIAN_API_KEY"
},
{
"id": "glm-5",
"name": "[Bailian] glm-5",
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"envKey": "BAILIAN_API_KEY",
"generationConfig": {
"extra_body": {
"enable_thinking": true
}
}
},
{
"id": "MiniMax-M2.5",
"name": "[Bailian] MiniMax-M2.5",
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"envKey": "BAILIAN_API_KEY",
"generationConfig": {
"extra_body": {
"enable_thinking": true
}
}
},
{
"id": "kimi-k2.5",
"name": "[Bailian] kimi-k2.5",
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"envKey": "BAILIAN_API_KEY",
"generationConfig": {
"extra_body": {
"enable_thinking": true
}
}
}
]
},
"security": {
"auth": {
"selectedType": "openai"
}
},
"model": {
"name": "qwen3.5-plus"
},
"$version": 3
}
参考:https://help.aliyun.com/zh/model-studio/qwen-code
