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

Local Installation

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

Install via npm

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

2. Configure AIHubMix API

To access AIHubMix’s model services via the compatible Anthropic API, you need to configure the following environment variables.
  1. Set ANTHROPIC_BASE_URL to https://aihubmix.com
  2. Set ANTHROPIC_AUTH_TOKEN to the API Key obtained from the AIHubMix platform
  3. Set ANTHROPIC_MODEL to a supported model from the model list.
  1. Run the following command in the terminal to check your default Shell type.
echo $SHELL
  1. Set the environment variables according to your Shell type using the following commands:
# Replace AIHUBMIX_API_KEY with the Key obtained from the AIHUBMIX platform
echo 'export ANTHROPIC_BASE_URL="https://aihubmix.com"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="AIHUBMIX_API_KEY"' >> ~/.zshrc
echo 'export ANTHROPIC_MODEL="claude-sonnet-4-5"' >> ~/.zshrc
  1. Run the following command in the terminal to make the environment variables effective.
source ~/.zshrc
  1. Open a new terminal and run the following commands to check if the environment variables are effective.
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN
echo $ANTHROPIC_MODEL

3. Get Started

Once the configuration is complete, navigate to your working directory and run the claude command in the terminal to start using Claude Code.
$ cd /path/your-project
> claude
When using Claude Code for the first time, you may be required to log in to your Anthropic account. Please follow these steps to skip that process: Cc 7
  1. Locate the .claude.json file in your user home directory, with the following paths:
    • macOS / Linux: ~/.claude.json
    • Windows: C:\Users\%USERNAME%\.claude.json
  2. Set the hasCompletedOnboarding field’s value to true.
{
  "hasCompletedOnboarding": true
}
  1. Save the file, then rerun claude in the terminal.

(Optional) Additional Model Configuration Methods

Claude Code supports the following model configuration methods, ranked in order of priority from highest to lowest, where higher-priority configurations will override lower-priority ones.
  1. During a conversation: Execute the /model <model_name> command to switch models. This is suitable for temporary model changes.
/model claude-sonnet-4-5
  1. When starting Claude Code: Execute claude --model <model_name> to specify the model. This is suitable for single-session use.
claude --model claude-sonnet-4-5
  1. Set environment variables: You can configure different levels of models based on the complexity of the task. Claude Code will automatically select the appropriate model based on the task type. This is suitable for global effects.
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
Where:
  • ANTHROPIC_DEFAULT_OPUS_MODEL: For complex reasoning, architectural design, and other high-difficulty tasks.
  • ANTHROPIC_DEFAULT_SONNET_MODEL: For coding, feature implementation, and other routine tasks.
  • ANTHROPIC_DEFAULT_HAIKU_MODEL: For grammar checks, file searches, and other simple tasks.
  1. Permanently set in the settings.json configuration file: Create a settings.json file in the project root directory or user home directory, and write the model configuration information for project-level or user-level permanent configuration.
{
  "env": {
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5"
  }
}

Configure via cc-switch

  1. Run CC-Switch and click “Add Vendor.”
Cc 1
  1. Select “AiHubMix” from the preset list.
Cc 2
  1. Fill in your key in the “API Key” field.
Cc 3
  1. After configuration is complete, click “Add” to save the settings.
Cc 4
  1. Return to the homepage, select “AiHubMix” from the vendor list, and click “Start” to use it.
Cc 5

Frequently Asked Questions

Q: When using Claude Code, I receive the message “401, No token provided…”

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

Q: After successfully installing on macOS, I still get an error: zsh: command not found: claude

This is because the Claude CLI is installed, but its executable directory is not added to the system PATH.
  1. Confirm the Claude installation path. The official Claude Code script typically installs in one of the following directories:
  • ~/.claude/bin
  • ~/.local/bin
Run the following command in the terminal:
ls -l ~/.claude/bin
or
ls -l ~/.local/bin | grep claude
If you see the claude file, it means the installation was successful, but the PATH is not configured.
  1. Add the installation directory to the PATH. Execute the corresponding command based on the actual installation location:
Case A: Installed in ~/.claude/bin
echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Case B: Installed in ~/.local/bin
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
  1. Verify if it takes effect. Execute:
which claude
claude -v
If you can see the claude path and version number, the installation was successful.

Q: Claude Code Unable to Connect to Anthropic Services

After upgrading to the latest version of Claude Code, if you encounter issues connecting to Anthropic services or authentication failures, it is typically due to changes in the authentication request header name. The new version requires updating the request header from ANTHROPIC_API_KEY to ANTHROPIC_AUTH_TOKEN. The value of the API Key does not need to be changed; you only need to update the request header name and reload the configuration. For specific instructions, please refer to this document for reconfiguration.

More Resources

Happy coding!