Skip to main content

Quick Start

This guide will help you get started with Claude Code provided by AIHubMix in just a few minutes.

1. Install Claude Code

Quick Installation with a Script

Run the following commands in your terminal or IDE to download a shell script that automatically configures environment variables for you. Just execute it.
curl -LO https://raw.githubusercontent.com/AiHubMix/claude-code/main/claude_code_prod.sh

chmod +x claude_code_prod.sh

./claude_code_prod.sh

Local Installation

curl -fsSL https://claude.ai/install.sh | bash

Install using npm

Requires Node.js version 18 or higher
npm install -g @anthropic-ai/claude-code

2. Connect Claude Code to AIHubMix

Set environment variables to connect Claude Code to AIHubMix.
Note: Do not use Anthropic login directly.
Requirements:
  1. Use https://aihubmix.com as ANTHROPIC_BASE_URL
  2. Provide the AIHubMix API Key as the ANTHROPIC_API_KEY
Claude Configuration File: .claude/settings.json
{
  "env": {
    "ANTHROPIC_API_KEY": "AIHUBMIX_API_KEY",
    "ANTHROPIC_BASE_URL": "https://aihubmix.com",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5",
  }
}
Please replace AIHUBMIX_API_KEY with the actual AIHUBMIX API key.
The native installer for Claude Code cannot read standard .env files, so do not place this content in a .env file.

3. Start

Navigate to your project directory and start Claude Code:
$ cd /path/your-project
> claude
Once connected, any prompts you send will be routed through AIHubMix.

4. Verification

You can confirm your connection by entering the /status command in Claude Code.
> /status

 API key: sk-**** #AIHUBMIX_API_KEY
 Anthropic base URL: https://aihubmix.com

 Model: claude-sonnet-4-5

Switch Models

Override Default Model

For quickly modifying the default model, we recommend using CC-Switch.
You can override the default model aliases through environment variables, configuring Claude Code to use any model on AIHubMix (including OpenAI, Gemini, or GLM models). For example, to replace the default alias “Sonnet” with gpt-5.2-codex:
export ANTHROPIC_DEFAULT_SONNET_MODEL="gpt-5.2-codex"
You can also override other levels:
export ANTHROPIC_DEFAULT_OPUS_MODEL="gemini-3-flash-preview-search"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-4.7"
While you can use any model through AIHubMix, we recommend using powerful models (such as Claude Opus 4.5, GPT 5.2, etc.) for the best experience.

Switch Model

Use the Claude Code command:
/model [model id]

Configure via CC-Switch

  1. Run CC-Switch and click on “Add Provider”.
Cc 1
  1. Select “AiHubMix” from the preset list.
Cc 2
  1. Enter your key in the “API Key” field.
Cc 3
  1. Once configured, click “Add” to save the settings.
Cc 4
  1. Return to the homepage, select “AiHubMix” from the provider list, and click “Start” to use it.
Cc 5

Frequently Asked Questions

Q: Using Claude Code, I see the prompt “401, No token provided…”

Open the Claude terminal, type /config, find the Use custom API key option, and check if the Token is correctly configured. install

More Resources

Happy coding!