API Reference

The BioCortex backend exposes a REST API and a WebSocket endpoint for the Next.js frontend and external integrations. Base path: /api/v1.

Authentication

  • Session: Cookie-based; login/register set session cookies.
  • Endpoints: Most routes require an authenticated user (session). Unauthenticated requests may receive 401 or redirect to login.
MethodPathDescription
GET/meCurrent user (authenticated, username, role).
GET/me/settingsUser settings (models, strategy, usage, limits).
PUT/me/settingsUpdate settings (reasoning_model, coder_model, fast_model, custom_base_url, custom_api_key, strategy).
POST/auth/loginLogin (username, password) → session.
POST/auth/registerRegister (if enabled).
POST/auth/logoutLogout.

Chat and Analysis

MethodPathDescription
WS/ws/chatWebSocket for streaming analysis: send messages, receive plan updates, steps, and final report. Config may include biomni_path to use Biomni tools.
GET/chat/historyChat history for a project (by project_id).

Projects

MethodPathDescription
GET/projectsList user projects.
POST/projectsCreate project (title).
GET/projects/Get project details (conversation, plan_steps, result_files).
DELETE/projects/Delete project.

Files and Results

MethodPathDescription
POST/files/uploadUpload files (multipart).
GET/files/listList uploaded files.
GET/files/serveServe a file (path, optional download=true).
GET/results/filesList result files (tree) for a project.
GET/results/previewPreview a result file (path, type). For PPTX files, returns extracted slide images for in-page preview.

Reports and Presentations

MethodPathDescription
POST/projects//generate-reportGenerate Markdown report from project results; saved under results dir. Returns report path/metadata.
POST/projects//generate-pptxGenerate PowerPoint (.pptx) from project results; uses same Figure 1..N order and optional LLM captions. Returns path or triggers download.
POST/reports/exportExport an existing report file. Body: { "path": "/abs/path/to/report.md", "format": "html" or "pdf" or "word" }. Returns file or URL.
GET/results/previewSee Files and Results. Used for report/PPT preview (e.g. PPTX → slide images).
See Reports and Presentations for usage and logic.

Status and Resources

MethodPathDescription
GET/statusAgent/system status (online, agent loaded, status dict).
GET/resourcesResources page: list tools, databases, packages. Returns { "databases": [...], "tools": [...], "packages": [...] }. Each item: name, description, domain, parameters.
GET/context-budgetContext window budgets for configured models (for Settings/debugging).

Automation

MethodPathDescription
POST/webhooks/Trigger webhook (e.g. experiment_done). Body: optional payload.
GET/webhooksList registered webhooks.
POST/webhooks//configureConfigure webhook (task_template, description).
GET/webhooks//callsList recent webhook calls.
GET/cron/jobsList cron jobs.
POST/cron/jobsCreate cron job (name, task, cron, enabled).
GET/cron/jobs/Get cron job details.
DELETE/cron/jobs/Remove cron job.
POST/cron/jobs//enableEnable job.
POST/cron/jobs//disableDisable job.
POST/cron/startStart cron scheduler.
POST/cron/stopStop cron scheduler.

Other

MethodPathDescription
POST/quick-chatSimple LLM chat (BioCortex Assistant; uses framework docs as context). Body: JSON with a message field.
POST/analysis/reviewSubmit analysis for review (if implemented).

OpenAPI

For full request/response schemas and examples, run the backend and open:
  • Swagger UI: http://localhost:7860/docs (or your backend base URL + /docs)
  • ReDoc: http://localhost:7860/redoc
The FastAPI app is defined in biocortex/web/api.py and mounted in biocortex/web/app.py.