npm install -g @openai/codex@0.80.0
codex --version
~/.codex/config.toml 中。~/.codex/config.toml。C:\\Users\\<用户名>\\.codex\\config.toml。$model_id 替换为所需的 Model ID。完整模型列表请参见 专业套餐可用模型 和 轻享套餐可用模型。model_provider = "Enterprise_Token_Plan"model = "$model_id"[model_providers.Enterprise_Token_Plan]name = "Enterprise Token Plan"base_url = "https://tokenhub.tencentcloudmaas.com/plan/v3"env_key = "Enterprise_Token_Plan_API_KEY"wire_api = "chat"
model_provider = "Enterprise_Token_Plan"model = "$model_id"[model_providers.Enterprise_Token_Plan]name = "Enterprise Token Plan"base_url = "https://tokenhub-intl.tencentcloudmaas.com/plan/v3"env_key = "Enterprise_Token_Plan_API_KEY"wire_api = "chat"
echo $SHELL
echo 'export Enterprise_Token_Plan_API_KEY="USER_API_KEY"' >> ~/.zshrc#配置生效source ~/.zshrc
echo 'export Enterprise_Token_Plan_API_KEY="USER_API_KEY"' >> ~/.bash_profile#配置生效source ~/.bash_profile
# 用您的 API Key 替换 USER_API_KEYsetx Enterprise_Token_Plan_API_KEY "USER_API_KEY"#新开 CMD 窗口检查是否生效echo %Enterprise_Token_Plan_API_KEY%
# 用您的 API Key 替换 USER_API_KEY[Environment]::SetEnvironmentVariable("TP_ENT_API_KEY", "USER_API_KEY", [EnvironmentVariableTarget]::User)#新开一个窗口验证是否生效echo $env:TP_ENT_API_KEY
codex

文档反馈