Files
deer-flow/frontend/src/content/zh/reference/api-gateway-reference.mdx
T

69 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Callout } from "nextra/components";
# API / Gateway 参考
<Callout type="info">
DeerFlow Gateway 是基于 FastAPI 构建的,提供交互式 API 文档,可通过 <code>http://localhost:8001/docs</code> 访问。
</Callout>
## 基础 URL
```
http://localhost:8001
```
通过 nginx 代理:
```
http://localhost:2026/api
```
## 核心端点
### 系统
| 方法 | 路径 | 描述 |
|---|---|---|
| `GET` | `/health` | 服务健康检查 |
| `GET` | `/api/models` | 获取已配置的模型列表 |
### Agent 管理
| 方法 | 路径 | 描述 |
|---|---|---|
| `GET` | `/api/agents` | 列出所有 Agent |
| `POST` | `/api/agents` | 创建自定义 Agent |
| `GET` | `/api/agents/{name}` | 获取 Agent 配置 |
| `PUT` | `/api/agents/{name}` | 更新 Agent 配置 |
| `DELETE` | `/api/agents/{name}` | 删除 Agent |
| `POST` | `/api/agents/check` | 检查/建议 Agent slug 唯一性 |
### 线程和记忆
| 方法 | 路径 | 描述 |
|---|---|---|
| `GET` | `/api/threads` | 列出线程 |
| `DELETE` | `/api/threads/{thread_id}` | 删除线程 |
| `GET` | `/api/memory` | 获取全局记忆 |
| `GET` | `/api/memory/{agent_name}` | 获取 Agent 特定记忆 |
| `DELETE` | `/api/memory` | 清除全局记忆 |
### 扩展
| 方法 | 路径 | 描述 |
|---|---|---|
| `GET` | `/api/extensions` | 列出所有扩展(MCP 服务器和技能) |
| `POST` | `/api/extensions/mcp/{name}/enable` | 启用 MCP 服务器 |
| `POST` | `/api/extensions/mcp/{name}/disable` | 禁用 MCP 服务器 |
| `POST` | `/api/extensions/skills/{name}/enable` | 启用技能 |
| `POST` | `/api/extensions/skills/{name}/disable` | 禁用技能 |
### 文件上传
| 方法 | 路径 | 描述 |
|---|---|---|
| `POST` | `/api/uploads/{thread_id}` | 上传文件到线程工作区 |
| `GET` | `/api/uploads/{thread_id}/{filename}` | 获取上传的文件 |
完整的交互式 API 文档请访问 `http://localhost:8001/docs`Swagger UI)。