
settings.json file. Then, based on the channel through which you obtained the API Key, add the corresponding configuration content. Note that the configuration file path varies across different systems. For details, refer to:~/.claude/settings.json.%USERPROFILE%/.claude/settings.json.settings.json file does not exist, you can manually create it using a text editor (such as VSCode or Notepad) or run the following command in the terminal to create it:# MacOS/Linuxmkdir -p ~/.claude && touch ~/.claude/settings.json# Windows(PowerShell)New-Item -ItemType Directory -Force -Path "$HOME\\.claude" | Out-Null; New-Item -ItemType File -Force -Path "$HOME\\.claude\\settings.json" | Out-Null
YOUR_API_KEY with your actual API Key):{"env": {"ANTHROPIC_BASE_URL": "https://tokenhub-intl.tencentcloudmaas.com","ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY","ANTHROPIC_MODEL": "deepseek-v4-pro","ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro","ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro","ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-pro","CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-pro","ENABLE_TOOL_SEARCH": false}}
Environment Variable | Required | Description |
ANTHROPIC_BASE_URL | Yes | The API Gateway address used by Claude Code to make requests. When Claude Code is integrated with TokenHub, it is fixed as https://tokenhub-intl.tencentcloudmaas.com. |
ANTHROPIC_AUTH_TOKEN | Yes | The API Key used for authentication. Replace it with the real API Key you created in the TokenHub console. Keep it secure to avoid leakage. |
ANTHROPIC_MODEL | Yes | The model name called by default by Claude Code. This document uses deepseek-v4-pro as an example. You can also replace it with other models supported by TokenHub. |
ANTHROPIC_DEFAULT_OPUS_MODEL | No | The model to which the Opus tier (for high-complexity tasks) in Claude Code is mapped. It is set to deepseek-v4-pro here to make all tiers point to the same model. |
ANTHROPIC_DEFAULT_SONNET_MODEL | No | The model to which the Sonnet tier (for default daily tasks) in Claude Code is mapped. |
ANTHROPIC_DEFAULT_HAIKU_MODEL | No | The model to which the Haiku tier (for lightweight/quick tasks) in Claude Code is mapped. |
CLAUDE_CODE_SUBAGENT_MODEL | No | The model used by Claude Code when subtasks are created (subagents). It is recommended to keep it consistent with the main model to avoid compatibility issues caused by cross-model calls. |
ENABLE_TOOL_SEARCH | No | Whether to enable the native web search tool built into Claude Code. Since Claude Code prohibits third-party models from using the built-in search, set it to false here. |
# Open the project directory.cd your-project# Start Claude Code.claude
/status in Claude Code to confirm that the model status is active (refer to the example in the figure below). The model configuration is effective when API Endpoint displays https://tokenhub-intl.tencentcloudmaas.com and Model displays deepseek-v4-pro.
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan