feat: support Tencent TokenHub API key via OpenAI-compatible protocol#6232
Open
feitianbubu wants to merge 2 commits into
Open
feat: support Tencent TokenHub API key via OpenAI-compatible protocol#6232feitianbubu wants to merge 2 commits into
feitianbubu wants to merge 2 commits into
Conversation
Contributor
WalkthroughTencent channels now select native or OpenAI-compatible adaptors from the API key format, default compatible requests to the TokenHub endpoint, support streaming, and display updated key-format guidance. ChangesTencent adaptor dispatch
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 变更描述 / Description
腾讯云新的 TokenHub 平台发的是单段 sk 密钥,走 OpenAI 兼容协议,和旧混元三段式 AppId|SecretId|SecretKey(TC3 签名)不是一套东西。旧混元平台2026-06-22已开始下线, 2026-09-30 停服,新购只能用 TokenHub 的 api key。
改法: 因为新版兼容oai格式, 因此改法比较简单, key 含
|走原来 TC3逻辑,api key 走 OpenAI 兼容的实现即可, 代码改动较小迁服新闻: https://cloud.tencent.com/announce/detail/2310
新版平台: https://console.cloud.tencent.com/tokenhub/models
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
新建渠道,优化提示:


新版渠道,自测通过:
由于旧版渠道已无法新建,因此无法自测, 通过断点验证了旧的的url 和 tc3段key和签名正常