Update nexus wiki content

This commit is contained in:
2026-05-03 05:42:06 +08:00
parent 90f3811b83
commit 111bc65b7b
707 changed files with 32306 additions and 7289 deletions

View File

@@ -0,0 +1,36 @@
---
title: "OpenAI兼容API"
type: concept
tags: []
last_updated: 2026-05-02
---
## Definition
Hermes Agent 内置的 API Server 暴露的标准 OpenAI Chat Completions 接口格式,允许任何兼容 OpenAI API 的客户端(如 n8n、curl、Postman直接调用无需额外 SDK 或中间件。
## Details
- 默认端口 **8642**,端点路径 `/v1/chat/completions`
- 认证方式Bearer Token通过 `API_SERVER_KEY` 配置)
- 健康检查端点:`GET /v1/health`,返回 `{"status": "ok"}`
- 支持 `X-Hermes-Session-Id` header 实现会话保持v0.7.0+
- 模型名称默认为 `hermes-agent`,可在 Profile 级别自定义
## Usage
- [[n8n]] 的 HTTP Request 节点通过 POST 到该端点实现 Agent 调用
- curl 验证命令:
```bash
curl http://localhost:8642/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "hermes-agent", "messages": [{"role": "user", "content": "Hello!"}]}'
```
## Related
- [[HermesAgent]] — API Server 的宿主框架
- [[X-Hermes-Session-Id]] — API 的会话保持机制
- [[工作流编排]] — 该 API 的主要应用场景
## Aliases
- OpenAI Compatible API
- OpenAI-compatible API endpoint
- Hermes API Server