---
title: 如何為 Hermes Agent 新增自訂供應商（2026）
description: >-
  將 Hermes Agent 連線至任何 OpenAI 相容供應商，包括 MiniMax、DeepSeek、Gemini、Grok、OpenAI 或
  haimaker.ai。內含 Base URL、API 金鑰與逾時問題的解決方式。
date: 2026-05-11T00:00:00.000Z
updatedDate: 2026-06-26T00:00:00.000Z
location: 'San Francisco, CA – 2026 年 5 月 11 日'
image: /images/hermes-custom-provider-setup-hero.jpg
keywords: >-
  hermes agent 自訂供應商, hermes agent 供應商設定, hermes agent api 金鑰, hermes agent
  minimax 供應商設定, hermes agent gemini api, hermes agent deepseek 設定, hermes agent
  grok api, hermes 自訂端點, hermes agent openai 相容 api
faq:
  - question: 如何為 Hermes Agent 新增自訂供應商？
    answer: >-
      在終端機執行 `hermes model`，選擇「Custom endpoint（自訂端點）」，然後輸入三項內容：供應商的 Base URL（以
      /v1 結尾）、你的 API 金鑰，以及模型識別碼。Hermes 會儲存此設定，之後每次執行都會沿用。任何提供 OpenAI 相容
      /v1/chat/completions 端點的供應商都能使用，包括
      MiniMax、DeepSeek、Google、xAI、OpenAI、OpenRouter、本機 Ollama 實例，或
      haimaker.ai。如果使用 haimaker.ai，只要執行 npx -y @haimaker/connect --hermes
      即可一鍵完成設定。
  - question: Hermes Agent 需要什麼 Base URL？
    answer: >-
      Hermes 需要的是 OpenAI 相容的根路徑，而非完整的 chat-completions 路徑。haimaker 使用
      https://api.haimaker.ai/v1，MiniMax，MiniMax；MiniMax，MiniMax 使用
      https://api.minimax.io/v1，DeepSeek，DeepSeek；DeepSeek，DeepSeek 使用
      https://api.deepseek.com/v1，Gemini，Gemini；Gemini，Gemini 的 OpenAI 相容層使用
      https://generativelanguage.googleapis.com/v1beta/openai，xAI，xAI；xAI，xAI
      Grok 使用 https://api.x.ai/v1，OpenAI，OpenAI；OpenAI，OpenAI 使用
      https://api.openai.com/v1，Ollama，Ollama；Ollama，Ollama 則使用
      http://localhost:11434/v1。Hermes。Hermes。Hermes。Hermes 會自行附加
      /chat/completions。
  - question: 為什麼我的 Hermes 自訂供應商會逾時？
    answer: >-
      在較慢的供應商上執行較長的代理步驟，可能會超過 Hermes 預設的讀取逾時時間。啟動 Hermes 前，請先將
      HERMES_STREAM_READ_TIMEOUT 環境變數（單位：秒）調高，並確認你的 Base URL 以 /v1
      結尾、沒有尾端斜線。如果出現 401 而非逾時，代表 API 金鑰未生效，請重新執行 `hermes model` 並重新輸入。
