English
Integration docs

BitCloud API Documentation

Browse Base URL, API key, model, and client setup guides for connecting tools to the unified gateway.

Current documentQwen Code
Markdown rendered as page contentQwen Code

Qwen Code 配置

BitCloud API 兼容 OpenAI 协议,支持 Qwen Code CLI 和 IDE 插件,可参考本文进行配置与使用。


前置工作

获取凭证

项目
BASE_URLOpenAI 兼容:https://web.bitcloud.com.cn/v1 · Anthropic 兼容:https://web.bitcloud.com.cn/anthropic
API Key格式:sk-xxxxx
获取方式前往 控制台 → 令牌管理 页面创建

使用 Qwen Code CLI

安装 Qwen Code CLI

安装命令:

  • macOS / Linux
bashbash -c "$(curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh)" -s --source bailian
  • Windows
cmdcurl -fsSL -o %TEMP%\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\install-qwen.bat --source bailian

验证安装(如有版本号输出,则表示安装成功):

bashqwen --version

配置基本信息

Step 1 — 选择 API Key → Custom API Key 进入自定义配置。

Step 2 — 编辑配置文件

编辑或创建 settings.json 文件,路径如下:

  • macOS / Linux: ~/.qwen/settings.json
  • Windows: 用户目录\.qwen\settings.json

将以下内容完整复制到配置文件中(使用前请替换占位符为实际值):

⚠️ 配置前请检查是否已存在相关环境变量。如果已存在,请清除或将其值替换为 BitCloud API Key。
json{
  "env": {
    "BITCLOUD_API_KEY": "YOUR_API_KEY"
  },
  "modelProviders": {
    "openai": [
      {
        "id": "gpt-4o",
        "name": "GPT-4o",
        "baseUrl": "BASE_URL",
        "envKey": "BITCLOUD_API_KEY"
      }
    ]
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "model": {
    "name": "gpt-4o"
  },
  "$version": 3
}

更多配置详情请参阅 Qwen Code 官方文档

运行 Qwen Code CLI

配置完成后,打开新终端并启动:

bashqwen

启动后即可在 Qwen Code CLI 中使用 BitCloud 提供的模型。


使用 Qwen Code IDE 插件

安装插件

在 VS Code 扩展市场搜索 Qwen Code Companion 并安装。

配置基本信息

按照上方 Qwen Code CLI 配置部分所述的相同步骤进行配置。

使用 Qwen Code 插件

点击右上角的 Qwen Code 图标打开对话面板。

输入或点击 /,然后选择 Switch model 来切换模型。


常见问题

模型名称应该填什么?

请参考 模型广场 查看可用模型列表,选择适合的模型 ID 填入配置中。