Use Tencent Cloud in Codex
Generate a Codex config from the Responses-compatible endpoint in Tencent Cloud's docs. The API key in the config is a placeholder; replace it with a key you create at Tencent Cloud.
Endpoints
Generate the config
Save to ~/.codex/config.toml; merge it in if the file already exists
model = "hy4"
model_provider = "tencent-cloud"
[model_providers.tencent-cloud]
name = "Tencent Cloud"
base_url = "https://tokenhub.tencentmaas.com/plan/v3"
env_key = "TENCENT_CLOUD_API_KEY"
wire_api = "responses"
Plans covered
- Tencent Cloud Token Plan Lite$5.85/mo equivalent每订阅月 780 积分;按基础使用场景预估约 70 轮问答式交互;每主账号最多持有 1 个通用 + 1 个 Hy Token Plan;不支持退订
- Tencent Cloud Token Plan Standard$14.84/mo equivalent每订阅月 1980 积分;约 200 轮问答式交互;每主账号最多持有 1 个通用 + 1 个 Hy Token Plan;不支持退订
- Tencent Cloud Token Plan Pro$44.82/mo equivalent每订阅月 5980 积分;每主账号最多持有 1 个通用 + 1 个 Hy Token Plan;不支持退订
- Tencent Cloud Token Plan Max$89.80/mo equivalent每订阅月 11980 积分;每主账号最多持有 1 个通用 + 1 个 Hy Token Plan;不支持退订
How to check it works
Restart Codex and send a message. If it replies and the request shows up in Tencent Cloud's console, it is using this endpoint.
FAQ
Why is the key in an environment variable?
config.toml only holds the variable's name, so the key never goes into the config file and does not leak when you share or sync it. To keep it, add the export line to ~/.zshrc or ~/.bashrc.
How do I switch back to OpenAI?
Remove the model_provider line from config.toml, then restart Codex.
Does my key pass through this site?
No. The page only generates config text and never asks for your key; the key only goes into the terminal or environment variables on your own machine.