管理 API 密钥,允许大模型通过 API 访问和管理文件。
所有请求需在 Header 中携带 Authorization: Bearer YOUR_API_KEY
GET
/api/files
列出文件和文件夹,支持分页、搜索和筛选
GET /api/files?path=/documents&search=报告
Authorization: Bearer fh_sk_xxx
POST
/api/files
创建新文件或文件夹
POST /api/files
{ "name": "笔记.md", "path": "/docs/", "content": "# 标题" }
PUT
/api/files/:id
修改文件内容、重命名或移动文件
DELETE
/api/files/:id
删除文件或文件夹(移入回收站)
POST
/api/files/organize
根据规则批量整理文件(AI 专用接口)
POST /api/files/organize
{
"scope": "/downloads",
"rules": [
{
"condition": { "extension": ["jpg","png"] },
"action": { "move_to": "/images/{year}/{month}" }
}
],
"dry_run": false
}