Integrate Claude Code
Claude Code is an AI coding assistant that runs in your terminal. HiModels provides an Anthropic Messages-compatible endpoint so you can use supported Claude and DeepSeek models through one account.
Switch an Existing Installation to HiModels
If Claude Code is already installed, set the following environment variables. Create and copy a key from HiModels API Keys.
Run in a macOS or Linux terminal:
export ANTHROPIC_BASE_URL=https://api.himodels.ai export ANTHROPIC_AUTH_TOKEN=<your_himodels_api_key> export ANTHROPIC_MODEL=claude-sonnet-4-6 export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-7 export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-6 export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
Run in Windows PowerShell:
$env:ANTHROPIC_BASE_URL="https://api.himodels.ai" $env:ANTHROPIC_AUTH_TOKEN="<your_himodels_api_key>" $env:ANTHROPIC_MODEL="claude-sonnet-4-6" $env:ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-7" $env:ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6" $env:ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
Install Claude Code from Scratch
- Install Node.js 18 or later.
- Windows users must install Git for Windows first.
- Install Claude Code and verify that the command is available.
npm install -g @anthropic-ai/claude-code claude --version
After installation, configure the environment variables shown in “Switch an Existing Installation to HiModels” above.
Open a Project and Start
Replace the sample path with your local project directory, then start Claude Code:
cd /path/to/my-project claude
Choose a HiModels Model
The environment variables set the default model. You can also use claude --model
| Model family | Model ID | Recommended use |
|---|---|---|
| Claude | claude-sonnet-4-6 | Daily development, code understanding, and edits |
| Claude | claude-opus-4-7 | Complex tasks, architecture analysis, and deep reasoning |
| DeepSeek | deepseek-v4-flash | Fast questions and lightweight coding tasks |
| DeepSeek | deepseek-v4-pro[1m] | Large repositories and long-context tasks |
For a 401 response, check the API Key and confirm ANTHROPIC_AUTH_TOKEN is active in the current terminal. If a model is unavailable, verify its ID and access on HiModels Explore.