Skip to content

API 参考(自动生成)

本文档由共享查询契约 @halfway/atlas-core/runtime 自动生成,与 GET /api/atlas/v1/openapi.json 同源。

端点总览

方法路径说明鉴权
GET/api/atlas/v1/ready就绪检查(公开)公开
GET/api/atlas/v1/openapi.jsonOpenAPI 文档(公开)公开
GET/api/atlas/v1/stats知识包统计Bearer
GET/api/atlas/v1/lookup精确查找Bearer
POST/api/atlas/v1/search全文检索Bearer
POST/api/atlas/v1/graph实体邻域图谱Bearer
GET/api/atlas/v1/admin/billing月度账单(管理)Bearer
GET/api/atlas/v1/admin/usage用量报表(管理)Bearer
POST/api/atlas/v1/admin/reload触发热更新(管理)Bearer

鉴权

GET /api/atlas/v1/readyGET /api/atlas/v1/openapi.json 外,所有端点需请求头携带:

http
Authorization: Bearer <API_KEY>

Schema

AtlasError

json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "example": "UNAUTHORIZED"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}

AtlasEntityKind

json
{
  "type": "string",
  "enum": [
    "person",
    "work",
    "place",
    "organization",
    "movement",
    "concept",
    "source"
  ]
}

AtlasSearchRequest

json
{
  "type": "object",
  "required": [
    "q"
  ],
  "properties": {
    "q": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "安藤忠雄"
    },
    "scope": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AtlasEntityKind"
      }
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 20
    }
  }
}

AtlasSearchHit

json
{
  "type": "object",
  "required": [
    "id",
    "kind",
    "displayName",
    "slug",
    "score"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "kind": {
      "$ref": "#/components/schemas/AtlasEntityKind"
    },
    "displayName": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "score": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "matchedField": {
      "type": "string"
    }
  }
}

AtlasSearchResponse

json
{
  "type": "object",
  "required": [
    "q",
    "count",
    "hits"
  ],
  "properties": {
    "q": {
      "type": "string"
    },
    "count": {
      "type": "integer"
    },
    "hits": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AtlasSearchHit"
      }
    }
  }
}

AtlasGraphRequest

json
{
  "type": "object",
  "required": [
    "rootId"
  ],
  "properties": {
    "rootId": {
      "type": "string",
      "example": "per_tadao-ando"
    },
    "maxDepth": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5,
      "default": 2
    },
    "maxNodes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 40
    }
  }
}

AtlasGraphNode

json
{
  "type": "object",
  "required": [
    "id",
    "label",
    "kind",
    "group"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "group": {
      "type": "string"
    },
    "description": {
      "type": "string"
    }
  }
}

AtlasGraphEdge

json
{
  "type": "object",
  "required": [
    "id",
    "source",
    "target",
    "label",
    "type",
    "confidence"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "target": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "confidence": {
      "type": "number"
    }
  }
}

AtlasGraphResponse

json
{
  "type": "object",
  "required": [
    "rootId",
    "nodes",
    "edges",
    "truncated"
  ],
  "properties": {
    "rootId": {
      "type": "string"
    },
    "nodes": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AtlasGraphNode"
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AtlasGraphEdge"
      }
    },
    "truncated": {
      "type": "boolean"
    }
  }
}

AtlasLookupResult

json
{
  "type": "object",
  "required": [
    "kind",
    "id",
    "data"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "entity",
        "relationship",
        "evidence"
      ]
    },
    "id": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "additionalProperties": true
    }
  }
}

AtlasManifest

json
{
  "type": "object",
  "required": [
    "counts",
    "releasedEntityIds",
    "filter",
    "governance"
  ],
  "properties": {
    "counts": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    },
    "releasedEntityIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "filter": {
      "type": "object",
      "properties": {
        "visibility": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "governance": {
      "type": "object",
      "properties": {
        "totalEntities": {
          "type": "integer"
        },
        "published": {
          "type": "integer"
        },
        "withSources": {
          "type": "integer"
        },
        "reviewed": {
          "type": "integer"
        },
        "aiCandidateRelationships": {
          "type": "integer"
        },
        "relationshipsSkippedMissingEndpoint": {
          "type": "integer"
        }
      }
    }
  }
}

AtlasStatsResponse

json
{
  "type": "object",
  "required": [
    "version",
    "manifest"
  ],
  "properties": {
    "version": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "packId": {
          "type": "string"
        },
        "releasedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "manifest": {
      "$ref": "#/components/schemas/AtlasManifest"
    }
  }
}

AtlasReadyResponse

json
{
  "type": "object",
  "required": [
    "ok",
    "service",
    "version"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "service": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "packId": {
      "type": "string"
    },
    "packName": {
      "type": "string"
    },
    "channel": {
      "type": "string"
    },
    "releasedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}

设计图谱知识库 · Halfway Lab