---
title: &quot;在 Hermes Agent 使用 RunAPI — 自訂 Endpoint 設定指南&quot;
url: &quot;https://runapi.ai/zh-HK/hermes-agent.md&quot;
canonical: &quot;https://runapi.ai/zh-HK/hermes-agent&quot;
locale: &quot;zh-HK&quot;
---

# RunAPI in Hermes Agent

Hermes Agent 可使用自訂 OpenAI 相容 endpoint 來處理 chat models。將 prompt 複製到 Hermes Agent，讓它建立自訂 provider；只有當你需要精確的 YAML 時，才用 config 分頁。

## Install prompt

Copy this prompt into Hermes Agent:

```text
Configure this Hermes Agent install to use RunAPI.

Requirements:
- Read the API key from RUNAPI_API_KEY. Do not hardcode the key.
- Add a custom provider named runapi.
- Use base_url &quot;https://runapi.ai/v1&quot;.
- Use key_env RUNAPI_API_KEY.
- Use api_mode chat_completions.
- Set model.provider to custom:runapi.
- Set the default model to gpt-5.5.
- Run `hermes doctor` and report any config problems before starting a session.
- If RUNAPI_API_KEY is missing, ask me to set it before starting Hermes Agent.
```

## Configuration

```yaml
custom_providers:
  - name: runapi
    base_url: "https://runapi.ai/v1"
    key_env: RUNAPI_API_KEY
    api_mode: chat_completions

model:
  provider: custom:runapi
  default: gpt-5.5
```

## Steps

1. **貼上設定 prompt** — 將第一個分頁的 prompt 複製到 Hermes Agent。它會指示 Hermes Agent 讀取 RUNAPI_API_KEY，並將 RunAPI 加入為具名的自訂 provider。
2. **檢視生成的 config** — Hermes Agent 應將 provider 設為 custom:runapi，並預設為 gpt-5.2，同時將 key_env 指向 RUNAPI_API_KEY。
3. **執行診斷** — 編輯 config 後先執行 hermes doctor，然後開啟 Hermes Agent，送出一個簡短測試 prompt，之後再用於較大型任務。

## FAQ

### Hermes Agent 可以將 RunAPI 用作自訂 endpoint 嗎？

可以。Hermes Agent 支援模型選擇和自訂 endpoint。請將具名的自訂 provider 設定為使用 RunAPI /v1 base URL，將 API key 保留在 RUNAPI_API_KEY，並選擇例如 gpt-5.2 的 RunAPI model。

### 應該用 hermes model，還是直接編輯 config file？

當你想用引導式選擇器時，請使用 hermes model。當你需要可重複套用到 server 或共享環境的設定時，請編輯 config file。無論哪種方式，之後都應以 hermes doctor 驗證。

### Hermes Agent 的 RUNAPI_API_KEY 應該設定在哪裡？

請在啟動 Hermes Agent 的同一個 shell、service unit 或 gateway 環境中設定 RUNAPI_API_KEY。GUI 或 daemon 啟動方式不一定會繼承你互動式 shell 的變數。

### 加入 RunAPI 後，Hermes Agent 還可以使用其他 provider 嗎？

可以。將 RunAPI 加入為 custom:runapi 不會移除其他 Hermes Agent 模型選項。當你要在已設定的模型之間切換時，請使用 hermes model 或 /model 指令。


## Links

- [Model catalog](https://runapi.ai/zh-HK/models)
- [CLI](https://runapi.ai/zh-HK/cli)
- [MCP Server](https://runapi.ai/zh-HK/mcp)
- [Pricing](https://runapi.ai/zh-HK/pricing)
- [API docs](https://runapi.ai/zh-HK/docs)
- [OpenClaw setup](https://runapi.ai/zh-HK/openclaw)
