1023 B
1023 B
title, type, tags
| title | type | tags |
|---|---|---|
| OpenAI-Compatible-API | concept |
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:
{ "model": "openclaw:main", "messages": [{"role": "user", "content": "..."}] }
Related
- OpenClaw 通过
gateway.http.endpoints.chatCompletions.enabled: true提供此接口 - HTTP-ChatCompletions 是其底层协议
- n8n 通过 HTTP Request 节点调用此接口