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

  1. Install Node.js 18 or later.
  2. Windows users must install Git for Windows first.
  3. 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 --modelfor a temporary switch. Use the model ID shown on the HiModels Explore page.

Model familyModel IDRecommended use
Claudeclaude-sonnet-4-6Daily development, code understanding, and edits
Claudeclaude-opus-4-7Complex tasks, architecture analysis, and deep reasoning
DeepSeekdeepseek-v4-flashFast questions and lightweight coding tasks
DeepSeekdeepseek-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.