Files
9router/open-sse/providers/registry/codebuddy-cn.js
T
zmf e014cb537f feat(codebuddy-cn): refresh model catalog — add hy4-preview/hy3/glm-5.3/kimi-k3, drop EOL glm-5.0/glm-4.7
- Add hy3, hy3-x, hy4-preview, hy4-preview-x, glm-5.3, glm-5.3-flash, kimi-k3-1
- Remove dead models glm-5.0, glm-4.7 (API 11102)
- Register capabilities and context windows in PROVIDER_CAPABILITIES
- Configure supported effort sets in PATTERN_THINKING
2026-09-03 09:41:02 +07:00

86 lines
3.1 KiB
JavaScript

export default {
id: "codebuddy-cn",
// Short model prefix (cbcn/glm-5.2). "cbcn" = CodeBuddy CN; reserve "cbai"
// for a future codebuddy-ai (intl) provider. The full id still resolves.
alias: "cbcn",
uiAlias: "cbcn",
hidden: false,
priority: 90,
display: {
name: "CodeBuddy CN",
icon: "smart_toy",
color: "#006EFF",
website: "https://copilot.tencent.com",
notice: {
signupUrl: "https://copilot.tencent.com",
},
},
category: "oauth",
authModes: ["oauth", "apikey"],
hasOAuth: true,
transport: {
baseUrl: "https://copilot.tencent.com/v2/chat/completions",
forceStream: true,
// CodeBuddy is a unified OpenAI-compatible gateway: every model (GLM, Kimi,
// MiniMax, DeepSeek, Hunyuan) takes reasoning via OpenAI-style reasoning_effort,
// not its vendor-native thinking shape. Force the openai thinking format.
thinkingFormat: "openai",
headers: {
"User-Agent": "CLI/2.108.1 CodeBuddy/2.108.1",
"X-Product": "SaaS",
"X-IDE-Type": "CLI",
"X-IDE-Name": "CLI",
"x-requested-with": "XMLHttpRequest",
"x-codebuddy-request": "1",
},
auth: {
combined: true,
header: "Authorization",
scheme: "bearer",
},
// Quota endpoint differs from the chat gateway: POST returns nested Tencent
// billing payload (data.Response.Data.Accounts[]). See services/usage/codebuddy-cn.js.
usage: {
url: "https://copilot.tencent.com/v2/billing/meter/get-user-resource",
},
},
models: [
{ id: "glm-5.2", name: "GLM-5.2" },
{ id: "glm-5.1", name: "GLM-5.1" },
{ id: "glm-5.0-turbo", name: "GLM-5.0-Turbo" },
{ id: "glm-5v-turbo", name: "GLM-5v-Turbo" },
{ id: "minimax-m3", name: "MiniMax-M3" },
{ id: "minimax-m2.7", name: "MiniMax-M2.7" },
{ id: "kimi-k2.7", name: "Kimi-K2.7-Code" },
{ id: "kimi-k2.6", name: "Kimi-K2.6" },
{ id: "kimi-k2.5", name: "Kimi-K2.5" },
// "-x" suffix = paid tier of the same model (free id rides the promo quota:
// hy3 free until 2026-08-31, hy4-preview until 2026-09-10). Server model table
// seen in client logs 2026-08-30; glm-5.0 / glm-4.7 removed (API 11102 dead).
{ id: "hy3-preview", name: "Hy3 Preview" },
{ id: "hy3", name: "Hy3" },
{ id: "hy3-x", name: "Hy3 (Paid)" },
{ id: "hy4-preview", name: "Hy4-Preview" },
{ id: "hy4-preview-x", name: "Hy4-Preview (Paid)" },
{ id: "glm-5.3", name: "GLM-5.3" },
{ id: "glm-5.3-flash", name: "GLM-5.3-Flash" },
{ id: "kimi-k3-1", name: "Kimi-K3" },
{ id: "deepseek-v4-pro", name: "DeepSeek-V4-Pro" },
{ id: "deepseek-v4-flash", name: "DeepSeek-V4-Flash" },
{ id: "deepseek-v3-2-volc", name: "DeepSeek-V3.2" },
],
oauth: {
baseUrl: "https://copilot.tencent.com",
stateUrl: "https://copilot.tencent.com/v2/plugin/auth/state",
tokenUrl: "https://copilot.tencent.com/v2/plugin/auth/token",
refreshUrl: "https://copilot.tencent.com/v2/plugin/auth/token/refresh",
userAgent: "CLI/2.63.2 CodeBuddy/2.63.2",
platform: "CLI",
pollInterval: 5000,
},
features: {
usage: true,
usageApikey: true,
},
};