WorkBuddy 接入阿里云百炼

WorkBuddy 接入阿里云百炼
白嫖近 2000 万 tokens 免费额度让 WorkBuddy 支持 20 个主流大模型每月省下一大笔 AI 订阅费。一、为什么要把百炼模型接入 WorkBuddy作为 AI 爱好者你可能同时用着 ChatGPT、Claude、Gemini 等多个大模型产品。但如果你用的是WorkBuddy一个强大的 AI 代码编辑器就可以通过自定义模型配置直接把阿里云百炼平台的免费大模型接入进来。优势很明显免费额度充沛每个模型 100 万 tokens20 个模型总计近 2000 万 tokens有效期到 2026 年 9 月模型丰富涵盖通义千问、DeepSeek、GLM、Kimi 等主流模型一次配置长期使用配置完成后直接在 WorkBuddy 界面切换无需频繁切换平台二、准备工作1. 获取百炼 API Key打开 阿里云百炼控制台左侧菜单 →API 服务→API-Key 管理点击「创建 API-Key」或复制已有的 KeyKey 格式为sk-xxxxxxxx注意免费 Token 仅限中国内地节点使用海外节点不享受免费额度。2. 开启模型免费额度在百炼控制台的「模型广场」中找到你想用的模型点击右侧开关将「未开启」变成「已开启」。免费额度开启不会扣费只是激活使用权限。以下是已验证可用的模型列表截至 2026 年 7 月模型额度到期日特点qwen3.7-plus97.5万2026-09-01日常对话首选glm-5.2100万2026-09-15智谱最新模型kimi-k2.7-code100万2026-09-14代码生成专精kimi-k2.6100万2026-07-21综合能力强qwen3.7-max-2026-06-08100万2026-09-08复杂推理qwen3.6-max-preview100万-预览版支持大上下文qwen3.7-max100万-正式版deepseek-v4-pro100万2026-07-24DeepSeek 专业版qwen3.6-flash100万2026-07-17快速响应qwen3.5-ocr100万2026-09-14视觉识别以及其他 10 个模型…---三、配置 models.json核心步骤3.1 配置文件位置WorkBuddy 的自定义模型配置文件位于~/.workbuddy/models.json在 Windows 上完整路径通常是C:\Users\你的用户名\.workbuddy\models.json3.2 配置格式每个模型需要配置以下字段{ id: 模型API名称, name: WorkBuddy界面显示名称, vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: 你的百炼API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }3.3 关键字段说明字段说明注意事项id必须与百炼 API 模型名完全一致不能加前缀例如glm-5.1而不是bailian-glm-5.1nameWorkBuddy 界面显示的名称可以自定义如GLM 5.1 (百炼免费)url百炼 OpenAI 兼容端点固定为https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completionsuseCustomProtocol必须设为true否则请求会走 WorkBuddy 代理导致「余额不足」错误maxTokens模型最大输出 token 数百炼部分模型上限 65536超出会报错四、踩坑记录重要坑 1useCustomProtocol: false→ 「余额不足」现象配置完成后提示「余额不足或无可用资源包请充值」。原因useCustomProtocol默认为false请求会经过 WorkBuddy 自己的代理服务器转发扣除的是 WorkBuddy 的额度而非百炼额度。解决改为useCustomProtocol: true让 WorkBuddy 直连百炼 API。坑 2id加了前缀 → 「404 模型不存在」现象提示「404 The modelbailian-glm-5.1does not exist」。原因WorkBuddy 把id字段直接作为 API 请求的model参数发送。如果id写的是bailian-glm-5.1百炼 API 不认识这个名称。解决id必须与百炼 API 的模型名完全一致例如glm-5.1、deepseek-v4-flash。坑 3max_tokens超出限制 → 「Range of max_tokens should be [1, 65536]」现象提示「400 InternalError.Algo.InvalidParameter: Range of max_tokens should be [1, 65536]」。原因百炼部分模型的输出上限是 65536 tokensWorkBuddy 默认可能发送更大的值。解决在模型配置中添加maxTokens: 65536。经测试以下模型需要设置此限制qwen3.7-plusdeepseek-v4-flashqwen3.6-flash-2026-04-16qwen3.5-ocrqwen3.6-35b-a3bqwen3.7-max-2026-05-17等其他 Qwen 系列模型glm-5.1、glm-5.2、kimi-k2.7-code等模型无需限制。五、完整配置示例以下是一个包含 20 个百炼模型的完整models.json配置[ { id: qwen3.7-plus, name: Qwen 3.7 Plus (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: glm-5.2, name: GLM 5.2 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh] } }, { id: kimi-k2.7-code, name: Kimi K2.7 Code (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh] } } ]完整配置含全部 20 个模型请参见文末附录或参考项目文件。六、验证配置6.1 重启 WorkBuddy配置保存后完全退出并重启 WorkBuddy不是切换会话是彻底关闭重新打开。6.2 选择模型在对话区底部点击模型选择器找到「阿里云百炼」分组选择你想用的模型。6.3 API 连通性测试如果你想在命令行快速测试模型是否可用可以使用以下 Python 脚本import requests API_KEY sk-你的API-Key url https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions headers {Authorization: fBearer {API_KEY}, Content-Type: application/json} models [qwen3.7-plus, glm-5.2, kimi-k2.7-code] for model in models: response requests.post(url, headersheaders, json{ model: model, messages: [{role: user, content: hi}], max_tokens: 5 }, timeout20) if response.status_code 200: print(f[OK] {model}) else: print(f[FAIL] {model}: {response.json().get(message, 未知错误)})七、模型推荐指南不同模型各有专长按需选择效果最佳场景推荐模型理由日常对话qwen3.7-plus剩余额度最多97.5万到期最晚代码生成kimi-k2.7-code专为代码优化支持 100 万 tokens快速问答qwen3.6-flash响应速度快适合简单问题复杂推理qwen3.7-max-2026-06-08推理能力强支持 reasoning 模式视觉分析qwen3.5-ocr支持图片识别和 OCR中文理解glm-5.2智谱模型中文理解能力强深度分析deepseek-v4-proDeepSeek 专业版分析能力强八、费用说明免费额度规则每个模型独立 100 万 tokens 免费额度额度用完即停不会自动扣费有效期通常为 3-6 个月具体以控制台显示为准仅限中国内地节点使用如何避免超额扣费在百炼控制台设置「免费额度用完即停」定期检查各模型剩余额度不要开启「自动续购」功能九、常见问题 FAQQ: 配置后提示「余额不足」怎么办A: 检查useCustomProtocol是否为true。如果为false请求会走 WorkBuddy 代理。Q: 提示「404 模型不存在」A: 检查id字段是否与百炼 API 模型名完全一致不能加前缀或后缀。Q: 提示「max_tokens 超出范围」A: 在模型配置中添加maxTokens: 65536。Q: 模型列表中看不到百炼模型A: 完全重启 WorkBuddy退出程序重新打开不是切换会话。Q: 免费额度用完后会自动扣费吗A: 不会。默认「用完即停」不会自动购买付费额度。Q: 可以在 LangChain 项目中同时使用这些模型吗A: 可以。使用 OpenAI 兼容接口from langchain_openai import ChatOpenAI llm ChatOpenAI( modelqwen3.7-plus, base_urlhttps://dashscope.aliyuncs.com/compatible-mode/v1, api_keysk-你的API-Key, )十、总结通过自定义模型配置WorkBuddy 可以无缝接入阿里云百炼的 20 个免费大模型。配置过程中的三个关键要点useCustomProtocol: true— 直连百炼 API不走 WorkBuddy 代理id与模型名一致— 不加前缀百炼 API 认什么名字就写什么maxTokens: 65536— 部分 Qwen 系列模型需要限制输出长度配置完成后你就可以在 WorkBuddy 中自由切换各种大模型享受近 2000 万 tokens 的免费额度。附录完整 models.json 配置以下配置包含 20 个已验证的百炼模型复制后替换apiKey为你的百炼 API Key 即可使用[ { id: qwen3.7-plus, name: Qwen 3.7 Plus (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: deepseek-v4-flash, name: DeepSeek V4 Flash (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: false, supportsReasoning: false, useCustomProtocol: true, maxTokens: 65536 }, { id: qwen3.6-flash-2026-04-16, name: Qwen 3.6 Flash 0416 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: false, useCustomProtocol: true, maxTokens: 65536 }, { id: qwen3.5-ocr, name: Qwen 3.5 OCR (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: false, useCustomProtocol: true, maxTokens: 65536 }, { id: qwen3.6-35b-a3b, name: Qwen 3.6 35B-A3B (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high] } }, { id: qwen3.7-max-2026-05-17, name: Qwen 3.7 Max 0517 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: qwen3.7-max-2026-06-08, name: Qwen 3.7 Max 0608 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: glm-5.2, name: GLM 5.2 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh] } }, { id: kimi-k2.7-code, name: Kimi K2.7 Code (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh] } }, { id: kimi-k2.6, name: Kimi K2.6 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh] } }, { id: qwen3.7-max-2026-05-20, name: Qwen 3.7 Max 0520 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: qwen3.7-plus-2026-05-26, name: Qwen 3.7 Plus 0526 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: qwen3.6-flash, name: Qwen 3.6 Flash (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: false, useCustomProtocol: true, maxTokens: 65536 }, { id: deepseek-v4-pro, name: DeepSeek V4 Pro (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: false, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: qwen3.6-27b, name: Qwen 3.6 27B (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high] } }, { id: glm-5.1, name: GLM 5.1 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh] } }, { id: qwen3.7-max-preview, name: Qwen 3.7 Max Preview (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: qwen3.5-plus-2026-04-20, name: Qwen 3.5 Plus 0420 (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh] } }, { id: qwen3.6-max-preview, name: Qwen 3.6 Max Preview (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, maxTokens: 65536, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } }, { id: qwen3.7-max, name: Qwen 3.7 Max (百炼免费), vendor: 阿里云百炼, url: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions, apiKey: sk-你的API-Key, supportsToolCall: true, supportsImages: true, supportsReasoning: true, useCustomProtocol: true, reasoning: { supportedEfforts: [minimal, low, medium, high, xhigh, max] } } ]更新时间2026 年 7 月 6 日测试环境Windows 11 WorkBuddy 5.1.7 阿里云百炼测试结果19/20 个模型可用deepseek-v4-flash免费额度已耗尽本文档为技术分享配置和使用过程中请遵守阿里云百炼的服务条款。