Server API
deeptutor serve exposes a FastAPI backend at http://localhost:8001/ unless you configured a different backend port. This page gives the high-signal map for custom frontends, mobile apps, and service-to-service integrations.
For the exhaustive, always-current schema, start the server and open:
GET /openapi.json # Full OpenAPI 3.1 specGET /docs # Interactive Swagger UIGET /redoc # Alternative ReDoc UIStarting the server
Section titled “Starting the server”# Backend only. Port comes from data/user/settings/system.json, default 8001.deeptutor serve
# Custom host/port for this processdeeptutor serve --host 127.0.0.1 --port 18001
# Development: hot reload on Python file changesdeeptutor serve --reloadAuthentication
Section titled “Authentication”If auth is enabled in data/user/settings/auth.json, every endpoint except /api/v1/auth/* requires a valid JWT in the Authorization: Bearer <token> header or a session cookie.
# Logincurl -X POST http://localhost:8001/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"username":"alice","password":"..."}'
# Response includes an access_token.
# Use the tokencurl http://localhost:8001/api/v1/sessions \ -H "Authorization: Bearer eyJ..."If auth is disabled, auth dependencies are no-ops and local single-user requests do not need a token.
Turn execution WebSocket
Section titled “Turn execution WebSocket”WS /api/v1/wsThis is the unified turn WebSocket used by the Web UI. It supports every capability uniformly and streams the same event family that deeptutor run --format json prints.
Start a turn by sending a type: "start_turn" or type: "message" payload:
{ "type": "start_turn", "content": "Find d/dx [sin(x^2)]", "capability": "deep_solve", "session_id": null, "tools": ["rag", "reason"], "knowledge_bases": ["math"], "language": "en", "config": {"max_steps": 6}, "notebook_references": [], "history_references": [], "attachments": [], "skills": []}Other supported client message types include subscribe_turn, subscribe_session, resume_from, unsubscribe, cancel_turn, submit_user_reply, regenerate, and ping.
Typical received events:
{"type":"stage_start","stage":"retrieving"}{"type":"tool_call","content":"rag_search","metadata":{"args":{"query":"chain rule"}}}{"type":"tool_result","content":"...","metadata":{"tool":"rag"}}{"type":"stage_end","stage":"retrieving"}{"type":"content","content":"## Solution\n\nThe derivative..."}{"type":"done","metadata":{"session_id":"sess_abc123","turn_id":"turn_xyz789"}}Legacy chat WebSocket
Section titled “Legacy chat WebSocket”WS /api/v1/chatThis legacy endpoint is still present for simple chat clients. Prefer /api/v1/ws for new integrations because it supports all capabilities, replay, cancellation, regeneration, and ask_user replies.
Sessions
Section titled “Sessions”GET /api/v1/sessions List sessionsGET /api/v1/sessions/{session_id} Get a session + messagesPATCH /api/v1/sessions/{session_id} Rename (body: {"title":"..."})DELETE /api/v1/sessions/{session_id} DeletePUT /api/v1/sessions/{session_id}/branch-selectionDELETE /api/v1/sessions/{session_id}/messages/{message_id}POST /api/v1/sessions/{session_id}/quiz-resultsLegacy chat-session aliases also exist:
GET /api/v1/chat/sessionsGET /api/v1/chat/sessions/{session_id}DELETE /api/v1/chat/sessions/{session_id}Knowledge Bases
Section titled “Knowledge Bases”GET /api/v1/knowledge/list List KBsGET /api/v1/knowledge/{kb_name} KB infoDELETE /api/v1/knowledge/{kb_name} DeletePOST /api/v1/knowledge/create Create a KBPOST /api/v1/knowledge/{kb_name}/upload Add documentsPOST /api/v1/knowledge/{kb_name}/reindex Re-embed docsGET /api/v1/knowledge/default Get default KBPUT /api/v1/knowledge/default/{kb_name} Set default KBGET /api/v1/knowledge/supported-file-types Supported uploadsGET /api/v1/knowledge/{kb_name}/files List source filesGET /api/v1/knowledge/{kb_name}/files/{filename} Serve a source file (preview / download)GET /api/v1/knowledge/{kb_name}/file-preview-text/{filename} Extracted plain-text previewGET /api/v1/knowledge/{kb_name}/progress Indexing progressWS /api/v1/knowledge/{kb_name}/progress/ws Progress streamAd-hoc KB search is exposed through the RAG runtime/tool path rather than a dedicated POST /knowledge/{name}/search route in the current API. From CLI, use deeptutor kb search <name> <query>.
Notebook
Section titled “Notebook”GET /api/v1/notebook/listGET /api/v1/notebook/statisticsPOST /api/v1/notebook/createGET /api/v1/notebook/{notebook_id}PUT /api/v1/notebook/{notebook_id}DELETE /api/v1/notebook/{notebook_id}POST /api/v1/notebook/add_recordPOST /api/v1/notebook/add_record_with_summaryDELETE /api/v1/notebook/{notebook_id}/records/{record_id}PUT /api/v1/notebook/{notebook_id}/records/{record_id}Memory
Section titled “Memory”GET /api/v1/memory/overviewGET /api/v1/memory/doc/{layer}/{key}PUT /api/v1/memory/doc/{layer}/{key}POST /api/v1/memory/doc/{layer}/{key}/resetPOST /api/v1/memory/doc/{layer}/{key}/updatePOST /api/v1/memory/doc/{layer}/{key}/auditPOST /api/v1/memory/doc/{layer}/{key}/dedupPOST /api/v1/memory/runs/startGET /api/v1/memory/runsGET /api/v1/memory/runs/{run_id}GET /api/v1/memory/runs/{run_id}/eventsPOST /api/v1/memory/runs/{run_id}/cancelPOST /api/v1/memory/runs/{run_id}/undoGET /api/v1/memory/trace/{surface}DELETE /api/v1/memory/trace/{surface}GET /api/v1/memory/settingsPUT /api/v1/memory/settingsLayers are L2 and L3; examples: /api/v1/memory/doc/L3/profile and /api/v1/memory/doc/L2/chat.
Settings, tools, plugins, and system
Section titled “Settings, tools, plugins, and system”GET /api/v1/settingsGET /api/v1/settings/catalogPUT /api/v1/settings/catalogPOST /api/v1/settings/applyPUT /api/v1/settings/enabled-toolsGET /api/v1/toolsGET /api/v1/plugins/listPOST /api/v1/plugins/tools/{tool_name}/executePOST /api/v1/plugins/tools/{tool_name}/execute-streamPOST /api/v1/plugins/capabilities/{capability_name}/execute-streamGET /api/v1/system/statusGET /api/v1/system/runtime-topologyPOST /api/v1/system/test/llmPOST /api/v1/system/test/embeddingsPOST /api/v1/system/test/searchProvider profiles are edited through the catalog endpoints; there are not separate /settings/llm or /settings/embedding routes in the current API.
Partners Manager
Section titled “Partners Manager”GET /api/v1/partnersPOST /api/v1/partnersGET /api/v1/partners/recentGET /api/v1/partners/channels/schemaGET /api/v1/partners/tool-optionsGET /api/v1/partners/soulsPOST /api/v1/partners/soulsGET /api/v1/partners/soul-sourcesGET /api/v1/partners/{partner_id}PATCH /api/v1/partners/{partner_id}POST /api/v1/partners/{partner_id}/startPOST /api/v1/partners/{partner_id}/stopDELETE /api/v1/partners/{partner_id}POST /api/v1/partners/{partner_id}/channels/reloadGET /api/v1/partners/{partner_id}/soulPUT /api/v1/partners/{partner_id}/soulGET /api/v1/partners/{partner_id}/assetsPOST /api/v1/partners/{partner_id}/assetsDELETE /api/v1/partners/{partner_id}/assets/{asset_type}/{name}GET /api/v1/partners/{partner_id}/historyGET /api/v1/partners/{partner_id}/sessionsPOST /api/v1/partners/{partner_id}/chatPOST /api/v1/partners/{partner_id}/chat/execute-streamWS /api/v1/partners/{partner_id}/wsPartners are admin-gated because their workspace and channel credentials are deployment-scoped. Secrets are masked by default; edit forms request include_secrets=true only when necessary.
Book Engine
Section titled “Book Engine”GET /api/v1/book/booksPOST /api/v1/book/booksGET /api/v1/book/books/{book_id}GET /api/v1/book/books/{book_id}/spineGET /api/v1/book/books/{book_id}/pages/{page_id}DELETE /api/v1/book/books/{book_id}POST /api/v1/book/books/confirm-proposalPOST /api/v1/book/books/confirm-spinePOST /api/v1/book/books/compile-pagePOST /api/v1/book/books/{book_id}/refresh-fingerprintsWS /api/v1/book/wsOutputs and attachments
Section titled “Outputs and attachments”User-generated artifacts are served from a read-only static mount:
GET /api/outputs/<path>Only paths whitelisted via SafeOutputStaticFiles are accessible; directory traversal is blocked. Original chat attachments are served under:
GET /api/attachments/{session_id}/{attachment_id}/{filename}Generate a typed client
Section titled “Generate a typed client”curl http://localhost:8001/openapi.json > deeptutor.openapi.json
# TypeScript clientnpx openapi-typescript deeptutor.openapi.json -o deeptutor.d.ts
# Python clientpip install openapi-python-clientopenapi-python-client generate --path deeptutor.openapi.json