Skip to content

REST API

所有端点前缀 /api/atlas/v1。除 readyopenapi.json 外均需 Authorization: Bearer <API_KEY>

端点总览

方法路径说明鉴权
GET/ready就绪检查 + 包版本公开
GET/openapi.jsonOpenAPI 契约(别名 /openapi.json公开
GET/stats知识包统计Bearer
GET/lookup?id=?slug=精确查找Bearer
POST/search全文检索Bearer
POST/graph实体邻域图谱Bearer
POST/admin/reload触发热更新Bearer
GET/admin/usage用量报表Bearer
GET/admin/billing月度账单Bearer

完整字段契约见 API 参考(自动生成) 或直接拉取 GET /api/atlas/v1/openapi.json(可导入 Postman / Swagger / 代码生成)。

示例

查找

bash
curl "https://atlas.halfwaylab.cn/api/atlas/v1/lookup?id=per_tadao-ando" \
  -H "Authorization: Bearer <API_KEY>"

检索

bash
curl -X POST https://atlas.halfwaylab.cn/api/atlas/v1/search \
  -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" \
  -d '{"q":"清水混凝土","scope":["work"],"limit":3}'

图谱

bash
curl -X POST https://atlas.halfwaylab.cn/api/atlas/v1/graph \
  -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" \
  -d '{"rootId":"per_tadao-ando","maxDepth":1,"maxNodes":10}'

错误格式

json
{ "error": { "code": "UNAUTHORIZED", "message": "missing or invalid API key" } }

设计图谱知识库 · Halfway Lab