Claude Code
Connect Claude Code to HopBase with one-click setup or environment variables.
Claude Code is Anthropic's official CLI. Use the console's one-click setup for a first installation, CC Switch when you manage several providers, and manual setup when you already manage environment variables yourself.
| Method | Best for | What it does |
|---|---|---|
| One-click setup (recommended) | First-time setup | Installs Claude Code, backs up and writes ~/.claude/settings.json, and verifies the key |
| CC Switch | Graphical setup or multiple providers | Imports and switches Claude Code provider configurations |
| Manual setup | Existing environment-management workflows | Sets the Base URL and key environment variables directly |
Recommended: one-click setup from the console
No environment-variable knowledge is required. Windows, macOS, and Linux are supported.
Find the one-click button
Sign in to the console, open API Keys, and select One-Click Setup beside the key.
Copy the command for your system
Select Claude Code, choose macOS / Linux or Windows PowerShell, click Generate Setup Command, then copy the command.
Paste it into a terminal and press Enter
On macOS, open Terminal. On Linux, open any terminal (curl must be installed). On Windows, open PowerShell. The script installs Claude Code if needed, backs up existing configuration, writes the HopBase settings, and verifies the connection.
Start Claude Code
After setup succeeds, open a new terminal window and run claude.
The command contains a single-use integration token that expires after 15 minutes, not the API key itself.
The script merges ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN into the env block of ~/.claude/settings.json, after backing up the existing file as settings.json.bak.<timestamp>. Claude Code uses the values in this file, so a variable with the same name set in your shell does not take effect. To change the key or address, edit this file or run one-click setup again; do not combine it with manual setup.
Desktop setup with CC Switch
The CC Switch guide covers macOS, Windows, and Linux installation, importing Claude Code or Codex CLI from the HopBase console, switching providers, and GLM-5.3 local routing.
Manual setup
Temporary settings apply only to the current terminal window:
export ANTHROPIC_BASE_URL=https://api.hop-base.com
export ANTHROPIC_AUTH_TOKEN=sk-your-key
claudePersistent settings belong in your shell startup file:
# zsh (the macOS default)
echo 'export ANTHROPIC_BASE_URL=https://api.hop-base.com' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN=sk-your-key' >> ~/.zshrc
source ~/.zshrc
# bash (common on Linux; use this instead of the zsh block)
echo 'export ANTHROPIC_BASE_URL=https://api.hop-base.com' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN=sk-your-key' >> ~/.bashrc
source ~/.bashrcSwitch models
In a Claude Code session, enter /model to pick or type a model ID. You can also start Claude Code with --model, or set the ANTHROPIC_MODEL environment variable (with one-click setup, add it to the env block of ~/.claude/settings.json). Use only IDs returned by GET /v1/models for the current key.
# Switch inside a session (enter /model alone to list models)
/model claude-opus-5
# Or choose a model at startup
claude --model claude-sonnet-5Choose a group
The group menu shown when you create a key is authoritative. The public Claude groups offer the same models and differ in the clients they are meant for:
| Group | Use with |
|---|---|
| Claude Max (Official, Full Quota) | Claude Code, SDKs, editors, and third-party clients |
| Claude Max (Official, Full Quota) - Limited-Time Offer | Same as the row above, offered for a limited time |
| Claude Max (ccmax) | The Claude Code client only; calls with this key from SDKs, curl, editors, or third-party clients fail |
Use a key from a Claude group (the Claude Max family). Common mistakes: adding /v1 to the Base URL, so requests go to /v1/v1/messages, or calling an OpenAI-protocol endpoint (/v1/chat/completions, /v1/responses) with a Claude key. Both return 404 "This API path is not supported by the current platform". Claude Code's count_tokens requests also count toward concurrency; see Concurrency, timeouts, and billing for limits. See Troubleshooting when setup fails.
Next steps
- CC Switch: switch between several providers or keys
- Editors and IDEs: use Claude models in Cursor, Cline, or Continue
- Troubleshooting: look up an error message