SPB Git

Repository Public

API_INVENTORY.md 11.1 KB

# API inventory

Part 1 (1.x routes) was read in the backend source (server/**, v5.8.0) and, where marked ✔, called by the integration suite — re-run for 2.0.0 against the frozen VQuant Next test backend (M2U64:5058). Part 2 lists what 2.0.0 adds (backend 6, contract vquant-next/docs/next/CONTRACT.md), called through the shared package VQuantKit. The client calls no route that is not in this table (Core/Services/VQuantAPI.swift, Core/Auth/AuthService.swift).

Transport: HTTPS, JSON. Native clients send X-VQ-Client: vquant-macos/<version> (2.0.0: the server then returns the 19 lab engines and the cancelled job status) and Authorization: Bearer vqn_…. There is no WebSocket endpoint. Streams are server-sent events.

# Authentication — server/access.ts, server/native.ts

Route Purpose Client Verified
GET /api/health liveness, uptime (open) health() ✔
GET /.well-known/apple-app-site-association webcredentials for the Apple app id (open) — added v5.8.0 system ✔ (Apple CDN)
POST /api/native/login/options, /verify passkey sign-in → device token — added AuthService.signIn ✔
POST /api/native/register/options, /verify enrol from a setup-link token → passkey + device token — added enrol(setupLink:) ✔
GET /api/native/session who, which device — added session() ✔
POST /api/native/logout revoke this device — added signOut() ✔
POST /api/native/reauth/options, /verify fresh check, 5 min — added reauthenticate() ✔
GET /api/native/devices device sessions and passkeys — added devices() ✔
DELETE /api/native/devices/:id revoke another device (fresh check) — added revokeDevice ✔
DELETE /api/native/passkeys/:ref delete a passkey, never the last (fresh check) — added deletePasskey route read, not exercised
POST /api/passkey/*, /setup/:token, /lock, GET /api/me web gate (cookie vq_access) not used: browser only —

# Market data — server/routes/fmp.ts (proxy to Financial Modeling Prep)

Route Client Verified
GET /api/fmp/indices (12 indices, 45 s server cache) indices() ✔
GET /api/fmp/gainers, /losers, /actives movers() ✔
GET /api/fmp/market-hours marketHours() ✔
GET /api/fmp/search?q=&limit= — added v5.8.0 search() ✔
GET /api/fmp/quote/:symbol quote() ✔
GET /api/fmp/company-profile/:symbol profile() ✔
GET /api/fmp/chart/full/:symbol?from&to dailyBars() ✔
GET /api/fmp/chart/intraday/:symbol?interval&from&to (1min…4hour) intradayBars() ✔
GET /api/fmp/{income-statement,balance-sheet,cash-flow,key-metrics,financial-ratios}/:symbol?period&limit dataset() ✔
GET /api/fmp/{analyst-estimates,price-target,upgrades-downgrades,earnings-surprises,dividend-history,institutional-holders,esg-score}/:symbol dataset() ✔
GET /api/fmp/{financial-news,insider-trading}/:symbol?limit dataset() ✔
GET /api/fmp/historical-price/:symbol dataset(.dailyPrices) ✔
GET /api/fmp/stock-quote/:symbol, /intraday/:symbol, /chart/light/:symbol, /price-target-summary/:symbol not used (duplicates of the above) —

The proxy offers a page size (limit) on some datasets and no offset: "server-side pagination" in the Data Explorer is the choice of that page size.

# Research agent — server/routes.ts, routes/generations.ts, routes/reports.ts

Route Purpose Client Verified
POST /api/chat starts an analysis job; the response is its event stream startAnalysis ✔ real run
GET /api/generations jobs of the last 24 h generations() ✔
GET /api/generations/:id/stream?from=n replay from event n, then live watchGeneration ✔ replay and mid-stream join
POST /api/generations/:id/cancel Stop cancelGeneration ✔
GET /api/sessions[?q=], GET/PATCH/DELETE /api/sessions/:id conversations sessions, conversation, renameSession, pinSession, deleteSession ✔
POST /api/generate-pdf, /generate-docx, /convert-to-slides server-rendered exports renderPDF, renderDOCX, renderSlides PDF ✔; DOCX, slides not exercised
GET /api/shared-reports, GET /api/share/:id, POST /api/share shared reports sharedReports, sharedReport, share list ✔; publish not exercised
GET /figures/*, /plots/*, GET /api/download/:file figures and generated files asset(path:) figures route read; fetch path-confined (tested)
POST /api/speech-to-text dictation (needs ELEVENLABS_API_KEY, absent from the server's environment) not used —

Event types of a stream (all decoded by GenerationEvent): job, status, text, thinking, tools, tool_start, tool_complete, tool_result, tool_error, python_code, custom_python_figures, plan, agent_start, agent_tool, agent_done, workspace, sources, followups, error, done. An unknown type is counted and reported in the interface, never dropped silently.

Server limits the client reports as they are: 4 running analyses per person, one per conversation; jobs live in the server's memory (a restart ends them); replay for 20 minutes after the end.

# Workspace — server/routes/workspace.ts

GET /api/workspace; POST/DELETE /api/workspace/memories[/:id]; PUT/DELETE /api/workspace/portfolio/:symbol; POST/PATCH/DELETE /api/workspace/watches[/:id]; POST /api/workspace/watches/:id/run. All used, all ✔ except watches/:id/run (would start a real analysis on the schedule's model).

# Quant Engine — server/routes/quant.ts (added v5.8.0)

GET /api/quant/tools; POST /api/quant/jobs; GET /api/quant/jobs; GET/DELETE /api/quant/jobs/:id. ✔ including a job that fails. Engines: garch, var, monte_carlo, options, portfolio_optimization, risk_metrics — the executors the agent already used, with the agent's defaults. No cancel route: the executors cannot be interrupted.

# Usage — server/routes/analytics.ts, routes/admin.ts

GET /api/analytics/real-time-stats is used by network diagnostics (✔). GET /api/admin/database and the delete routes under /api/admin/* are not exposed: they act on every person's data with no per-person check, which a client distributed to several people should not offer.

# Part 2 — backend 6 routes used by 2.0.0

Evidence: T called by an integration test of this repository against 5058 · L called by the running app against 5058 and its result seen in a capture · K covered by the kit's own fixture/live tests only · — written, not exercised. Client column: vq = app.vq (VQuantKit).

# Sync — CONTRACT §1

Route Client Evidence
GET /api/v2/sync/stream (SSE: hello, change, hint) VQSyncEngine.start L (toolbar indicator "Synced"; a chart edited by a raw PUT appeared in the open app)
GET /api/v2/sync/changes?since= VQSyncEngine.pull L, K
GET/PUT/DELETE /api/v2/objects/:kind/:id VQSyncEngine.flush, vq.objects T (notes, projects, charts through raw GET/PUT round trips), L
GET /api/v2/objects/:kind/:id/versions[/:rev] Studio note versions T

# Models, usage, trace — §2

Route Client Evidence
GET /api/v2/models composer model picker, Settings › Models T, L
GET /api/v2/models/route Settings routing preview T, L
POST /api/chat with mode: research, model: auto, budget, projectId Research composer L (one fast auto run, one research study); projectId —
stream events model_routed, budget, quant_job, provenance, done.usage run view, usage line L (model_routed, usage, provenance); budget, quant_job not observed live
GET /api/v2/generations/:id/trace trace sheet L
GET /api/v2/usage?days= Settings › Usage & Cost L

# Data layer and terminal — §3

Route Client Evidence
GET /api/v2/market/overview Overview, menu-bar extra L
GET /api/v2/data/quotes?symbols= (≤ 60 per call, batched) Watchlists, Portfolios, Overview T (70 refused, 60 + 10 accepted), L
GET /api/v2/data/bars/:symbol Charting T (^GSPC daily and 15 m), L
GET /api/v2/data/statements/:symbol Statements L
GET /api/v2/search command palette L
GET /api/v2/data/health Settings › Data Providers L

# Quant Lab — §4

Route Client Evidence
GET /api/quant/tools (19 tools with a 2.x header) catalogue T, L
POST /api/quant/jobs (projectId optional), GET /api/quant/jobs[/:id], DELETE jobs T, L; projectId —
POST /api/quant/jobs/:id/cancel cancel T (lab job cancelled; legacy → not_cancellable)

# Research Studio, review, memory, audit — §5–§7

Route Client Evidence
GET /api/v2/projects/:id/bundle project page T, L
POST /api/v2/projects/:id/export + GET /api/download/:file export sheet T (md, md with include, zip, tex, pdf) ; saving through the panel —
POST /api/v2/projects/:id/run not used: the project composer hands the question to Research (/api/chat with projectId) —
POST /api/v2/reviews "Request review" — (calls a model; never started from this client). Rendering of an existing review object: L
GET /api/v2/memory, PUT …/settings, DELETE …?scope=, GET …/export, PATCH /api/workspace/memories/:id Settings › Memory, project memory T (project-scoped add, patch, delete), L (listing); settings, bulk delete, export —
GET /api/v2/audit Settings › Audit Log L

# Autonomous research — §9

Route Client Evidence
GET /api/v2/research/sandbox mode availability, Environnement, Settings › Research T, L
GET/POST /api/v2/research/sessions, GET …/:id Studies list, cockpit rebuilt from REST T, L
POST …/:id/upload (multipart), GET …/:id/inspect dataset attachment T (201, 415 with the server's sentence), L
GET …/:id/files, …/file Files, Code T, L
GET …/:id/experiments, …/runs, GET /api/v2/research/runs/:id, POST …/cancel Experiments, Environment L (experiments); runs, logs, cancel — (no background run occurred)
GET /api/v2/research/approvals, POST …/:id approvals T (pending list); answering — (no approval occurred in the live study; the kit's card is tested on sequences recorded from the server)
stream events research_workspace, dataset, research_file, code_execution, experiment, figure_lint, quality_gate cockpit L; package_install, research_run, approval_*, budget, plan not observed live

Routes of backend 6 the client does not call: POST /api/v2/projects/:id/run (see above), the web-only cookie routes, /api/admin/* (unchanged reason: no per-person check).

Files main
Menu

Theme