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

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

macOS, Linux, WSL:
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell:
irm https://claude.ai/install.ps1 | iex

npm

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

2. Connect Claude 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 base_url
  2. Provide the AiHubMix API Key as the authentication token
  3. Tip: Make sure to remove the Anthropic API Key to avoid conflicts.
Claude Configuration File: .claude/settings.json
{
  "env": {
    "ANTHROPIC_API_KEY": "AIHUBMIX_API_KEY",
    "ANTHROPIC_BASE_URL": "https://aihubmix.com",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.2",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.2",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.2",
    "ANTHROPIC_MODEL": "gpt-5.2"
  },
  "includeCoAuthoredBy": false
}
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 a Conversation

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: ANTHROPIC_API_KEY
 Anthropic base URL: https://aihubmix.com

 Model: claude-sonnet-4-5
Don’t want to configure environment variables manually? Use a graphical tool for quick setup: Configure via CC-Switch.

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!