Developers

QuantBayes API

External agents can use the same evidence model as the browser: projects, profiles, cases, evidence cells, runs, and saved results.

Agent workflow

StepActionMeaning
1Create a keyOpen Account, create an API key, and copy it once.
2Choose profileUse /api/v1/profiles to select the correct evidence profile.
3Create projectUse /api/v1/projects for the study, agent task, benchmark, or analysis context.
4Create caseUse /api/v1/cases for the evidence-bearing unit of work.
5Write evidenceUse /api/v1/evidence to store items and TRUE, FALSE, NA evidence cells.
6Run QuantBayesUse /api/v1/runs to freeze the case, profile, matrix, and result.
7Review resultOpen the returned run_uid in /studio/runs/[runUid].

Endpoints

MethodPathAuthPurpose
GET/api/v1/projectsBearer API keyList projects for the authenticated account.
POST/api/v1/projectsBearer API keyCreate or upsert a project.
GET/api/v1/profilesBearer API keyList visible public, community, and private profiles.
GET/api/v1/casesBearer API keyList cases, optionally filtered by project_id.
POST/api/v1/casesBearer API keyCreate or upsert a case.
POST/api/v1/evidenceBearer API keyWrite case items, raw TRUE/FALSE/NA evidence, and QEM matrix cells.
GET/api/v1/runsBearer API keyList saved QuantBayes runs.
POST/api/v1/runsBearer API keyRun QuantBayes from the stored case evidence and profile.
GET/api/v1/usageBrowser sessionShow account usage, keys, and monthly totals in the UI.

Minimal example

export QB_API_KEY="qb_your_key_here"
export QB_BASE_URL="http://localhost:3000"

curl -s "$QB_BASE_URL/api/v1/profiles" \
  -H "Authorization: Bearer $QB_API_KEY"

curl -s "$QB_BASE_URL/api/v1/projects" \
  -H "Authorization: Bearer $QB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "AI evidence verification demo",
    "domain": "general",
    "description": "Evidence-backed agent task"
  }'

curl -s "$QB_BASE_URL/api/v1/runs" \
  -H "Authorization: Bearer $QB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "case_uid": "demo_case_001",
    "profile_uid": "clinical_genetics_qem_demo"
  }'