Docs · Providers
Tencent Cloud Token Plan in Claude Code and Codex
Tencent Cloud's models are on TokenHub: the Token Plan subscription (personal and enterprise) and pay as you go, each on keys of its own — an sk-tp- plan key, or TokenHub's own API key. Add one Tencent Cloud provider in magpie with each key's plan, and Claude Code, Codex, Gemini CLI, OpenCode and other tools use Hy, GLM, Kimi, DeepSeek and MiniMax through magpie's local gateway on 127.0.0.1:3425.
Add Tencent Cloud
- Add the provider and pick the planOn Providers, click + Add provider, pick Tencent Cloud, set the key's plan to Plan · China, Pay as you go · China, Pay as you go · Global, Enterprise plan · Global, paste the key and save.
- Pick it for a toolOn Agents, pick a model such as tc-code-latest or glm-5.3 on a tool's row.
magpie claude tencent-cloud/tc-code-latest magpie codex tencent-cloud/glm-5.3 magpie opencode tencent-cloud/kimi-k3
Plans and endpoints
| Plan | Chat Completions and Responses | Anthropic Messages |
|---|---|---|
| Token Plan (personal, enterprise) · China | https://tokenhub.tencentmaas.com/plan/v3 | https://tokenhub.tencentmaas.com/plan/anthropic |
| Pay as you go · China | https://tokenhub.tencentmaas.com/v1 | https://tokenhub.tencentmaas.com |
| Pay as you go · Global | https://tokenhub-intl.tencentmaas.com/v1 | https://tokenhub-intl.tencentmaas.com |
| Enterprise · Singapore | https://tokenhub-intl.tencentmaas.com/plan/v3 | https://tokenhub-intl.tencentmaas.com/plan/anthropic |
The personal and enterprise plans share endpoints; the key tells the plan. China is one region for both, so its models are the two plans' together; Singapore sells the enterprise plan alone. Each key in the provider names its plan, so pay-as-you-go and plan keys can share one provider.
The personal plan used to be at api.lkeap.cloud.tencent.com until Tencent moved it to TokenHub. A provider saved at the old host is moved to the new one.
The plans' models
The plans give no model list of their own, and the public catalog names only their Hy models, so magpie gives the models from Tencent's plan docs: tc-code-latest, auto, glm-5.3, glm-5.3-flash, kimi-k3, kimi-k2.7-code, deepseek-v4-pro, deepseek-v4.1-flash, minimax-m3, hy4-preview, hy3, mimo-v2.6-pro, among others. tc-code-latest is whichever model the console has picked. A pay-as-you-go key reads TokenHub's /v1/models, which has other makers' models such as Qwen too.
In each agent
- Claude Code speaks Anthropic Messages. The plan and pay as you go both have Anthropic endpoints, so requests go as they are. See Claude Code with other models.
- Codex speaks only OpenAI Responses. TokenHub's plan and pay as you go both serve Responses, so Codex's requests go as they are. The models show in Codex's
/model. See Codex with other models. - Gemini CLI speaks Gemini's API; magpie points it at the local gateway and translates. See Gemini CLI with other models.
- OpenCode: magpie writes the models into opencode.json. See OpenCode with other models.
Enterprise quota
The enterprise plan's cycle quota (credits on 专业套餐, tokens on 轻享套餐) is told only to Tencent Cloud's API, signed with the account's SecretId and SecretKey, never to the plan key. Add them in the provider's editor, and magpie's Usage page shows a card for each enterprise plan the SecretId can see: what the cycle has used and when it resets. The personal plan has no API for its usage, only the console; pay as you go has no windows.
FAQ
How do I use the Tencent Cloud Token Plan in Claude Code?
Add Tencent Cloud in magpie with the key's plan set to Plan · China, then pick tc-code-latest or glm-5.3 on Claude Code's row, or run magpie claude tencent-cloud/tc-code-latest. Requests go to the plan's Anthropic endpoint, https://tokenhub.tencentmaas.com/plan/anthropic.
What is the difference between a Token Plan key and a TokenHub pay-as-you-go key?
A plan key starts with sk-tp- and works only at the plan endpoints under /plan; pay as you go uses TokenHub's own API key at /v1. Set each key's plan in magpie; both can share one provider.
Does the personal plan's old host api.lkeap.cloud.tencent.com still work?
Tencent moved the personal plan to tokenhub.tencentmaas.com. A provider in magpie saved at the old host is moved to the new one by itself.
Can magpie show what is left of a Tencent Cloud plan?
For the enterprise plan, yes: add the account's SecretId and SecretKey in the provider's editor, and the Usage page shows the cycle's use and its reset. The personal plan has no API for it; see Tencent Cloud's console.
The same for other providers: Volcengine Ark, GLM Coding Plan, Kimi, DeepSeek, Qwen. Hit an error? See troubleshooting, or ask on Discord.