> ## Documentation Index
> Fetch the complete documentation index at: https://evo-0136956d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 接入 Hermes

> 通过 Hermes Agent 的模型配置接入 Nusabase API。

Hermes Agent 支持通过 `hermes model` 或 `hermes setup` 选择模型 Provider。Nusabase 可按 OpenAI 兼容或 Anthropic 兼容方式接入。

## 适用场景

* 你希望使用 Hermes 的长期记忆、技能沉淀和工具能力。
* 你希望模型请求统一走 Nusabase API。
* 你需要在 Hermes 中切换不同 Provider 或模型。

## 前置条件

* 已准备 Nusabase API Key：`sk-...`。
* 当前网络可访问 `https://api.nusabase.com`。
* 示例模型 `qwen3.5-flash` 来自当前价格文档；实际以 `/v1/models` 返回为准。

## 安装 Hermes

Linux / macOS / WSL2：

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
```

Windows 用户可以在 WSL2 中运行同一个安装脚本。除非 Hermes Agent 项目明确提供 PowerShell 地址，否则不要使用自行推测的 PowerShell 安装链接。

安装后重新加载 shell，并检查命令：

```bash theme={null}
hermes --version
```

## 配置模型

执行：

```bash theme={null}
hermes model
```

或首次完整配置：

```bash theme={null}
hermes setup
```

按 Hermes 界面填写：

| 配置项 | 推荐值 |
| - | - |
| Provider | 选择 `OpenAI Compatible` / `Custom`，或任何允许修改 Base URL 的 Provider。 |
| OpenAI 兼容 Base URL | `https://api.nusabase.com/v1` |
| Anthropic 兼容 Base URL | `https://api.nusabase.com` |
| API Key | `sk-你的_api_key` |
| Model | `qwen3.5-flash`，或 `/v1/models` 返回的真实模型名。 |

> [!WARNING]
>
> OpenAI 兼容配置使用 `/v1` Base URL；Anthropic 兼容配置使用根地址，让工具拼接 `/v1/messages`。不要把其他平台官方 API 地址直接填进 Hermes。

## 验证 Nusabase 接口

```bash theme={null}
curl https://api.nusabase.com/v1/models \
  -H "Authorization: Bearer sk-你的_api_key"
```

```bash theme={null}
curl https://api.nusabase.com/v1/chat/completions \
  -H "Authorization: Bearer sk-你的_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.5-flash",
    "messages": [{"role": "user", "content": "hello"}],
    "stream": false
  }'
```

## 启动 Hermes

```bash theme={null}
hermes
```

发送测试提示：

```text theme={null}
请阅读当前项目结构，并给出三条改进建议。
```

## 常见问题

| 问题 | 可能原因 | 处理方式 |
| - | - | - |
| Provider 不支持自定义 Base URL | 选择了固定官方 Provider | 改选 OpenAI Compatible / Custom Provider。 |
| `401` | API Key 无效或未保存 | 重新执行 `hermes model` 或 `hermes setup`。 |
| `404` | 模型名或 Base URL 错误 | 先查 `/v1/models`，OpenAI 兼容 Base URL 填 `/v1`。 |
| Anthropic 模式请求失败 | Base URL 写成了 `/v1` | Anthropic 兼容模式填根地址 `https://api.nusabase.com`。 |

下一步可查看 [首个请求示例](https://evo-0136956d.mintlify.site/zh/getting-started/first-request.md)。

## 参考资料

* [Hermes Agent 文档](https://hermes-agent.nousresearch.com/docs/)
* [Hermes Agent GitHub](https://github.com/NousResearch/hermes-agent)
* [Hermes Agent 快速开始](https://github.com/NousResearch/hermes-agent/blob/main/website/docs/getting-started/quickstart.md)
* [首个请求示例](https://evo-0136956d.mintlify.site/zh/getting-started/first-request.md)
* [错误码](https://evo-0136956d.mintlify.site/zh/getting-started/error-codes.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.