locale: zh-tw
translationKey: hermes-custom-provider-setup
---
Hermes Agent 內建的供應商不多，但真正的彈性在於 **Custom endpoint（自訂端點）** 選項：任何支援 OpenAI chat-completions 格式的服務，只要填入 Base URL、金鑰與模型名稱就能接入。這包括 MiniMax、DeepSeek、Google Gemini、xAI Grok、OpenAI、OpenRouter、私有 vLLM 伺服器、本機 Ollama 實例，而 [haimaker.ai](https://haimaker.ai) 可以一次涵蓋上述所有服務。

以下先說明一般設定方法，再逐一列出最常被詢問的供應商設定值。

## 一般設定方法

在 Hermes 中設定自訂供應商的流程都一樣：

```bash
hermes model
```

1. 從選單中選擇 **Custom endpoint（自訂端點）**。
2. 輸入 **Base URL**，也就是 OpenAI 相容的根路徑，以 `/v1` 結尾（Hermes 會自行附加 `/chat/completions`）。
3. 輸入該供應商的 **API 金鑰**。
4. 輸入供應商要求的**模型識別碼**。

Hermes 會儲存此設定，之後每次執行都會沿用。想更改供應商時，再執行一次 `hermes model` 即可。設定流程就是這樣，本文後續只是提供各家的正確設定值。

模型要在 Hermes 中正常運作，必須能正確處理工具 schema，並具備足夠的上下文長度供代理迴圈使用；建議至少要有約 64K 的可用上下文。實際該選哪個模型，請參考 [Hermes Agent 最佳模型](/blog/best-models-for-hermes/)。

## haimaker.ai — 一組金鑰存取所有模型

不必為每個供應商分別管理帳號、金鑰與 Base URL，只要將 Hermes 指向 haimaker.ai 一次，之後修改一個字串就能切換模型。最快的設定方式是用一行指令完成：

```bash
export HAIMAKER_API_KEY=your-haimaker-key
npx -y @haimaker/connect --hermes
```

[`@haimaker/connect`](/connect) 會寫入 Hermes 的自訂端點設定並驗證金鑰，驗證後即結束。加上 `--model` 可指定固定模型，加上 `--pick-model` 則可互動式選擇模型；執行 `npx @haimaker/connect --uninstall --hermes` 即可還原設定。請先到 [app.haimaker.ai](https://app.haimaker.ai/sign-up) 取得金鑰；新帳號附有免費額度。

如果你偏好內建的 `hermes model` 流程，請在系統詢問時輸入以下內容：

- **Base URL：** `https://api.haimaker.ai/v1`
- **API 金鑰：** 你的 haimaker.ai 金鑰
- **模型：** 任何支援的模型，例如 `anthropic/claude-sonnet-4-6`、`openai/gpt-5-4-codex`、`google/gemini-3-1-pro`、`minimax/minimax-m2-5`、`deepseek/deepseek-v3-2`、`xai/grok-4-1-fast`、`zai/glm-4-7`、`moonshot/kimi-k2-5`

模型費用約比市場行情低 5%，而且只需要管理一個帳單帳戶。

## 在 Hermes 中使用 MiniMax

MiniMax M2.5 是 Hermes 中最受歡迎的平價選擇，便宜到可以持續運作，能力也足以處理工具呼叫迴圈。

- **Base URL：** `https://api.minimax.io/v1`
- **API 金鑰：** 從 MiniMax 平台主控台取得
- **模型：** `MiniMax-M2.5`（請使用 MiniMax 主控台顯示的精確 ID，大小寫必須完全一致）

或透過 haimaker.ai 使用模型 `minimax/minimax-m2-5`，即可省去另外註冊帳號。

## 在 Hermes 中使用 Google Gemini

Gemini 提供 OpenAI 相容層，因此可以直接當作 Hermes 的自訂端點使用。

- **Base URL：** `https://generativelanguage.googleapis.com/v1beta/openai`
- **API 金鑰：** 你的 Google AI Studio 金鑰
- **模型：** `gemini-3-flash` 適合成本低、速度快的工作；`gemini-3.1-pro` 適合長上下文研究

沒錯，Hermes Agent 就是以這種方式支援 Google Gemini，不需要另外啟用 Gemini 整合，它只是個自訂端點。也可以透過 haimaker.ai 使用 `google/gemini-3-1-pro`。

## 在 Hermes 中使用 DeepSeek

- **Base URL：** `https://api.deepseek.com/v1`
- **API 金鑰：** 從 DeepSeek 平台取得
- **模型：** `deepseek-chat`（指向目前的 V3.2 系列）或 `deepseek-reasoner`

透過 haimaker.ai 使用：`deepseek/deepseek-v3-2`。

## 在 Hermes 中使用 xAI Grok

- **Base URL：** `https://api.x.ai/v1`
- **API 金鑰：** 從 xAI 主控台取得
- **模型：** `grok-4.1-fast` 適合成本低、大上下文的工作；`grok-code-fast` 適合程式碼相關任務

透過 haimaker.ai 使用：`xai/grok-4-1-fast`。

## 在 Hermes 中使用 OpenAI / Codex 模型

如果你想在 Hermes 中使用 OpenAI 自家的模型（包括 Codex 系列）：

- **Base URL：** `https://api.openai.com/v1`
- **API 金鑰：** OpenAI 的 **API** 金鑰（ChatGPT Plus 訂閱不包含 API 存取權限；你需要另外一組已啟用帳單功能的 API 金鑰）
- **模型：** `gpt-5.4-codex` 適合撰寫程式，`gpt-5.4` 適合一般工作

透過 haimaker.ai 使用：`openai/gpt-5-4-codex`。

## 透過 Ollama 使用本機模型

- **Base URL：** `http://localhost:11434/v1`
- **API 金鑰：** 任何非空字串皆可（Ollama 會忽略，但 Hermes 要求必填）
- **模型：** `gemma4:latest`、`qwen3.5:latest`，或任何你已拉取的模型

```bash
ollama pull gemma4
hermes model   # Custom endpoint → base URL above → model gemma4:latest
```

## 常見問題

- **長步驟逾時。** 供應商速度較慢時，較長的代理回合可能超過 Hermes 預設的串流讀取逾時。啟動 Hermes 前，先將 `HERMES_STREAM_READ_TIMEOUT`（單位：秒）調高。
- **401 / 身分驗證錯誤。** 金鑰未生效，或你誤貼了主控台/工作階段權杖而非 API 金鑰。請重新執行 `hermes model` 並重新輸入。
- **請求出現 404。** 你的 Base URL 可能已包含 `/chat/completions`，或結尾多了斜線。Hermes 會自行附加路徑，URL 只寫到 `/v1` 即可。
- **工具呼叫反覆失敗。** 通常是模型本身的問題，不是設定問題。小型模型在工具 schema 上容易偏移；請改用更高一級的模型。

## 取得你的 haimaker.ai 金鑰

新帳號可獲得免費額度供測試。你可以在 [haimaker.ai](https://haimaker.ai) 瀏覽所有支援的模型、即時價格與效能評測，然後執行 `npx -y @haimaker/connect --hermes` 將 Hermes 指向該服務。

<a href="https://app.haimaker.ai/sign-up?utm_source=hermes_blog&utm_medium=cta&utm_campaign=hermes_custom_provider" class="cta-button">在 HAIMAKER 領取 $10 免費額度</a>

---

*相關文章：[Hermes Agent 最佳模型](/blog/best-models-for-hermes/) · [Hermes Agent 定價](/blog/hermes-api-costs-pricing/) · [Hermes Agent vs Codex CLI](/blog/hermes-vs-codex/)*
