Documentation Index
Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
Use this file to discover all available pages before exploring further.
- 由於 Claude Code 的多智能體屬性,額度消耗會比較誇張,建議為你的 Key 設置有限額度,防止帳單刺客。
- 使用時請確保已關閉本地 VPN,否則可能會遇到 GPT-5 延遲的情況。
快速配置指引
1️⃣ 全域安裝 npm 套件
使用終端運行:
npm install -g @aihubmix/claude-code@latest
2️⃣ 設置系統環境變數(推薦)
注意 sk-*** 要換成你在 AiHubMix 生成的密鑰,模型以外的配置項會以系統環境變數優先的順序處理。
export AIHUBMIX_API_KEY="sk-***"
export HOST="127.0.0.1" # 可選
export PORT="3456" # 可選
export LOG="true" # 可選
export API_TIMEOUT_MS="30000" # 可選
- 對於 Mac 用戶,你可以在
用戶名目錄通過快捷鍵 ⌘ + ⇧ + . 顯示隱藏的 .zshrc 檔案,用系統的「文字編輯」APP 開啟並添加上述內容。
- 添加配置之後,終端執行
source ~/.zshrc,回車,使配置生效
3️⃣ 生成配置檔案
將下方的 sk-*** 替換成你的 AiHubMix 密鑰,然後使用終端一鍵運行即可:
mkdir -p ~/.aihubmix-claude-code && cat > ~/.aihubmix-claude-code/config.json <<EOF
{
"API_KEY": "sk-***",
"HOST": "127.0.0.1",
"PORT": 3456,
"LOG": true,
"API_TIMEOUT_MS": 30000,
"Router": {
"default": "gpt-5",
"background": "claude-3-5-haiku-20241022",
"think": "gpt-5",
"longContext": "gpt-5",
"longContextThreshold": 60000,
"webSearch": "gemini-2.0-flash-search"
}
}
EOF
4️⃣ 使用
更多資源