Skip to main content

Overview

Claude Code is Anthropic’s official command-line tool that brings Claude’s intelligence directly into your terminal. It can understand your codebase, edit files, run commands, and help you build software faster. By connecting Claude Code CLI to AihubMax, you can access Claude’s full capabilities through AihubMax’s reliable API infrastructure — direct network access from China, pay-as-you-go with no balance expiration, and transparent, traceable channels.
We provide a dedicated endpoint optimized for Claude Code CLI. Use https://api.aihubmax.com as the Base URL for the best experience.

Prerequisites

Node.js 18+

Required for installing Claude Code via npm. Download Node.js →

Git

Git is required for Claude Code to function properly. Download Git →

AihubMax API Key

You need a valid AihubMax API Key. See the installation steps below for how to obtain one. Go to AihubMax →

Python (Optional)

Some advanced features may require a Python environment. Download Python →
After installation, open a terminal (PowerShell on Windows) to verify your environment:
Windows users: If you encounter errors running commands, open PowerShell as Administrator and run the following command, then select A:
Windows Execution Policy Setting

Installation & Configuration

1

Step 1: Install Claude Code CLI

Choose your installation method based on your operating system:
Open a new PowerShell window and run:
Verify the installation:
2

Step 2: Get Your API Key

Go to the AihubMax Console and complete the following:
  1. Create an account: Register at api.aihubmax.com
  2. Create an API key: On the API Keys page, click “Create Key”
When creating a key, you must select the “Claude-Max” group. This is the official channel dedicated to Claude Code for the best experience. Other groups may not support Claude Code or may have feature limitations.
3

Step 3: Configure Environment

We recommend using CC-Switch for one-click configuration, or you can manually edit the configuration file.
The CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC setting is required. It prevents Claude Code from sending telemetry and other non-essential requests to Anthropic’s servers. Without this setting, those requests will fail due to lacking an official API Key, which may cause errors.
4

Step 4: Install VSCode Extension (Optional)

If you use VSCode, you can install the official extension for a better integrated experience:
  1. Download and install VSCode
  2. Search for Claude Code in the extension marketplace. Make sure the author is Anthropic
Verify the author is Anthropic
  1. After installation, you’ll see the Claude Code panel in the VSCode sidebar
Claude Code panel in VSCode
If the side panel doesn’t appear, the environment variables may not be configured correctly, or your AihubMax account may have insufficient balance.
Environment not configured or insufficient balancePanel after successful configuration
5

Step 5: Start Using

Launch Claude Code in your project directory:
This opens an interactive session where you can chat with Claude about your codebase.You can also run one-off commands:

Verify the Connection

Run the following command to confirm Claude Code is correctly routing through AihubMax:
If configured correctly, Claude will respond normally. If you see an error, check the Troubleshooting section below.

Usage Examples

Troubleshooting

  • Double-check your ANTHROPIC_AUTH_TOKEN value. It should be your AihubMax API Key (starts with sk-).
  • Ensure your API key has not expired and has sufficient balance.
  • Verify the key has access to Claude models on your AihubMax account.
  • Verify ANTHROPIC_BASE_URL is set to https://api.aihubmax.com (no trailing slash).
  • Check your network connection and ensure you can reach api.aihubmax.com.
  • If you are behind a corporate proxy, ensure the proxy allows HTTPS traffic to api.aihubmax.com.
  • Make sure CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC is set to 1.
  • If using settings.json, ensure the JSON syntax is valid (no trailing commas, proper quoting).
  • Restart your terminal after making changes to environment variables or settings.
  • Confirm the file is located at ~/.claude/settings.json (not inside your project directory).
  • Validate the JSON format using a tool like jq:
  • Ensure there are no conflicting environment variables set in your shell profile that might override the settings file.

Security Best Practices

  • Never commit your API key to version control. If using environment variables, add them to your shell profile rather than project files.
  • Use dedicated keys when possible. AihubMax allows you to create multiple API keys — use a dedicated key for Claude Code so you can revoke it independently if needed.
  • Monitor usage on the AihubMax Console to detect any unexpected consumption.