Skip to content

CodeBuddy

CodeBuddy(腾讯云代码助手)通过 models.json 配置 OpenAI 兼容自定义模型。url 须写完整接口路径,例如 https://api.trinitydesk.ai/v1/chat/completions

官方说明:CodeBuddy · models.json


获取 API Key

  1. 控制台 · API 密钥 创建 Key(xh-...)。
  2. 管理 API 密钥

模型 ID 见 模型广场


手动配置(models.json)

级别路径
用户级~/.codebuddy/models.json
项目级.codebuddy/models.json(仓库根目录)

项目级优先于用户级。id 须与 模型广场 模型 ID 一致;urlhttps://api.trinitydesk.ai/v1/chat/completions

json
{
  "models": [
    {
      "id": "gpt-5.4",
      "name": "Trinity · gpt-5.4",
      "vendor": "OpenAI",
      "apiKey": "xh-你的key",
      "url": "https://api.trinitydesk.ai/v1/chat/completions",
      "maxInputTokens": 200000,
      "maxOutputTokens": 8192,
      "supportsToolCall": true,
      "supportsImages": true,
      "supportsReasoning": false
    }
  ],
  "availableModels": ["gpt-5.4"]
}
字段说明
idTrinity 模型 ID
apiKeyTrinity Key 实际值(xh-...
url完整路径,须含 /chat/completions
availableModels可选;限制 UI 可选模型

多模型时在 models 数组中追加项。保存后重启 CodeBuddy IDE,在模型选择器中选对应 id

故障排查

问题排查
401 Unauthorized确认 API Key 以 xh- 开头且未过期
403 model_not_allowed在控制台确认 Key 有该模型的调用权限
连接超时确认 urlhttps://api.trinitydesk.ai/v1/chat/completions
模型未找到模型广场 核对模型 ID

WARNING

不要将 API Key 提交到 Git 仓库。使用环境变量或配置文件管理 Key,定期轮换。

© Trinity AI