---
title: &quot;在爱马仕 (Hermes Agent) 中使用 RunAPI — 自定义端点配置指南&quot;
url: &quot;https://runapi.ai/zh-CN/hermes-agent.md&quot;
canonical: &quot;https://runapi.ai/zh-CN/hermes-agent&quot;
locale: &quot;zh-CN&quot;
---

# RunAPI in Hermes Agent

Hermes Agent 可以使用自定义 OpenAI 兼容端点调用聊天模型。把 prompt 复制进 Hermes Agent，让它创建 custom provider；需要精确 YAML 时再看配置 tab。

## 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. **粘贴 setup prompt** — 复制第一个 tab 里的 prompt 给 Hermes Agent。它会要求 Hermes Agent 读取 RUNAPI_API_KEY，并把 RunAPI 添加为命名 custom provider。
2. **核对生成的配置** — Hermes Agent 应该把 provider 设为 custom:runapi，default 设为 gpt-5.2，并用 key_env 指向 RUNAPI_API_KEY。
3. **运行诊断** — 编辑配置后运行 hermes doctor，然后打开 Hermes Agent 并发送一条短测试提示，再用于更大的任务。

## FAQ

### Hermes Agent 可以把 RunAPI 作为自定义端点使用吗？

可以。Hermes Agent 支持模型选择和自定义端点。为命名 custom provider 配置 RunAPI 的 /v1 base URL，把 API key 放进 RUNAPI_API_KEY，并选择 gpt-5.2 这样的 RunAPI 模型。

### 应该用 hermes model，还是直接编辑配置文件？

想走引导式选择时用 hermes model。需要服务器或共享环境中的可重复配置时，直接编辑配置文件。两种方式都建议之后运行 hermes doctor 验证。

### Hermes Agent 的 RUNAPI_API_KEY 应该在哪里设置？

把 RUNAPI_API_KEY 设置在启动 Hermes Agent 的同一个 shell、service unit 或 gateway 环境中。GUI 或 daemon 启动时不一定继承交互式 shell 变量。

### 添加 RunAPI 后 Hermes Agent 还能用其他 provider 吗？

可以。把 RunAPI 加为 custom:runapi 不会移除其他 Hermes Agent 模型选项。需要切换模型时使用 hermes model 或 /model 命令。


## Links

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