跳轉到主要內容

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.

安裝

安裝前請確認 Node >= 22。
執行安裝指令
npm install -g openclaw@latest

終端機設定

開啟終端機並執行下列指令以啟動設定
openclaw onboard
選擇 Yes Oc 1 選擇 QuickStart Oc 2 選擇 Skip for now Oc 3 選擇 All providers Oc 4 依需求選擇預設模型;您可以先選擇 Keep current,後續步驟可在設定檔中修改。 Oc 5 依需求連結您的個人帳戶;如不需要,請選擇 Skip for now Oc 6 設定技能時請選擇 Yes Oc 7 選擇 npm Oc 8 依需求設定技能選擇。 Oc 9 所有選項皆選擇 No Oc 10 選擇 Skip for now Oc 11 選擇 Hatch in UI

設定 AIHubMix

方法 1:透過外掛快速設定(推薦)

外掛原始碼:aihubmix-auth
安裝 AIHubMix auth 外掛並重新啟動 Gateway:
openclaw plugins install @akaknele/aihubmix-auth
openclaw gateway restart
執行 auth 指令。在提示時輸入您的 AIHubMix API Key。外掛會自動同步可用模型,並將 AIHubMix 設為預設供應商:
openclaw models auth login --provider aihubmix --method api-key --set-default
外掛會將模型分為以下群組:
  • openai — OpenAI 模型
  • anthropic — Anthropic 模型
  • google — Google 模型
  • other — 其他模型
設定完成後,跳轉至啟動區段即可開始使用。

方法 2:手動設定

開啟 ~/.openclaw/openclaw.json 檔案並加入下列設定:
{
  "models": {
    "mode": "merge",
    "providers": {
      "aihubmix": {
        "baseUrl": "http://aihubmix.com/v1",
        "apiKey": "AIHUBMIX_API_KEY",
        "api": "openai-completions",
        "models": [
          {
            "id": "claude-sonnet-4-5",
            "name": "claude-sonnet-4-5",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 1000000,
            "maxTokens": 64000
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "aihubmix/claude-sonnet-4-5"
      },
      "workspace": "your_workspace_path",
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  }
}

啟動

openclaw gateway

測試

在聊天頁面輸入 hello;若收到回覆,即代表設定成功。 Oc 12

常見問題

版本升級

npm update -g openclaw-aihubmix

Gateway 處理程序被佔用

openclaw gateway stop
openclaw gateway

最後更新:2026-06-01