Skip to content

REST API

Source: server/main.py

概述

CatGo 的 Python 服务器提供基于 FastAPI 构建的 REST API,用于程序化访问全部计算与分析功能。

Base URL

http://localhost:8000/api

Endpoints

Structure

MethodPathDescription
POST/structure/parse解析结构文件
POST/structure/optimize运行几何优化
POST/structure/slabGenerate a slab

Electronic

MethodPathDescription
POST/bands能带结构计算
POST/dosDensity of states
POST/cohpCOHP analysis

MD 分析

MethodPathDescription
POST/md/rdf径向分布函数
POST/md/rmsdRMSD computation
POST/md/densityDensity profile
POST/md/hbondsH-bond detection
POST/md/clustering聚类与 PCA

工作流

MethodPathDescription
POST/workflow/createCreate workflow
POST/workflow/runExecute workflow
GET/workflow/{id}获取工作流状态

HPC

MethodPathDescription
POST/hpc/submitSubmit HPC job
GET/hpc/statusCheck job status

Chat

MethodPathDescription
POST/chatSingle-turn chat
POST/chat/multi多轮对话

Paper

MethodPathDescription
POST/paper/upload上传 PDF 并创建会话
GET/paper/{session_id}获取会话信息(标题、作者、过期时间)
GET/paper/{session_id}/text获取提取出的正文文本
POST/paper/resolve-doi通过 CrossRef 解析 DOI
DELETE/paper/{session_id}手动清理会话

Authentication

当前本地服务器不需要认证。可在 server/main.py 中配置 CORS。

相关内容

CatGo 采用 AGPL-3.0-or-later。若 CatGo 对你的工作有所帮助,请注明 “This work used CatGo (https://app.catgo-ucsd.org).”并引用 CITATION.cff 中的首选文献;该请求不构成 AGPL 许可的附加条件。