# 在 AnyRouter 上运行 Hermes Agent

> 安装 AnyRouter 官方的 Hermes Agent 插件，加一把 key，就能从支持工具调用的模型里挑选，包括自动回退的 anyrouter/hermes 元模型。

- Date: November 9, 2026
- Category: guides
- HTML: https://anyrouter.dev/blog/zh/hermes-agent-anyrouter

## 你将搭建什么

[Hermes Agent](https://hermes-agent.nousresearch.com) 是 Nous Research 的终端编程智能体。[Hermes 插件市场](https://hermes-agent.nousresearch.com/marketplace/anyrouter)上列出的 AnyRouter 官方 provider 插件，用一把 key 就能把它接到任意 AnyRouter 模型。

`/model` 选择器只列出支持工具调用的路由，数据实时读自模型目录，因此 agent 循环不会断在一个不能用工具的模型上。`anyrouter/hermes` 是 AnyRouter 自有的路由元模型，不是 Nous 的模型：它把每个请求发给当下最好的工具调用模型并自动回退。计费按底层模型的费率。

## 1. 安装插件

在终端里从市场目录安装插件：

```bash
hermes plugins install anyrouter
hermes plugins list
```

`hermes plugins list` 应能看到 `anyrouter` 已启用。想点按钮？[市场页面](https://hermes-agent.nousresearch.com/marketplace/anyrouter)有 Install in Hermes，[插件源码](https://github.com/AnyRouterHQ/hermes-provider-anyrouter)在 GitHub 上。

## 2. 添加你的 key

在 [anyrouter.dev](https://anyrouter.dev) 开一把 key，以 `sk-ar-` 开头。写入 `~/.hermes/.env`：

```bash
ANYROUTER_API_KEY=sk-ar-your-anyrouter-key
```

同一把 key 也能直接用于 OpenAI 兼容端点 `https://anyrouter.dev/api/v1`，所以你也可以用任意 OpenAI 客户端驱动 Hermes。

## 3. 选择模型

用 `hermes model` 交互式选择 `anyrouter`，或按单次运行指定：

```bash
hermes --provider anyrouter -m anyrouter/hermes
```

| 模型 | 说明 |
| --- | --- |
| `anyrouter/hermes` | 最强的工具调用模型，自动回退。智能体默认之选。 |
| `anyrouter/auto` | 平台热门模型。工具可选，不适合 agent 循环。 |
| `anyrouter/latest` | 最新稳定版聊天模型。 |
| `moonshotai/kimi-k3` | 100 万上下文，agentic。 |
| `deepseek/deepseek-v4-flash` | 快，支持推理。 |

选择器实时读取模型列表，新的工具调用路由不需要更新插件就会出现。会话中用 `/model` 切换，这会重置 prompt cache。

## 4. 检查是否可用

`hermes plugins list` 显示 `anyrouter` 已启用，你下一条 `hermes chat` 消息会出现在 [请求日志](https://anyrouter.dev/dashboard/logs)里。如果选择器是空的，说明 key 缺失或错误，重新检查 `~/.hermes/.env` 里的 `ANYROUTER_API_KEY`。

## 可选设置

在 `~/.hermes/.env` 里设置：

- `ANYROUTER_BASE_URL`，覆盖 `https://anyrouter.dev/api/v1`（代理或中继）。设置后选择器不再按工具支持过滤。
- `ANYROUTER_APP_ATTRIBUTION=1`，在公开应用排行榜里给 Hermes 流量记功。默认关闭。
- Hermes 会把 `provider_routing` 块作为 `extra_body.provider` 转发，`sort: price | throughput | latency`，以及 `only` / `ignore` / `data_collection: deny`。见 [Provider Routing](https://anyrouter.dev/docs/guides/provider-routing)。
- MCP 配置、故障排查和完整的 `provider_routing` 参考，见 [Hermes Agent 指南](https://anyrouter.dev/docs/guides/hermes-agent)。

本页全部内容，清单形式：Hermes Agent 用例页。

[打开用例页](https://anyrouter.dev/use-cases/hermes-agent)
