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。

相关内容

基于 AGPL-3.0-or-later 许可证发布。