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,30 @@
---
title: "OpenAI-Compatible-API"
type: concept
tags: []
---
## Definition
OpenAI 兼容 API 是一种标准化的 AI 模型调用接口规范,遵循 OpenAI Chat Completions API 的请求/响应格式,使第三方 AI 系统能够被标准 AI 工具(如 n8n、LangChain无缝调用。
## Key Properties
- **请求格式**:遵循 OpenAI `chat/completions` 规范
- **模型指定**:通过 `model` 字段指定具体的 Agent`openclaw:main`
- **认证方式**Bearer Token`Authorization: Bearer <token>`
- **端点**:通常是 `/v1/chat/completions`
## Example
OpenClaw Gateway 提供的 OpenAI 兼容端点:
- **URL**`http://<host>:18789/v1/chat/completions`
- **Body**
```json
{
"model": "openclaw:main",
"messages": [{"role": "user", "content": "..."}]
}
```
## Related
- [[OpenClaw]] 通过 `gateway.http.endpoints.chatCompletions.enabled: true` 提供此接口
- [[HTTP-ChatCompletions]] 是其底层协议
- [[n8n]] 通过 HTTP Request 节点调用此接口