Docs / Developer Tools
Docs / Developer Tools
Install the Claude Code CLI and complete persistent configuration, temporary configuration, and connectivity verification through APIMAX's Claude-compatible API.
Claude Code is Anthropic's terminal coding assistant. APIMAX provides an API compatible with the Claude Messages API, so you only need to configure the API base URL and API key to keep using Claude Code's project analysis, code editing, command execution, and multi-turn conversation capabilities.
This guide uses the following configuration:
| Setting | Value |
|---|---|
| API base URL | https://api.apimax.ai |
| Auth variable | ANTHROPIC_AUTH_TOKEN |
| Protocol | Claude Messages API |
An API key is a sensitive credential. Do not put it in Git repositories, screenshots, ticket bodies, or public scripts.
On Windows, macOS, and Linux with Node.js already installed, you can run:
npm install -g @anthropic-ai/claude-code
claude --versionmacOS and Linux users can also use the official install script:
curl -fsSL https://claude.ai/install.sh | bashIf npm is not found, install Node.js LTS first. If you hit permission errors, prefer a Node version manager over long-term use of administrator privileges to install global packages.
Claude Code's user configuration file is located at:
%USERPROFILE%\.claude\settings.json~/.claude/settings.jsonCreate the file manually if it does not exist. Write the following content and replace the placeholder key with the key generated in the console:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-your-apimax-key",
"ANTHROPIC_BASE_URL": "https://api.apimax.ai",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}If the file already contains other settings, merge only the env field instead of overwriting the entire file. The JSON must not contain comments, Chinese punctuation, or trailing commas.
Temporary configuration is convenient for a first-time check and is discarded when the terminal closes.
$env:ANTHROPIC_BASE_URL="https://api.apimax.ai"
$env:ANTHROPIC_AUTH_TOKEN="sk-your-apimax-key"
claudeset ANTHROPIC_BASE_URL=https://api.apimax.ai
set ANTHROPIC_AUTH_TOKEN=sk-your-apimax-key
claudeexport ANTHROPIC_BASE_URL="https://api.apimax.ai"
export ANTHROPIC_AUTH_TOKEN="sk-your-apimax-key"
claudeLaunch it from your project directory:
cd your-project
claudeYou can also run a one-off verification:
claude "Reply only: Connection successful"On success you will receive a reply from the model. In interactive mode, use /model to view or switch between the models available to your account.
ANTHROPIC_AUTH_TOKEN./model in Claude Code.ANTHROPIC_BASE_URL is exactly https://api.apimax.ai; do not append /v1/messages.settings.json under your current user directory..env.example, README, or commit history.