看有人说 CodeBuddy 的 ds4.1 倍率x.003
然后 每月 500 积分 + 首次一个月 1500 积分
这不是鸡蛋吗?论坛中居然没有…而且大家好像都很怕南山必胜客 = =
研究了一下反代,抓包要 node 信任一下 charles 的证书
export NODE_EXTRA_CA_CERTS=~/charles-ca.pem
看了下接口好像差不多,里面发送的内容不一样
url
https://copilot.tencent.com/v2/chat/completions
key
macos下位于
~/Library/Application Support/CodeBuddyExtension/Data/Public/auth/Tencent-Cloud.coding-copilot.info
是个 json,里面有 refreshToken和 accessToken,标准的 oauth
accessToken是 jwt, 过期时间一天,过期要刷新
/v2/plugin/auth/token 这个接口刷新
调用示例
不用加任何多余的东西
curl 'https://copilot.tencent.com/v2/chat/completions' \
-X POST \
-H "Authorization: Bearer <accessToken>" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"model": "hy4-preview",
"messages": [
{
"role": "user",
"content": "Say hi in one word"
}
],
"max_tokens": 8,
"stream": true
}'
opencode 配置如下:
"cbc": {
"npm": "@ai-sdk/openai-compatible",
"name": "cbc",
"options": {
"baseURL": "https://copilot.tencent.com/v2",
"apiKey": "{env:accessToken}"
},
"models": {
"hy4-preview": {
"name": "hy4-preview",
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
}
},
"deepseek-v4.1-flash": {
"name": "deepseek-v4.1-flash",
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
}
},
"hy3": {
"name": "hy3",
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
}
}
}
}
出现的问题:
因为中间的转换层不一样
hy4/hy3
https://copilot.tencent.com/v2 中 的格式是
{"delta":{"content":"<正文内容>","reasoning_content":"<思考内容>"}}
@ai-sdk/openai-compatible的是
{"delta":{"content":"<正文内容>","reasoning":"<思考内容>"}}
这会导致 opencode 中显示有问题,出现很多次 reasoning

deepseek-v4.1-flash
好像没有来得及适配?全部是content 没有reasoning
所以不管是在 opencode 中还是CodeBuddy中都没有任何思考过程,全部是content
总结:
想好用,要自己写要给转换层,看 github 上已经有了
hy3/hy4 免费也懒得用
ds4.1 如果不介意 没有任何思考过程,全部是content,勉强能用
看了下即使 x0.003 也不是很耐用
不值得薅