MedicAITutor Docs

MedicAI Tutor API Documentation

Interactive endpoint reference for the MedicAITutor API.

Live API Station schema OpenAPI JSON

Table of Contents

Health Check

Endpoint
GET /healthz
Description Verifies server health status. Request
No request body.
Response (200)
{
  "status": "ok",
  "env": "staging"
}

Release Info

Endpoint
GET /health/release
Description Returns machine-readable metadata for the release currently serving traffic, including the rollout timestamp, image URI, and source SHA when present. Request
curl https://api.medicaitutor.com/health/release
Response (200)
{
  "service": "medicaitutor-api",
  "environment": "staging",
  "version": "0.1.0",
  "release_at": "2026-04-20 06:16 WAT",
  "image_uri": "757052694893.dkr.ecr.us-east-1.amazonaws.com/medicaitutor:a1e8233afcc2d65ae5b826bb982d890207794119",
  "source_sha": "a1e8233afcc2d65ae5b826bb982d890207794119"
}

Stations (List)

Endpoint
GET /stations
Description Lists station summaries. By default this returns only published stations. Admin callers and private station-reviewer sessions can add `publication_status=unpublished` to inspect unpublished stations or `publication_status=all` to inspect both states. Unpublished station data is never returned without a valid access grant. Request
Public default:
curl https://api.medicaitutor.com/stations

Admin all-states view:
curl -H 'x-api-key: ' 'https://api.medicaitutor.com/stations?publication_status=all'
Response (200)
{
  "items": [
    {
      "slug": "abuse-in-intellectually-disabled-person-history-taking-1",
      "title": "SAFEGUARDING CONCERN IN AN ADULT WITH LEARNING DISABILITY — HISTORY FROM AN INTIMIDATED DAY-CENTRE WORKER",
      "section": "HISTORY TAKING",
      "time_limit_minutes": 7,
      "station_category": "history_taking",
      "publication_status": "published",
      "has_rubric": true,
      "has_key_points": true,
      "has_persona": true,
      "simulation_ready": true,
      "evaluation_ready": true
    },
    {
      "slug": "abuse-in-intellectually-disabled-person-history-taking",
      "title": "SUSPECTED ABUSE OR NEGLECT IN AN ADULT WITH LEARNING DISABILITY — COLLATERAL HISTORY",
      "section": "HISTORY TAKING",
      "time_limit_minutes": 7,
      "station_category": "history_taking",
      "publication_status": "published",
      "has_rubric": true,
      "has_key_points": true,
      "has_persona": true,
      "simulation_ready": true,
      "evaluation_ready": true
    },
    {
      "slug": "agitated",
      "title": "DEPRESSION WITH POVERTY DELUSIONS - HISTORY TAKING",
      "section": "HISTORY TAKING",
      "time_limit_minutes": 7,
      "station_category": "history_taking",
      "publication_status": "published",
      "has_rubric": true,
      "has_key_points": true,
      "has_persona": true,
      "simulation_ready": true,
      "evaluation_ready": true
    }
  ],
  "total": 27
}
Response (401 example)
{
  "detail": "Invalid API key."
}

Station Metadata

Endpoint
GET /stations/metadata
Description Returns available station sections and station categories. Public requests default to published stations only. Admin callers and private station-reviewer sessions can pass `publication_status=unpublished` or `publication_status=all` to inspect the broader catalog. Request
Published metadata:
curl https://api.medicaitutor.com/stations/metadata

Unpublished metadata:
curl -H 'x-api-key: ' 'https://api.medicaitutor.com/stations/metadata?publication_status=unpublished'
Response (200)
{
  "sections": [
    "HISTORY TAKING",
    "SAFEGUARDING AND DOMESTIC ABUSE",
    "WOMEN’S MENTAL HEALTH"
  ],
  "categories": [
    "history_taking"
  ]
}
Response (401 example)
{
  "detail": "Invalid API key."
}

Station (By Slug)

Endpoint
GET /stations/{slug}
Description Returns the full station payload. Public requests can only read published stations. Admin callers and private station-reviewer sessions can request `publication_status=unpublished` for an unpublished station or `publication_status=all` to bypass the publication filter. The publication block includes the separate boolean expert_reviewed provenance field. Path Params slug string Required Station slug (URL-safe) Request
Published station:
curl https://api.medicaitutor.com/stations/abuse-in-intellectually-disabled-person-history-taking

Unpublished station:
curl -H 'x-api-key: ' 'https://api.medicaitutor.com/stations/example-slug?publication_status=unpublished'
Response (200)
{
  "slug": "abuse-in-intellectually-disabled-person-history-taking",
  "section": "HISTORY TAKING",
  "title": "SUSPECTED ABUSE OR NEGLECT IN AN ADULT WITH LEARNING DISABILITY — COLLATERAL HISTORY",
  "task": "You have been asked to speak to the key worker of a 26-year-old man with\nmoderate to severe degree of learning disability who attends the day centre. The key\nworker is concerned that Paul has been withdrawn and tearful.Obtain more history from\nthe key worker to identify causes for his presentation and arrive at a diagnosis.\nCASE SYNOPSIS\n: You're key worker for a 27-year-old man with a moderate degree of\nlearning disability who attends the day centre you work at. You contacted the mental\nhealth team because of concerns about him. A couple of days ago you noticed bruises on the\nleft side of his face and neck, they are grey/purple in colour. He hasn't been his usual self\nfor the past few days/weeks. He is easily upset, and it is often difficult to ascertain why,\nalthough he sometimes signs 'home' when distressed. He has been agitated prior to going\nhome in the evening. You have tried contacting his parents but there has been no reply to\nphone calls. He has had epilepsy most of his life, however, in recent weeks, he has been\nhaving fits more frequently, almost every day. He is currently on (tablets) Valproate and a\nnew medication. He has limited speech, mostly communicating in single words and basic\nMakaton signs to communicate basic requests\n\nYou're key worker for a 27-year-old man with a moderate degree of\nlearning disability who attends the day centre you work at. You contacted the mental\nhealth team because of concerns about him. A couple of days ago you noticed bruises on the\nleft side of his face and neck, they are grey/purple in colour. He hasn't been his usual self\nfor the past few days/weeks. He is easily upset, and it is often difficult to ascertain why,\nalthough he sometimes signs 'home' when distressed. He has been agitated prior to going\nhome in the evening. You have tried contacting his parents but there has been no reply to\nphone calls. He has had epilepsy most of his life, however, in recent weeks, he has been\nhaving fits more frequently, almost every day. He is currently on (tablets) Valproate and a\nnew medication. He has limited speech, mostly communicating in single words and basic\nMakaton signs to communicate basic requests",
  "prompts": {
    "station_name": "ABUSE IN INTELLECTUALLY DISABLED PERSON-HISTORY TAKING",
    "case_synopsis": "You have been asked to speak to the key worker of a 26-year-old man with\nmoderate to severe degree of learning disability who attends the day centre. The key\nworker is concerned that Paul has been withdrawn and tearful.Obtain more history from\nthe key worker to identify causes for his presentation and arrive at a diagnosis.\nCASE SYNOPSIS\n: You're key worker for a 27-year-old man with a moderate degree of\nlearning disability who attends the day centre you work at. You contacted the mental\nhealth team because of concerns about him. A couple of days ago you noticed bruises on the\nleft side of his face and neck, they are grey/purple in colour. He hasn't been his usual self\nfor the past few days/weeks. He is easily upset, and it is often difficult to ascertain why,\nalthough he sometimes signs 'home' when distressed. He has been agitated prior to going\nhome in the evening. You have tried contacting his parents but there has been no reply to\nphone calls. He has had epilepsy most of his life, however, in recent weeks, he has been\nhaving fits more frequently, almost every day. He is currently on (tablets) Valproate and a\nnew medication. He has limited speech, mostly communicating in single words and basic\nMakaton signs to communicate basic requests\n\nYou're key worker for a 27-year-old man with a moderate degree of\nlearning disability who attends the day centre you work at. You contacted the mental\nhealth team because of concerns about him. A couple of days ago you noticed bruises on the\nleft side of his face and neck, they are grey/purple in colour. He hasn't been his usual self\nfor the past few days/weeks. He is easily upset, and it is often difficult to ascertain why,\nalthough he sometimes signs 'home' when distressed. He has been agitated prior to going\nhome in the evening. You have tried contacting his parents but there has been no reply to\nphone calls. He has had epilepsy most of his life, however, in recent weeks, he has been\nhaving fits more frequently, almost every day. He is currently on (tablets) Valproate and a\nnew medication. He has limited speech, mostly communicating in single words and basic\nMakaton signs to communicate basic requests"
  },
  "lead": "You have been asked to speak to the key worker of a 26-year-old man with\nmoderate to severe degree of learning disability who attends the day centre. The key\nworker is concerned that Paul has been withdrawn and tearful.Obtain more history from\nthe key worker to identify causes for his presentation and arrive at a diagnosis.",
  "key_points": [
    "ABUSE IN INTELLECTUALLY DISABLED PERSON-HISTORY TAKING",
    "You have been asked to speak to the key worker of a 26-year-old man with",
    "moderate to severe degree of learning disability who attends the day centre.",
    "worker is concerned that Paul has been withdrawn and tearful.Obtain more history from",
    "the key worker to identify causes for his presentation and arrive at a diagnosis."
  ],
  "persona": {
    "name": "Standardized Patient",
    "age": 36,
    "affect": "low",
    "communication_style": "cooperative but guarded",
    "goals_concerns": [
      "ABUSE IN INTELLECTUALLY DISABLED PERSON-HISTORY TAKING",
      "You have been asked to speak to the key worker of a 26-year-old man with"
    ],
    "nonverbal_cues": [
      "low"
    ],
    "do_not_volunteer": [
      "moderate to severe degree of learning disability who attends the day centre.",
      "worker is concerned that Paul has been withdrawn and tearful.Obtain more history from"
    ]
  },
  "guardrails": {
    "forbidden_topics": [],
    "mandatory_disclosures": [
      "ABUSE IN INTELLECTUALLY DISABLED PERSON-HISTORY TAKING",
      "You have been asked to speak to the key worker of a 26-year-old man with"
    ],
    "handoff_triggers": [],
    "privacy_rules": [
      "no real third-party identifiers"
    ],
    "out_of_scope_responses": [
      "I can describe what has been happening, but I cannot decide my treatment plan myself."
    ]
  },
  "rubric": {
    "marking_sheet_title": "MARKING SHEET: ABUSE IN INTELLECTUALLY DISABLED PERSON-HISTORY TAKING",
    "overall_scale": [
      "SEVERE FAIL",
      "FAIL",
      "BORDERLINE FAIL",
      "BORDERLINE PASS",
      "PASS",
      "EXCELLENT PASS"
    ],
    "domain_rating_scale": [
      "0",
      "1",
      "2",
      "3",
      "4"
    ],
    "rating_to_score": {
      "0": 0.0,
      "1": 0.25,
      "2": 0.5,
      "3": 0.75,
      "4": 1.0
    },
    "competency_items": [
      {
        "label": "Elicit relevant history - recent change in behaviour, withdrawal, tearfulness, and agitation before going home",
        "weight": 1.0,
        "scoring_mode": "level",
        "critical": true,
        "hints": [
          "withdrawn",
          "tearful",
          "agitated before going home",
          "past few days or weeks",
          "changed behaviour"
        ]
      },
      {
        "label": "Elicit details of unexplained bruising and possible non-accidental injury",
        "weight": 1.0,
        "scoring_mode": "level",
        "critical": true,
        "hints": [
          "bruises",
          "face and neck",
          "grey or purple",
          "injury",
          "non-accidental"
        ]
      },
      {
        "label": "Explore communication cues from Paul including distress, signing home, pain, fear, or reluctance to return home",
        "weight": 1.0,
        "scoring_mode": "level",
        "critical": true,
        "hints": [
          "Makaton",
          "signs home",
          "limited speech",
          "distress",
          "fear",
          "pain"
        ]
      },
      {
        "label": "Clarify home circumstances, parental contact, supervision, and possible neglect or abuse by carers",
        "weight": 1.0,
        "scoring_mode": "level",
        "critical": true,
        "hints": [
          "parents",
          "carers",
          "home",
          "no reply",
          "supervision",
          "neglect",
          "abuse"
        ]
      },
      {
        "label": "Assess epilepsy history, increased seizure frequency, medication changes, and medical explanations for presentation",
        "weight": 1.0,
        "scoring_mode": "level",
        "critical": false,
        "hints": [
          "epilepsy",
          "fits",
          "seizures",
          "valproate",
          "new medication",
          "medical cause"
        ]
      },
      {
        "label": "Safeguarding and risk assessment - immediate safety, documentation, escalation, and multidisciplinary action",
        "weight": 1.0,
        "scoring_mode": "level",
        "critical": true,
        "hints": [
          "safeguarding",
          "safe",
          "document bruises",
          "escalate",
          "social services",
          "police",
          "multidisciplinary"
        ]
      },
      {
        "label": "Synthesise likely abuse or safeguarding concern while considering differential causes such as seizures or medication effects",
        "weight": 1.0,
        "scoring_mode": "level",
        "critical": true,
        "hints": [
          "abuse",
          "safeguarding concern",
          "differential",
          "seizures",
          "medication",
          "diagnosis",
          "explain"
        ]
      }
    ],
    "feedback_checklist": [
      {
        "id": 1,
        "title": "Missed behavioural change chronology",
        "details": "Explore withdrawal, tearfulness, agitation before going home, and timing over days or weeks."
      },
      {
        "id": 2,
        "title": "Insufficient injury and safeguarding exploration",
        "details": "Ask directly about bruising, possible non-accidental injury, home circumstances, and carer contact."
      },
      {
        "id": 3,
        "title": "Poor immediate safety planning",
        "details": "Document injuries, escalate safeguarding, consider medical causes, and ensure Paul is not returned to an unsafe setting."
      }
    ]
  },
  "evaluation": {
    "version": "ev-1.0.0"
  },
  "sources": {
    "pdf": "SPMMCourseBooklet2022.pdf"
  },
  "station_meta": {
    "topic": "ABUSE IN INTELLECTUALLY DISABLED PERSON-HISTORY TAKING",
    "time_limit_minutes": 7,
    "setting": "Clinic",
    "expected_diagnosis": "Working diagnosis",
    "station_category": "history_taking"
  },
  "publication": {
    "status": "published",
    "reason": "Expert reviewed for initial candidate testing",
    "expert_reviewed": true
  },
  "health": {
    "issues": [
      "default_persona"
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": false,
    "has_guardrails": true,
    "has_tuning": false,
    "simulation_ready": false,
    "evaluation_ready": false,
    "publishable": false
  }
}
Response (401 example)
{
  "detail": "Invalid API key."
}
Response (404 example)
{
  "detail": "Station 'example-slug' not found."
}

Station Revisions

Endpoint
GET /stations/{slug}/revisions
Description Lists immutable snapshots saved whenever a station is created, updated, deleted, or rolled back. Admin credentials or a valid private station-reviewer session are required because revisions can contain unpublished station data. Endpoint
POST /stations/{slug}/revisions/{revision_id}/rollback
Description Restores a previous revision as the current station and writes a new revision entry. Rollback request
No request body.
Response (200)
{
  "items": [
    {
      "id": 12,
      "slug": "abuse-in-intellectually-disabled-person-history-taking",
      "revision_number": 3,
      "action": "update",
      "created_at": "2026-03-23T10:15:00Z",
      "note": null
    }
  ],
  "total": 1
}
Response (401 example)
{
  "detail": "Admin credentials required."
}

Ask Me Anything

Endpoint
POST /ask
Description General-purpose assistant endpoint. Accepts text and optional audio/document uploads, stores the raw files, extracts text, and can answer back with AI-generated guidance. Referenced answers Final assessments at /evaluate, /evaluation/score and evaluation within /session/end also include learning_explanation and learning_evidence. Render these as a separate referenced learning section. The citations support that explanation, not the numerical score or original rubric feedback. Live/in-progress patient scoring does not trigger evidence generation. When EVIDENCE_ENABLED is enabled with a reviewed corpus, /ask returns a fuller Ask Me Anything answer with inline [1] markers when approved evidence supports it. Realtime tutor uses the same answer-depth rule: up to five statements/180 words by default, or twelve statements/500 words when the user explicitly asks for detail; its public response remains separate assistant_text and assistant_citations events. The /ask response contains answer and evidence, including status, citations, answer_outcome and disclosure. No request or response fields are added for answer depth. /review retains its separate detailed evidence contract. /ask keeps the server-assigned response_mode internally for routing; it is not a public /ask field. Casual/non-clinical requests bypass clinical retrieval; clinical wording remains on the referenced path even when phrased playfully. Set EVIDENCE_SEMANTIC_ENABLED=true when the corpus includes matching embeddings; the API combines FTS5 keyword results with semantic results, rejects weak semantic-only, partial multi-term and obvious restrictive-scope mismatches, and falls back to FTS5 if embeddings are unavailable. Multi-term candidates must contain the requested terms in a direct phrase or close local context before they reach generation or citation selection; when no candidate passes, eligible AMA and tutor requests use the shared general-explanation fallback without citations. Source-only, personal-prescribing and evidence-conflict boundaries remain protected. Citations and named sources are preferred, but missing evidence normally leads to a clearly disclosed general explanation. Explicit source-only requests remain evidence-only. Never attribute the fallback to an unverified authority. Render evidence.citations as a compact Sources list; source metadata is supplied by the API, not generated by the model. A null citation URL means show the title, edition and PDF page without a link. Uploaded user documents are context, not automatically approved sources. Evidence response fragment (illustrative, not clinical advice)
{
  "answer": "A concise explanation supported by the retrieved source. [1]",
  "evidence": {
    "status": "verified",
    "answer_outcome": "evidence_backed",
    "disclosure": null,
    "citations": [
      {
        "number": 1,
        "title": "Example textbook",
        "edition": "2nd",
        "pdf_page": 42,
        "page_label": "30",
        "section": "Assessment",
        "url": null
      }
    ]
  }
}
Evidence states The public /ask response has exactly answer and evidence. Public evidence.status is one of verified (approved evidence supports the answer and citations), insufficient_evidence (retrieval completed but approved sources were insufficient), unavailable (retrieval or validation could not complete), or not_applicable (evidence is not required). Use evidence.answer_outcome to distinguish evidence_backed, general_explanation, policy_response and unavailable. Display evidence.disclosure separately from the answer. Do not infer a useful general explanation from evidence.status alone. General explanations are independently checked for relevance, completeness, safety and honest attribution, but are not evidence-verified. A missing source or failed citation check leads to a fresh uncited explanation within the same deadline, not recycled rejected claims. One final-answer repair is allowed. General generation failure is labeled unavailable. Detailed retrieval, validation, provider/model, timings, hashes, failure reasons and internal evidence statuses remain in audit storage. Supported realtime/review evidence still means selected quotes support the claims and a separate model support, directness, completeness and scope check passed; it is not a guarantee of clinical correctness. Casual/non-clinical, clarification and medication/emergency signposting use not_applicable on /ask. Shared rules and a bounded semantic classifier select the response policy; the model generates wording under that policy for ordinary answers. Emergency-safety responses are reviewed server-owned text generated before model or corpus calls; `/ask` reports `not_applicable` with no citations, and realtime tutor emits the same answer plus the internal `assistant-policy-v10` provenance. Reported overdose bypasses corpus retrieval; display the full emergency answer without a Sources list. Classification never determines whether evidence is verified. Named-source requests require the specified organisation's eligible sources; internal evidence IDs cannot appear in answer text. retrieval_mode is hybrid for combined keyword/semantic retrieval, lexical when semantic retrieval is not configured, and lexical_fallback when the semantic path fails. PDF page numbers are one-based physical pages; PDF page labels may differ from printed numbering. Scores retain station-rubric evidence; /review provides referenced learning explanations separately. GET /evidence/status is admin-only corpus readiness. See the repository docs/evidence-sources.md for source review, import and activation instructions. Clarification responses Underspecified requests such as Explain clinical concepts return evidence.status=not_applicable on /ask, with the detailed response_mode=general, reason=clarification_required and policy_version=assistant-policy-v10 retained internally. Display the short clarifying question without a Sources list. Specific concept questions still use approved evidence. Content-Type multipart/form-data Form Fields text string Optional General question or prompt audio file Optional Audio upload to transcribe documents file[] Optional One or more documents to extract text from station_slug string Optional Station context if the user wants station-specific help exam_slug string Optional Mock exam context category string Optional Free-form hint for routing Request example
{
  "text": "Summarize the main differences between psychosis and anxiety in this station.",
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "category": "study-help"
}
Response (200)
{
  "interaction": {
    "kind": "ask",
    "station_slug": "acute-presentation-of-psychosis-in-the-context-of-cannabis-misuse",
    "category": "history_taking",
    "attachment_paths": [
      "raw/document/example.txt"
    ]
  },
  "answer": "The main difference is ...",
  "provider": "openai",
  "model": "gpt-4o-mini"
}
Response (422 example)
{
  "detail": "At least one text or attachment input is required."
}
Response (503 example)
{
  "detail": {
    "message": "nlp provider 'openai' failed.",
    "stage": "nlp",
    "provider": "openai",
    "error_type": "RuntimeError",
    "error": "Upstream provider unavailable"
  }
}

Station Review API

Technical route for submitting review text and receiving a stored AI review response. For practitioner workflow and interpretation, use the Station Review Guide.

Avatar assignments are a separate gate

The private speaker and appearance review queue is not a POST /review response and is not an automatic assignment mechanism. Use the speaker and appearance review procedure to record human, station-specific approval before changing a station avatar block.

Endpoint
POST /review
Description Accepts review text plus optional station or session context. The backend stores the submission and returns a review in the shared assistant response shape. With a reviewed corpus enabled, the response includes evidence and numbered clinical references as described under Ask Me Anything. Station-rubric performance observations remain separate in notes and are not presented as textbook-supported scoring. Request payload
{
  "text": "Please review this station draft for publication readiness. Focus on rubric completeness, persona specificity, key points, and simulation safety.\n\n{\n  \"title\": \"Early menopausal symptoms assessment\",\n  \"persona\": {\"name\": \"Mrs Whitlock\", \"communication_style\": \"anxious but cooperative\"},\n  \"key_points\": [\"timeline\", \"functional impact\", \"risk\", \"ICE\"],\n  \"rubric_domains\": [\"history structure\", \"symptom exploration\", \"risk assessment\"]\n}",
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "category": "station-review",
  "generate_ai_response": true
}
Response (200)
{
  "interaction": {
    "id": 8421,
    "kind": "review",
    "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
    "session_id": null,
    "exam_slug": null,
    "category": "station-review",
    "user_text": "Please review this station draft for publication readiness. Focus on rubric completeness, persona specificity, key points, and simulation safety.\n\n{\n  \"title\": \"Early menopausal symptoms assessment\",\n  \"persona\": {\"name\": \"Mrs Whitlock\", \"communication_style\": \"anxious but cooperative\"},\n  \"key_points\": [\"timeline\", \"functional impact\", \"risk\", \"ICE\"],\n  \"rubric_domains\": [\"history structure\", \"symptom exploration\", \"risk assessment\"]\n}",
    "ai_text": "Summary: the station is close to publishable, but the rubric language should be more measurable and the persona should include clearer disclosure boundaries. Improve the competency items, add one explicit safety trigger, and tighten the lead so it matches the case synopsis.",
    "payload": {
      "kind": "review",
      "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
      "session_id": null,
      "exam_slug": null,
      "category": "station-review",
      "station_title": "SUSPECTED ABUSE OR NEGLECT IN AN ADULT WITH LEARNING DISABILITY — COLLATERAL HISTORY",
      "exam_title": null,
      "provider": "openai",
      "model": "gpt-5-mini",
      "generate_ai_response": true,
      "candidate_id": null,
      "summary": "Close to publishable; tighten rubric specificity and safety guardrails.",
      "tags": [
        "station-review",
        "publishability",
        "rubric"
      ],
      "notes": [
        "Add one more measurable competency item.",
        "Replace generic persona wording with patient-specific behaviour cues.",
        "Include a clear escalation or handoff trigger for unsafe scenarios."
      ],
      "transcript_excerpt": null,
      "evaluation_snapshot": null,
      "attachments": []
    },
    "attachment_paths": [],
    "created_at": "2026-07-17T10:30:00Z"
  },
  "extracted_text": "Please review this station draft for publication readiness. Focus on rubric completeness, persona specificity, key points, and simulation safety.\n\n{\n  \"title\": \"Early menopausal symptoms assessment\",\n  \"persona\": {\"name\": \"Mrs Whitlock\", \"communication_style\": \"anxious but cooperative\"},\n  \"key_points\": [\"timeline\", \"functional impact\", \"risk\", \"ICE\"],\n  \"rubric_domains\": [\"history structure\", \"symptom exploration\", \"risk assessment\"]\n}",
  "attachments": [],
  "provider": "openai",
  "model": "gpt-5-mini",
  "answer": "Summary: the station is close to publishable, but the rubric language should be more measurable and the persona should include clearer disclosure boundaries. Improve the competency items, add one explicit safety trigger, and tighten the lead so it matches the case synopsis.",
  "notes": [
    "Close to publishable; tighten rubric specificity and safety guardrails.",
    "Add one more measurable competency item.",
    "Replace generic persona wording with patient-specific behaviour cues."
  ]
}
Response (422 example)
{
  "detail": "Review text is required."
}

User Feedback

Endpoint
POST /feedback
Description Stores user-submitted product, station, or mock-exam feedback in the database without generating AI coaching. Payload
{
  "text": "Please make the morning paper a bit harder.",
  "exam_slug": "morning-paper",
  "category": "exam-feedback",
  "source": "web-app"
}
Response (200)
{
  "interaction": {
    "kind": "feedback",
    "exam_slug": "morning-paper",
    "category": "exam-feedback"
  },
  "accepted": true,
  "notes": [
    "Feedback stored successfully."
  ]
}
Response (422 example)
{
  "detail": "text field is required."
}

Mock Exams

Endpoint
GET /mock-exams
Request
No request body.
Response (200)
{
  "items": [
    {
      "slug": "morning-paper",
      "title": "Morning Paper",
      "session_label": "morning",
      "station_slugs": [
        "abuse-in-intellectually-disabled-person-history-taking-1",
        "abuse-in-intellectually-disabled-person-history-taking",
        "agitated"
      ]
    }
  ],
  "total": 1
}
Endpoint
GET /mock-exams/{slug}
Request
No request body.
Response (200)
{
  "slug": "morning-paper",
  "title": "Morning Paper",
  "session_label": "morning",
  "station_slugs": [
    "abuse-in-intellectually-disabled-person-history-taking-1",
    "abuse-in-intellectually-disabled-person-history-taking",
    "agitated"
  ]
}
Endpoint
GET /mock-exams/{slug}/station-ids
Description Returns the station slugs that belong to one mock exam. Request
No request body.
Response (200)
{
  "slug": "morning-paper",
  "station_ids": [
    "abuse-in-intellectually-disabled-person-history-taking-1",
    "abuse-in-intellectually-disabled-person-history-taking",
    "agitated"
  ],
  "count": 3
}
Response (422 example)
{
  "detail": "Mock exam not found."
}

Chat (Text)

Endpoint
POST /chat/text
Description Candidate sends a text turn and receives the patient reply, transcript updates, and optional TTS. Request payload
{
  "station": "abuse-in-intellectually-disabled-person-history-taking",
  "messages": [
    {
      "role": "user",
      "content": "Hello, how are you feeling today?"
    }
  ],
  "include_tts": true,
  "eval_mode": "off"
}
Parameter options Response (200)
{
  "reply": "I'm okay, just feeling a bit low.",
  "messages": [
    {
      "role": "user",
      "content": "Hello, how are you feeling today?"
    },
    {
      "role": "assistant",
      "content": "I'm okay, just feeling a bit low."
    }
  ],
  "tts_url": "/media/tts/example.wav",
  "transcript": [
    {
      "role": "candidate",
      "text": "Hello, how are you feeling today?"
    },
    {
      "role": "patient",
      "text": "I'm okay, just feeling a bit low."
    }
  ],
  "session_id": "session_123",
  "metrics": {
    "t_nlp_ms": 812.44,
    "t_tts_ms": 194.12
  },
  "metadata": {
    "provider": "openai",
    "model": "gpt-4o",
    "station_slug": "abuse-in-intellectually-disabled-person-history-taking"
  }
}
Response (422 example)
{
  "detail": "Provide station or station_slug."
}
Response (503 example)
{
  "detail": {
    "message": "tts provider 'openai' failed.",
    "stage": "tts",
    "provider": "openai",
    "error_type": "RuntimeError",
    "error": "Upstream provider unavailable"
  }
}

Chat (Audio Upload)

Endpoint
POST /chat/audio?station=
Description Candidate uploads audio and receives the transcribed candidate turn, patient response, and optional TTS. Content-Type multipart/form-data Form Fields file audio/wav Required 16-bit PCM mono WAV Request example
Query: ?station=
Form data:
  file=@candidate-audio.wav
Parameter options Failure mode Returns 503 when the configured ASR provider and its fallback both reject the uploaded audio bytes. Response (200)
{
  "reply": "I'm sorry to hear that. Can you tell me more about when it started?",
  "transcript": [
    {
      "role": "candidate",
      "text": "I have been feeling on edge recently."
    },
    {
      "role": "patient",
      "text": "I'm sorry to hear that. Can you tell me more about when it started?"
    }
  ],
  "tts_url": "/media/tts/example.wav",
  "session_id": "session_123",
  "metrics": {
    "t_asr_ms": 622.15,
    "t_nlp_ms": 904.33,
    "t_tts_ms": 202.1
  },
  "metadata": {
    "asr_provider": "deepgram",
    "nlp_provider": "openai",
    "tts_provider": "openai",
    "candidate_transcript": "I have been feeling on edge recently."
  }
}
Response (422 example)
{
  "detail": "Provide station or station_slug."
}
Response (503 example)
{
  "detail": {
    "message": "asr provider 'deepgram' failed.",
    "stage": "asr",
    "provider": "deepgram",
    "error_type": "RuntimeError",
    "error": "Invalid audio payload",
    "fallback": {
      "message": "asr provider 'openai' failed.",
      "stage": "asr",
      "provider": "openai",
      "error_type": "RuntimeError",
      "error": "Invalid audio payload"
    }
  }
}

Realtime Websocket

Endpoint
wss://<api-host>/realtime?station_slug=<slug>
Description Public websocket for realtime text/audio turn-taking. No API key is required. Use this single MedicAITutor integration for both Tavus and LiveAvatar: the browser sends candidate text or microphone audio to MedicAITutor, then joins the provider room described by the returned safe transport fields. Recommended shared setup The frontend uses one station list, one MedicAITutor WebSocket, and one provider adapter. Omit `avatar_provider` or send `avatar_provider: "auto"` to resolve through the global `AVATAR_PROVIDER_DEFAULT`; send `tavus` or `liveavatar` to choose explicitly. Older clients may send `provider` as a compatibility alias; if both fields are present, they must match. The server returns the concrete provider in `avatar.provider` and rejects a station-bound request when the selected provider has no approved station-specific ID. `scripts/migrate_station_liveavatar_defaults.py` adds and verifies approved LiveAvatar blocks but does not write a station-level default. A Tavus face is never reused as a LiveAvatar ID. Select `tavus` explicitly for Daily plus private Echo Mode text delivery, or `liveavatar` explicitly for LiveKit plus server-generated affect-aware audio. Provider API keys and control sockets remain server-side. Connection map Provider SDK references

Daily call client and LiveKit track receiving.

Frontend sequence (sender -> destination -> response)

Step 1: load a station

Sender: frontend
Destination: MedicAITutor HTTPS API

Request/action: GET /stations

Response: Published station summaries; store `items[].slug` and do not build a slug from the title.

Example

{
  "items": [
    {
      "slug": "abuse-in-intellectually-disabled-person-history-taking",
      "title": "SUSPECTED ABUSE OR NEGLECT IN AN ADULT WITH LEARNING DISABILITY — COLLATERAL HISTORY",
      "section": "HISTORY TAKING",
      "station_meta": {
        "time_limit_minutes": 7
      }
    }
  ],
  "total": 27
}

Step 2: check the API

Sender: frontend
Destination: MedicAITutor HTTPS API

Request/action: GET /healthz

Response: HTTP 200 with `status: ok`; this checks MedicAITutor only and does not create an avatar session.

Example

GET /healthz HTTP/1.1
Host: api.staging.medicaitutor.com

HTTP/1.1 200 OK
Content-Type: application/json

{"status":"ok"}

Step 3: open the MedicAITutor WebSocket

Sender: frontend
Destination: MedicAITutor WebSocket

Request/action: Open `wss://<api-host>/realtime?station_slug=<slug>`; `station` remains a legacy query alias.

Response: The socket opens. Opening it alone does not start the candidate session.

Example

wss://api.staging.medicaitutor.com/realtime?station_slug=abuse-in-intellectually-disabled-person-history-taking

WebSocket open event -> readyState = OPEN

Step 4: start the session and request an avatar

Sender: frontend
Destination: the open MedicAITutor WebSocket

Request/action: Send `hello` with `include_avatar: true` and `avatar_provider: auto` or an explicit provider.

Response: Receive `hello_ack`, `avatar_session`, then `session_state`. The avatar response contains only safe, short-lived browser transport fields.

Example

LiveAvatar default:

{
  "send": {
    "type": "hello",
    "session_id": null,
    "include_avatar": true,
    "avatar_provider": "auto",
    "station_slug": "abuse-in-intellectually-disabled-person-history-taking"
  },
  "receive": [
    {
      "type": "hello_ack",
      "session_id": "session-123"
    },
    {
      "type": "avatar_session",
      "event_id": "event-2",
      "sequence": 2,
      "session_id": "session-123",
      "avatar": {
        "provider": "liveavatar",
        "status": "created",
        "transport": {
          "type": "livekit",
          "room_url": "https://livekit.example/room-abc",
          "client_token": "short-lived-client-token"
        },
        "capabilities": {
          "candidate_input": [
            "text",
            "audio"
          ],
          "patient_delivery": "audio",
          "affect_control": "audio_prosody",
          "audio_source": "avatar_room"
        }
      }
    },
    {
      "type": "session_state",
      "session_id": "session-123",
      "state": {}
    }
  ]
}

Tavus selected explicitly:

{
  "send": {
    "type": "hello",
    "session_id": null,
    "include_avatar": true,
    "avatar_provider": "tavus",
    "station_slug": "abuse-in-intellectually-disabled-person-history-taking"
  },
  "receive": [
    {
      "type": "hello_ack",
      "session_id": "session-123"
    },
    {
      "type": "avatar_session",
      "event_id": "event-2",
      "sequence": 2,
      "session_id": "session-123",
      "avatar": {
        "provider": "tavus",
        "status": "created",
        "transport": {
          "type": "daily",
          "room_url": "https://tavus.daily.co/room-abc",
          "client_token": "short-lived-client-token"
        },
        "capabilities": {
          "candidate_input": [
            "text",
            "audio"
          ],
          "patient_delivery": "text",
          "affect_control": "text_markup",
          "audio_source": "avatar_room"
        }
      }
    },
    {
      "type": "session_state",
      "session_id": "session-123",
      "state": {}
    }
  ]
}

Step 5: join the selected provider room

Sender: frontend
Destination: the selected provider SDK using the returned transport fields

Request/action: Read `avatar_session.avatar.transport.type`, `room_url`, and `client_token`; do not call provider control APIs from the browser. The wire contract is language-agnostic; the JavaScript example below uses the actual browser SDKs. The one-line forms `Daily.join(...)` and `LiveKit.connect(...)` are conceptual labels, not literal universal function names.

Response: Tavus: `dailyCall.join(...)` resolves and Daily emits `joined-meeting` and remote `track-started` events. LiveAvatar: `liveKitRoom.connect(...)` resolves and LiveKit emits `TrackSubscribed` events. Attach those remote tracks to the video/audio elements and keep this media connection open alongside the MedicAITutor WebSocket.

Example

import Daily from "@daily-co/daily-js";
import { Room, RoomEvent } from "livekit-client";

const transport = avatarSession.avatar.transport;

if (transport.type === "daily") {
  const dailyCall = Daily.createCallObject({
    showLocalVideo: false,
    startVideoOff: true,
    startAudioOff: true
  });

  dailyCall.on("track-started", ({ participant, type, track }) => {
    if (participant?.local || !track) return;
    const media = new MediaStream([track]);
    if (type === "video") videoElement.srcObject = media;
    if (type === "audio") {
      audioElement.srcObject = media;
      audioElement.autoplay = true;
      void audioElement.play();
    }
  });

  await dailyCall.join({
    url: transport.room_url,
    token: transport.client_token
  });
  // Daily emits "joined-meeting" and "track-started" for remote media.
}

if (transport.type === "livekit") {
  const liveKitRoom = new Room({ adaptiveStream: true, dynacast: true });
  liveKitRoom.on(RoomEvent.TrackSubscribed, (track) => {
    const attached = track.attach();
    const elements = Array.isArray(attached) ? attached : [attached];
    for (const element of elements) mediaContainer.appendChild(element);
  });
  liveKitRoom.on(RoomEvent.TrackUnsubscribed, (track) => track.detach());

  await liveKitRoom.connect(
    transport.room_url,
    transport.client_token
  );
  // If autoplay is blocked, call liveKitRoom.startAudio() from a user gesture.
}

Step 6: send a typed question

Sender: frontend
Destination: the same MedicAITutor WebSocket

Request/action: Send a `candidate_text` message containing the candidate's question.

Response: Receive `stt_final`, `assistant_text`, avatar delivery when enabled, and `session_state`; turn events share a `turn_id`.

Example

{
  "send": {
    "type": "candidate_text",
    "text": "Can you tell me what has been worrying you recently?"
  },
  "receive": [
    {
      "type": "stt_final",
      "event_id": "event-4",
      "sequence": 4,
      "session_id": "session-123",
      "turn_id": "turn-0001",
      "text": "Can you tell me what has been worrying you recently?"
    },
    {
      "type": "assistant_text",
      "event_id": "event-5",
      "sequence": 5,
      "session_id": "session-123",
      "turn_id": "turn-0001",
      "text": "I have been feeling on edge and sleeping badly.",
      "affect": {
        "label": "sad",
        "confidence": 0.72,
        "source": "server"
      }
    }
  ]
}

Step 7: send a recorded question

Sender: frontend
Destination: the same MedicAITutor WebSocket

Request/action: Send `audio_config`, one or more base64 `audio_chunk` messages, then `audio_end`.

Response: Receive `audio_config_ack`, optional `stt_partial` events, then `stt_final`, the patient-turn events, and `session_state`.

Example

{
  "send": [
    {
      "type": "audio_config",
      "format": "pcm_s16le",
      "sample_rate_hz": 16000,
      "channels": 1
    },
    {
      "type": "audio_chunk",
      "data_b64": "<base64 pcm_s16le mono chunk>"
    },
    {
      "type": "audio_end"
    }
  ],
  "receive": [
    {
      "type": "audio_config_ack",
      "format": "pcm_s16le"
    },
    {
      "type": "stt_partial",
      "text": "Can you tell me..."
    },
    {
      "type": "stt_final",
      "turn_id": "turn-0002",
      "text": "Can you tell me what happened last night?"
    }
  ]
}

Step 7a: interrupt an active patient turn

Sender: frontend
Destination: the same MedicAITutor WebSocket

Request/action: When local voice-activity detection detects candidate speech while the patient is responding, send an interrupt before or alongside the new audio. Use the active `turn_id` from the latest `assistant_text` event.

Response: Receive `turn_interrupted`; stop locally playing TTS audio and continue sending the candidate audio. Keep the MedicAITutor WebSocket and provider room connected. Treat `interrupted: true` as the success flag; `tts_cancelled` and `avatar_cancelled` report provider cancellation and may be false when a provider has no separate cancellation hook. A stale turn receives `turn_interrupt_ignored` and does not cancel a newer turn.

Example

{
  "send": {
    "type": "interrupt",
    "turn_id": "turn-0001",
    "reason": "candidate_started"
  },
  "receive": {
    "type": "turn_interrupted",
    "event_id": "event-13",
    "sequence": 13,
    "session_id": "session-123",
    "turn_id": "turn-0001",
    "reason": "candidate_started",
    "interrupted": true,
    "tts_cancelled": true,
    "avatar_cancelled": true
  }
}

Step 8: deliver the patient turn to the provider

Sender: MedicAITutor, then the frontend for Tavus
Destination: Tavus Daily for Echo Mode, or the server-side LiveAvatar session

Request/action: Use the `avatar_response` delivery instructions; the browser sends a provider message only for Tavus.

Response: The provider room delivers the remote avatar media. LiveAvatar receives affect-aware audio from MedicAITutor and the browser sends no provider command.

Example

{
  "tavus": {
    "direction": "frontend -> Daily",
    "method": "sendAppMessage",
    "payload": {
      "message_type": "conversation",
      "event_type": "conversation.echo",
      "conversation_id": "conversation-456",
      "properties": {
        "modality": "text",
        "text": "<emotion value=\"sad\"/> I have been feeling low.",
        "done": true
      }
    }
  },
  "liveavatar": {
    "direction": "MedicAITutor -> LiveAvatar",
    "method": "server submits affect-aware audio",
    "browser_action": "none; keep listening to the LiveKit room"
  }
}

Browser action:

// dailyCall is the Daily call object created in the room bootstrap step.
if (
  avatarResponse.avatar.provider === "tavus" &&
  avatarResponse.delivery?.status === "sent"
) {
  dailyCall.sendAppMessage(avatarResponse.delivery.payload, "*");
}

// LiveAvatar: send no provider payload from the browser.
// MedicAITutor has already submitted affect-aware audio server-side.
// Keep liveKitRoom connected and render its remote tracks.

Step 9: render the result

Sender: MedicAITutor and the selected provider room
Destination: the frontend UI

Request/action: Render `assistant_text.text`; use `affect`, `delivery`, and `audio_source` only to drive diagnostics and media playback.

Response: The UI shows plain patient text and plays exactly one declared audio source; provider markup is never shown as transcript text.

Example

appendPatientMessage(assistantText.text); // plain text only
showDiagnostics({
  affect: assistantText.affect,
  delivery: avatarResponse.delivery
});

if (avatarResponse.delivery?.audio_source === "avatar_room") {
  // Daily or LiveKit is already supplying the audio. Do not play TTS chunks.
}

Step 10: end the session cleanly

Sender: frontend
Destination: the same MedicAITutor WebSocket, then the provider room

Request/action: Send `end` and wait before closing either connection.

Response: Receive completed `session_state`, then `avatar_session_closed`; only then disconnect the provider room and close the WebSocket.

Example

{
  "send": {
    "type": "end",
    "reason": "candidate_ended"
  },
  "receive": [
    {
      "type": "session_state",
      "event_id": "event-30",
      "sequence": 30,
      "session_id": "session-123",
      "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
      "status": "completed"
    },
    {
      "type": "avatar_session_closed",
      "event_id": "event-31",
      "sequence": 31,
      "session_id": "session-123",
      "avatar": {
        "provider": "tavus",
        "status": "closed"
      }
    }
  ]
}

Step 11: handle a public error

Sender: MedicAITutor
Destination: the frontend over the same WebSocket

Request/action: Listen for an `error` event and match it by `event_id`, `sequence`, and `turn_id` when present.

Response: Receive a public code and message; keep any already-received plain patient text while internal provider details remain server-side.

Example

{
  "type": "error",
  "event_id": "event-40",
  "sequence": 40,
  "session_id": "session-123",
  "code": "empty_transcript",
  "message": "No speech was detected for this turn."
}
Query options Referenced tutor mode Send a top-level `mode: tutor` in hello/start for teaching over text or audio. Realtime tutor and /ask share the core writing instructions, evidence service and answer-depth rules: up to five statements/180 words by default, or twelve statements/500 words for an explicit request for detail. Both retain the user topic for a follow-up such as 'give me a much fuller answer'; send history with /ask, while realtime retains tutor history outside the scored patient transcript. An explicit new topic controls retrieval even in an unrelated station. Each tutor turn also has a server-assigned response_mode. Casual turns bypass clinical retrieval. Eligible tutor requests use the same bounded general-explanation fallback as /ask when evidence is insufficient, retrieval fails or a cited answer cannot be validated. Explicit source-only requests, personal prescribing and conflicting evidence do not cross this boundary. Realtime events retain detailed evidence metadata; /ask returns answer and evidence with status, citations, answer_outcome and disclosure. Omit mode for the simulated patient, whose shorter replies and scoring behavior are unchanged. Tutor startup requires EVIDENCE_ENABLED; otherwise it returns evidence_disabled. Use a new session when switching modes. Repeated hello/start on an active connection returns already_started. Both /ask and realtime tutor resolve clear clinical shorthand and typos before retrieval, using bounded term interpretation and a meaning check. For example, 'fronto temp dementia' can resolve to frontotemporal dementia. Ambiguous terms such as MS without clarifying context receive a clarification question. Original wording and interpretation are audited internally; safety checks precede interpretation and also check the accepted wording. This adds no public fields and does not establish evidence support. Illustrative tutor exchange (not a clinical answer; hello_ack, session_state, stt_final and audio events omitted):
{
  "hello": {
    "type": "hello",
    "mode": "tutor",
    "include_avatar": false
  },
  "send": {
    "type": "user_text",
    "text": "Explain the assessment approach for psychosis."
  },
  "receive": [
    {
      "type": "assistant_citations",
      "event_id": "event-example-3",
      "sequence": 3,
      "session_id": "session-example",
      "turn_id": "turn-0001",
      "mode": "tutor",
      "response_mode": "clinical",
      "interaction_id": 123,
      "evidence": {
        "status": "supported",
        "corpus_version": "<corpus SHA-256>",
        "policy_version": "evidence-v1",
        "reason": null,
        "retrieval_mode": "hybrid",
        "retrieval_ms": 4.2,
        "semantic_ms": 85.4,
        "validation_ms": 530.0,
        "citations": [
          {
            "number": 1,
            "source_id": "example-book",
            "passage_id": "<passage ID>",
            "title": "Example textbook",
            "kind": "textbook",
            "edition": "2nd",
            "pdf_page": 42,
            "page_label": "30",
            "section": "Assessment",
            "url": null,
            "source_sha256": "<source SHA-256>"
          }
        ]
      }
    },
    {
      "type": "assistant_text",
      "event_id": "event-example-4",
      "sequence": 4,
      "session_id": "session-example",
      "turn_id": "turn-0001",
      "mode": "tutor",
      "response_mode": "clinical",
      "text": "A concise explanation supported by the retrieved source. [1]"
    }
  ]
}
Join assistant_citations to assistant_text using session_id and turn_id. Citations arrive before the corresponding text; display the numbered Sources list only for supported evidence. Sources and citation markers are never spoken. Audio input uses the existing audio_chunk/commit_turn events. Set include_avatar=true and avatar_provider=liveavatar to use the existing avatar delivery. The same interrupt event cancels evidence generation, TTS and avatar output; discard subsequent output for interrupted turns. Tutor interactions are saved separately from the scored patient transcript. Patient mode does not retrieve sources or emit citations. Evidence retrieval is hybrid when semantic embeddings are enabled and falls back to FTS5 if that path is unavailable. See the source and citation guide for approval and activation requirements. Client hello/start payload
{
  "type": "hello",
  "session_id": null,
  "candidate_id": "candidate-1",
  "include_avatar": true,
  "avatar_provider": "tavus",
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "metadata": {
    "mode": "exam"
  }
}
Client event types Audio config example
{
  "type": "audio_config",
  "format": "pcm_s16le"
}
Audio chunk example
{
  "type": "audio_chunk",
  "data_b64": ""
}
Server event types hello_ack example
{
  "type": "hello_ack",
  "event_id": "event_001",
  "sequence": 1,
  "session_id": "session_123",
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "audio_supported": true
}
assistant_text example
{
  "type": "assistant_text",
  "event_id": "event_005",
  "sequence": 5,
  "session_id": "session_123",
  "turn_id": "turn_0001",
  "text": "I keep hearing voices at night.",
  "provider": "openai",
  "model": "gpt-5-mini",
  "affect": {
    "label": "scared",
    "confidence": 0.72,
    "source": "server"
  }
}
Provider bootstrap details avatar_response example
{
  "type": "avatar_response",
  "event_id": "event_006",
  "sequence": 6,
  "session_id": "session_123",
  "turn_id": "turn_0001",
  "text": "I keep hearing voices at night.",
  "affect": {
    "label": "scared",
    "confidence": 0.72,
    "source": "server"
  },
  "delivery": {
    "status": "sent",
    "provider": "tavus",
    "protocol": "daily_app_message",
    "audio_source": "avatar_room",
    "payload": {
      "message_type": "conversation",
      "event_type": "conversation.echo",
      "conversation_id": "conversation_123",
      "properties": {
        "modality": "text",
        "text": " I keep hearing voices at night.",
        "done": true
      }
    }
  }
}
tts_audio_chunk example
{
  "type": "tts_audio_chunk",
  "event_id": "event_007",
  "sequence": 7,
  "session_id": "session_123",
  "turn_id": "turn_0001",
  "data_b64": "",
  "content_type": "audio/mpeg",
  "audio_source": "tts_chunks",
  "is_last": false
}
session_state example
{
  "type": "session_state",
  "event_id": "event_008",
  "sequence": 8,
  "session_id": "session_123",
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "status": "active",
  "turn_count": 2,
  "state": {}
}
Response (1008 / missing station example)
{
  "type": "error",
  "code": "missing_station",
  "message": "Provide ?station_slug=; legacy ?station= is also accepted."
}
Response (1013 / rate limit example)
{
  "type": "error",
  "code": "rate_limited",
  "message": "Too many websocket sessions from this client."
}
Response (422 example)
{
  "type": "error",
  "code": "empty_transcript",
  "message": "No speech was detected for this turn."
}
Response (1011 / turn failure example)
{
  "type": "error",
  "code": "turn_failed",
  "message": "Upstream provider unavailable"
}

Live Provider Defaults

Purpose Change the live ASR, NLP, and TTS defaults once, and the stack uses those selections across chat, audio, and websocket flows. Selectable providers Read current defaults
GET /admin/provider-defaults
Update live defaults
PUT /admin/provider-defaults
Update request payload
{
  "asr_provider": "deepgram",
  "nlp_provider": "openai",
  "tts_provider": "openai",
  "actor": "admin",
  "note": "Switch production defaults after smoke test.",
  "source": "admin_ui"
}
Update response (200)
{
  "defaults": {
    "asr": {
      "category": "asr",
      "provider_name": "deepgram"
    },
    "nlp": {
      "category": "nlp",
      "provider_name": "openai"
    },
    "tts": {
      "category": "tts",
      "provider_name": "openai"
    }
  },
  "supported": {
    "asr": [
      "faster_whisper",
      "whisper",
      "openai",
      "deepgram",
      "elevenlabs",
      "azure",
      "aws_transcribe_medical",
      "parakeet_stream",
      "multitalker_parakeet"
    ],
    "nlp": [
      "openai"
    ],
    "tts": [
      "elevenlabs",
      "azure",
      "deepgram",
      "openai",
      "polly"
    ]
  },
  "updated": true
}
Response (401 example)
{
  "detail": "Invalid API key."
}
Response (422 example)
{
  "detail": [
    {
      "loc": [
        "body",
        "nlp_provider"
      ],
      "msg": "Input should be 'openai'",
      "type": "literal_error"
    }
  ]
}
Audit log
GET /admin/provider-defaults/audit?limit=25
Runtime status
GET /providers/status
Advanced diagnostics
These routes still exist for direct provider inspection:
GET /asr/faster_whisper
POST /asr/faster_whisper/batch
GET /tts/openai
POST /tts/openai/speak
GET /nlp/openai
POST /nlp/openai/simulated-patient

Sessions

Endpoint
POST /session/start
Description Starts a new OSCE session for a chosen station. Request payload
{
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "candidate_id": "candidate-1",
  "session_id": "session_123"
}
Response (200)
{
  "session_id": "session_123"
}
Endpoint
POST /sessions
Description Creates a backend session record directly when you want the lower-level sessions API. Endpoint
GET /sessions
Description Lists session summaries. Response (200)
{
  "items": [
    {
      "session_id": "session_123",
      "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
      "turn_count": 4
    }
  ],
  "total": 1
}
Endpoint
GET /sessions/{session_id}
Description Returns the transcript, timestamps, and current station state. Response (200)
{
  "session_id": "session_123",
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "transcript": [
    {
      "role": "candidate",
      "text": "What brought you in today?"
    },
    {
      "role": "patient",
      "text": "I have been anxious for months."
    }
  ]
}
Endpoint
POST /session/end
Description Closes the session and returns the final examiner summary with the full evaluation. The grade is produced exactly as by /evaluate: send session_id alone and the server grades its own record (recommended); include transcript only with transcript_complete: true, otherwise a transcript that differs from the server's record is withheld with 409 evaluation_withheld (see the Evaluation section for the reasons). Send this once when the candidate finishes; a realtime client should send the websocket end event or this request, not reopen its connection afterwards. Request payload
{
  "session_id": "session_123",
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "reason": "candidate_finished"
}
Response (200)
{
  "session_id": "session_123",
  "overall_band": "PASS",
  "tips": [
    "Explore risk earlier.",
    "Summarize more explicitly before closing."
  ],
  "evaluation": {
    "overall_rating": "PASS"
  }
}
Response (422 example)
{
  "detail": "A transcript or session_id is required."
}

Realtime Websocket (Internal)

Endpoint
GET /ws/station/{station_slug}/session
Description Lower-level internal websocket. Requires API key auth. Uses the same orchestration engine as `/realtime`, but preserves the older internal event names. Auth Requires x-api-key header or api_key query parameter when API auth is enabled. Client event types Server event types final_transcript example
{
  "type": "final_transcript",
  "text": "Can you tell me what happened last night?"
}
patient_response_text example
{
  "type": "patient_response_text",
  "event_id": "event_005",
  "sequence": 5,
  "session_id": "session_123",
  "turn_id": "turn_0001",
  "text": "I had to get out of the flat because the voices were getting too much.",
  "provider": "openai",
  "model": "gpt-5-mini",
  "affect": {
    "label": "scared",
    "confidence": 0.72,
    "source": "server"
  }
}
Response (401 example)
{
  "type": "error",
  "code": "unauthorized",
  "message": "Invalid API key."
}

Evaluation

Endpoint
POST /evaluate
Description Grades a consultation and returns the full examiner-scoring payload. Version 2 stations are graded only from a complete transcript and never return a partial or zero grade for an incomplete one, so which request shape you send decides what is graded. Three valid request shapes 1. session_id only (recommended for live sessions): the server grades its own record of the conversation and vouches for its completeness. Nothing else is needed. 2. transcript with transcript_complete: true: your copy of the conversation is graded as declared. 3. session_id and transcript together: your transcript is graded (it takes precedence over the server record); session_id links the result to the session and applies any problem the server recorded, for example a reply lost when the realtime connection dropped. A transcript sent without transcript_complete is graded only if it equals the server's record exactly; otherwise the grade is withheld with 409 evaluation_withheld. Sending only the turns your client happened to receive, without the declaration, is the most common integration mistake. Request payload (live session)
{
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "session_id": "session_123",
  "feedback_mode": "examiner"
}
Request payload (client transcript)
{
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "transcript": [
    {
      "role": "candidate",
      "text": "What brought you in today?"
    },
    {
      "role": "patient",
      "text": "I have been anxious for months."
    }
  ],
  "transcript_complete": true,
  "feedback_mode": "examiner"
}
Response (200)
{
  "overall_rating": "PASS",
  "total_score": 0.71,
  "domain_scores": [
    {
      "label": "History and symptom exploration",
      "rating": "Good",
      "score": 0.75,
      "rationale": "Explored the main anxiety symptoms and time course clearly.",
      "evidence": [
        "Clarified chronic course of anxiety",
        "Asked about impairment across settings"
      ]
    }
  ],
  "strengths": [
    "Good structure overall."
  ],
  "missed_points": [
    "Risk assessment needed more depth."
  ],
  "feedback": [
    "Good structure overall.",
    "Risk assessment needed more depth."
  ],
  "critical_failures": []
}
Response (409, grade withheld)
{
  "detail": {
    "code": "evaluation_withheld",
    "reason": "transcript_completeness_not_confirmed",
    "message": "Assessment requires review; no numerical result has been published."
  }
}
detail.reason values: transcript_completeness_not_confirmed (a transcript was sent without transcript_complete: true and differs from the server's record, or the record has no candidate turn); transcript_recording_incomplete (the server recorded a problem in this session); grading_evidence_validation_failed; one_or_more_domains_not_observable. Show detail.message to the candidate and do not retry with the same request; a 503 with reason grading_provider_unavailable is the only case worth retrying later. Response (422 example)
{
  "detail": "A transcript or session_id is required."
}
Endpoint
POST /evaluation/score
Description Scores the session transcript using the station rubric and returns the examiner view. Request payload
{
  "station_slug": "abuse-in-intellectually-disabled-person-history-taking",
  "transcript": [
    {
      "role": "candidate",
      "text": "What brought you in today?"
    },
    {
      "role": "patient",
      "text": "I have been anxious for months."
    }
  ]
}
Response (200)
{
  "overall_rating": "PASS",
  "total_score": 0.71,
  "feedback": [
    "Improve: Explore risk and safety more explicitly.",
    "Use open questions early, then narrow into the key diagnosis."
  ]
}
Response (422 example)
{
  "detail": "station_slug is required."
}

Complete Endpoint Catalog

Authoritative catalog generated from the live OpenAPI schema. Routes intentionally hidden from the public guide are excluded here. Expand any card for exact request bodies, parameters, and documented responses.

Asr

POST/asr/batch

Batch Transcribe

Request payload (multipart/form-data)
{
  "audio": ""
}
Response (200)
{
  "transcript": "",
  "segments": [
    {
      "start": 0.0,
      "end": 0.0,
      "text": "",
      "confidence": 0.0,
      "is_final": true
    }
  ],
  "provider": "",
  "model": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/asr/{provider}

Get Provider Status

Parameters
NameInRequiredTypeDescription
providerpathYesstringASR provider name. Options: faster_whisper, whisper, openai, deepgram, elevenlabs, azure, aws_transcribe_medical, parakeet_stream, multitalker_parakeet.
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/asr/{provider}/batch

Batch Transcribe Provider

Parameters
NameInRequiredTypeDescription
providerpathYesstringASR provider name. Options: faster_whisper, whisper, openai, deepgram, elevenlabs, azure, aws_transcribe_medical, parakeet_stream, multitalker_parakeet.
Request payload (multipart/form-data)
{
  "audio": ""
}
Response (200)
{
  "transcript": "",
  "segments": [
    {
      "start": 0.0,
      "end": 0.0,
      "text": "",
      "confidence": 0.0,
      "is_final": true
    }
  ],
  "provider": "",
  "model": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}

Avatar

GET/avatar/jobs/{job_id}

Get Avatar Job

Parameters
NameInRequiredTypeDescription
job_idpathYesstring
avatar_providerqueryNostring
Response (200)
{
  "provider": "did",
  "mode": "",
  "status": "created",
  "session_id": "",
  "vendor_session_id": "",
  "job_id": "",
  "stream_url": "",
  "video_url": "",
  "thumbnail_url": "",
  "token": "",
  "expires_at": "",
  "capabilities": {
    "provider": "did",
    "supports_live_session": true,
    "supports_async_render": true,
    "requires_client_sdk": true,
    "requires_webrtc": true,
    "supports_text_input": true,
    "supports_audio_input": true,
    "candidate_input": [
      "text"
    ],
    "patient_delivery": "text",
    "affect_control": "none",
    "audio_source": "avatar_room",
    "enabled": true,
    "healthy": true,
    "availability": "available",
    "detail": ""
  },
  "transport": {
    "type": "",
    "room_url": "",
    "client_token": ""
  },
  "avatar_selection": {
    "provider": "did",
    "persona_role": "",
    "pal_role": "patient",
    "face_id": "",
    "avatar_id": "",
    "display_name": ""
  },
  "participant": {
    "display_name": "",
    "role": ""
  },
  "metadata": {},
  "error": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/avatar/providers/status

Avatar Provider Status

Response (200)
{
  "providers": [
    {
      "provider": "did",
      "capabilities": {
        "provider": "did",
        "supports_live_session": true,
        "supports_async_render": true,
        "requires_client_sdk": true,
        "requires_webrtc": true,
        "supports_text_input": true,
        "supports_audio_input": true,
        "candidate_input": [
          "text"
        ],
        "patient_delivery": "text",
        "affect_control": "none",
        "audio_source": "avatar_room",
        "enabled": true,
        "healthy": true,
        "availability": "available",
        "detail": ""
      }
    }
  ]
}
POST/avatar/render

Create Avatar Render

Request payload (application/json)
{
  "avatar_provider": "did",
  "session_id": "",
  "station_slug": "",
  "text": "",
  "audio_url": "",
  "avatar_id": "",
  "voice_id": "",
  "metadata": {}
}
Response (200)
{
  "provider": "did",
  "mode": "",
  "status": "created",
  "session_id": "",
  "vendor_session_id": "",
  "job_id": "",
  "stream_url": "",
  "video_url": "",
  "thumbnail_url": "",
  "token": "",
  "expires_at": "",
  "capabilities": {
    "provider": "did",
    "supports_live_session": true,
    "supports_async_render": true,
    "requires_client_sdk": true,
    "requires_webrtc": true,
    "supports_text_input": true,
    "supports_audio_input": true,
    "candidate_input": [
      "text"
    ],
    "patient_delivery": "text",
    "affect_control": "none",
    "audio_source": "avatar_room",
    "enabled": true,
    "healthy": true,
    "availability": "available",
    "detail": ""
  },
  "transport": {
    "type": "",
    "room_url": "",
    "client_token": ""
  },
  "avatar_selection": {
    "provider": "did",
    "persona_role": "",
    "pal_role": "patient",
    "face_id": "",
    "avatar_id": "",
    "display_name": ""
  },
  "participant": {
    "display_name": "",
    "role": ""
  },
  "metadata": {},
  "error": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/avatar/session

Create Avatar Session

Request payload (application/json)
{
  "avatar_provider": "did",
  "station_slug": "",
  "session_id": "",
  "avatar_id": "",
  "voice_id": "",
  "metadata": {}
}
Response (200)
{
  "provider": "did",
  "mode": "",
  "status": "created",
  "session_id": "",
  "vendor_session_id": "",
  "job_id": "",
  "stream_url": "",
  "video_url": "",
  "thumbnail_url": "",
  "token": "",
  "expires_at": "",
  "capabilities": {
    "provider": "did",
    "supports_live_session": true,
    "supports_async_render": true,
    "requires_client_sdk": true,
    "requires_webrtc": true,
    "supports_text_input": true,
    "supports_audio_input": true,
    "candidate_input": [
      "text"
    ],
    "patient_delivery": "text",
    "affect_control": "none",
    "audio_source": "avatar_room",
    "enabled": true,
    "healthy": true,
    "availability": "available",
    "detail": ""
  },
  "transport": {
    "type": "",
    "room_url": "",
    "client_token": ""
  },
  "avatar_selection": {
    "provider": "did",
    "persona_role": "",
    "pal_role": "patient",
    "face_id": "",
    "avatar_id": "",
    "display_name": ""
  },
  "participant": {
    "display_name": "",
    "role": ""
  },
  "metadata": {},
  "error": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
DELETE/avatar/session/{session_id}

Close Avatar Session

Parameters
NameInRequiredTypeDescription
session_idpathYesstring
avatar_providerqueryNostring
Response (200)
{
  "provider": "did",
  "mode": "",
  "status": "created",
  "session_id": "",
  "vendor_session_id": "",
  "job_id": "",
  "stream_url": "",
  "video_url": "",
  "thumbnail_url": "",
  "token": "",
  "expires_at": "",
  "capabilities": {
    "provider": "did",
    "supports_live_session": true,
    "supports_async_render": true,
    "requires_client_sdk": true,
    "requires_webrtc": true,
    "supports_text_input": true,
    "supports_audio_input": true,
    "candidate_input": [
      "text"
    ],
    "patient_delivery": "text",
    "affect_control": "none",
    "audio_source": "avatar_room",
    "enabled": true,
    "healthy": true,
    "availability": "available",
    "detail": ""
  },
  "transport": {
    "type": "",
    "room_url": "",
    "client_token": ""
  },
  "avatar_selection": {
    "provider": "did",
    "persona_role": "",
    "pal_role": "patient",
    "face_id": "",
    "avatar_id": "",
    "display_name": ""
  },
  "participant": {
    "display_name": "",
    "role": ""
  },
  "metadata": {},
  "error": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}

Evaluation

POST/evaluation/score

Score Session

Request payload (application/json)
{
  "station_slug": "",
  "session_id": "",
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "mode": "",
  "transcript_complete": true
}
Response (200)
{
  "overall_rating": "",
  "total_score": 0.0,
  "score_percent": 0.0,
  "domain_scores": [
    {
      "label": "",
      "rating": "",
      "score": 0.0,
      "rationale": "",
      "evidence": [
        ""
      ]
    }
  ],
  "strengths": [
    ""
  ],
  "missed_points": [
    ""
  ],
  "feedback": [
    ""
  ],
  "critical_failures": [
    {
      "label": "",
      "rationale": ""
    }
  ],
  "performance_breakdown": {
    "strongest_domains": [
      ""
    ],
    "improvement_domains": [
      ""
    ],
    "domains": [
      {
        "label": "",
        "rating": "",
        "score": 0.0,
        "score_percent": 0.0,
        "rationale": "",
        "evidence": [
          ""
        ],
        "strength": true,
        "improvement_priority": true
      }
    ]
  },
  "learning_explanation": "",
  "learning_evidence": {
    "citations": [],
    "policy_version": "evidence-v1",
    "retrieval_mode": "lexical",
    "retrieval_ms": 0,
    "semantic_ms": 0,
    "status": "disabled",
    "validation_ms": 0
  },
  "grading_metadata": {}
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}

Nlp

POST/nlp/simulated-patient

Simulated Patient

Request payload (application/json)
{
  "station_slug": "",
  "candidate_message": "",
  "conversation_history": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "session_id": ""
}
Response (200)
{
  "patient_response": "",
  "state": {
    "distress_level": "",
    "handoff_required": true,
    "end_status": "",
    "disclosed_items": [
      ""
    ],
    "rapport_level": 0,
    "turn_index": 0,
    "topics_covered": [
      ""
    ],
    "last_candidate_intent": "",
    "last_patient_focus": "",
    "facts_revealed_by_topic": {},
    "conversation_summary": [
      ""
    ],
    "recent_candidate_themes": [
      ""
    ],
    "reply_style": "",
    "notes": {}
  },
  "provider": "",
  "model": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/nlp/{provider}

Get Provider Status

Parameters
NameInRequiredTypeDescription
providerpathYesstringNLP provider name. Options: openai.
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/nlp/{provider}/simulated-patient

Simulated Patient Provider

Parameters
NameInRequiredTypeDescription
providerpathYesstring
Request payload (application/json)
{
  "station_slug": "",
  "candidate_message": "",
  "conversation_history": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "session_id": ""
}
Response (200)
{
  "patient_response": "",
  "state": {
    "distress_level": "",
    "handoff_required": true,
    "end_status": "",
    "disclosed_items": [
      ""
    ],
    "rapport_level": 0,
    "turn_index": 0,
    "topics_covered": [
      ""
    ],
    "last_candidate_intent": "",
    "last_patient_focus": "",
    "facts_revealed_by_topic": {},
    "conversation_summary": [
      ""
    ],
    "recent_candidate_themes": [
      ""
    ],
    "reply_style": "",
    "notes": {}
  },
  "provider": "",
  "model": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}

Public Api

GET/

Root

Response (200)
{}
POST/ask

Public Ask

Request payload (application/json)
{
  "text": "",
  "station_slug": "",
  "session_id": "",
  "candidate_id": "",
  "category": "",
  "exam_slug": "",
  "feedback_text": "",
  "history": [
    {
      "role": "candidate",
      "text": "",
      "speaker": "candidate",
      "content": ""
    }
  ],
  "generate_ai_response": true,
  "message": ""
}
Response (200)
{
  "answer": "",
  "evidence": {
    "status": "verified",
    "citations": [
      {
        "number": 0,
        "title": "",
        "edition": "",
        "publication_year": 0,
        "section": "",
        "pdf_page": 0,
        "page_label": "",
        "url": ""
      }
    ],
    "answer_outcome": "evidence_backed",
    "disclosure": "",
    "answer_source": "approved_sources",
    "reference_note": "",
    "retrieval_status": "not_requested",
    "requested_authority_verified": true,
    "validation": "not_run",
    "general_coverage": "complete",
    "plan_version": ""
  }
}
Response (422)
{
  "detail": "Provide text, message, feedback_text, audio, or documents."
}
GET/attempts

Public List Attempts

Parameters
NameInRequiredTypeDescription
candidate_idqueryNostring
datequeryNostring
limitqueryNointeger
Response (200)
{
  "items": [
    {
      "attempt_id": "",
      "candidate_id": "",
      "attempt_type": "",
      "exam_slug": "",
      "status": "active",
      "started_at": "",
      "ended_at": "",
      "attempt_date": "",
      "station_slugs": [
        ""
      ],
      "s3_prefix": "",
      "summary": {},
      "metadata": {}
    }
  ],
  "total": 0
}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/attempts/start

Public Attempt Start

Request payload (application/json)
{
  "candidate_id": "",
  "attempt_id": "",
  "attempt_type": "single_station",
  "exam_slug": "",
  "station_slugs": [
    ""
  ],
  "metadata": {}
}
Response (200)
{
  "attempt": {
    "attempt_id": "",
    "candidate_id": "",
    "attempt_type": "",
    "exam_slug": "",
    "status": "active",
    "started_at": "",
    "ended_at": "",
    "attempt_date": "",
    "station_slugs": [
      ""
    ],
    "s3_prefix": "",
    "summary": {},
    "metadata": {}
  },
  "date_index_key": "",
  "manifest_key": "",
  "summary_key": "",
  "bucket": "",
  "media_prefix": "",
  "date_index_s3_uri": "",
  "manifest_s3_uri": "",
  "summary_s3_uri": ""
}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/attempts/{attempt_id}

Public Get Attempt

Parameters
NameInRequiredTypeDescription
attempt_idpathYesstring
Response (200)
{}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/candidates/{candidate_id}/attempts

Public List Candidate Attempts

Parameters
NameInRequiredTypeDescription
candidate_idpathYesstring
datequeryNostring
limitqueryNointeger
Response (200)
{
  "items": [
    {
      "attempt_id": "",
      "candidate_id": "",
      "attempt_type": "",
      "exam_slug": "",
      "status": "active",
      "started_at": "",
      "ended_at": "",
      "attempt_date": "",
      "station_slugs": [
        ""
      ],
      "s3_prefix": "",
      "summary": {},
      "metadata": {}
    }
  ],
  "total": 0
}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/chat/audio

Public Chat Audio

Parameters
NameInRequiredTypeDescription
stationqueryNostring
session_idqueryNostring
Request payload (multipart/form-data)
{
  "station_slug": "",
  "candidate_id": "",
  "file": "",
  "include_avatar": "",
  "avatar_provider": "did",
  "provider": "did"
}
Response (200)
{
  "reply": "",
  "messages": [
    {
      "role": "user",
      "content": ""
    }
  ],
  "speaker": {
    "display_name": "",
    "role": ""
  },
  "turn_id": "",
  "affect": {
    "label": "",
    "confidence": 0.0,
    "source": ""
  },
  "tts_url": "",
  "avatar": {
    "provider": "did",
    "mode": "",
    "status": "created",
    "session_id": "",
    "vendor_session_id": "",
    "job_id": "",
    "stream_url": "",
    "video_url": "",
    "thumbnail_url": "",
    "token": "",
    "expires_at": "",
    "capabilities": {
      "provider": "did",
      "supports_live_session": true,
      "supports_async_render": true,
      "requires_client_sdk": true,
      "requires_webrtc": true,
      "supports_text_input": true,
      "supports_audio_input": true,
      "candidate_input": [
        "text"
      ],
      "patient_delivery": "text",
      "affect_control": "none",
      "audio_source": "avatar_room",
      "enabled": true,
      "healthy": true,
      "availability": "available",
      "detail": ""
    },
    "transport": {
      "type": "",
      "room_url": "",
      "client_token": ""
    },
    "avatar_selection": {
      "provider": "did",
      "persona_role": "",
      "pal_role": "patient",
      "face_id": "",
      "avatar_id": "",
      "display_name": ""
    },
    "participant": {
      "display_name": "",
      "role": ""
    },
    "metadata": {},
    "error": ""
  },
  "error": "",
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "evaluation": {
    "overall_rating": "",
    "total_score": 0.0,
    "score_percent": 0.0,
    "domain_scores": [
      {
        "label": "",
        "rating": "",
        "score": 0.0,
        "rationale": "",
        "evidence": [
          ""
        ]
      }
    ],
    "strengths": [
      ""
    ],
    "missed_points": [
      ""
    ],
    "feedback": [
      ""
    ],
    "critical_failures": [
      {
        "label": "",
        "rationale": ""
      }
    ],
    "performance_breakdown": {
      "strongest_domains": [
        ""
      ],
      "improvement_domains": [
        ""
      ],
      "domains": [
        {}
      ]
    },
    "learning_explanation": "",
    "learning_evidence": {
      "citations": [],
      "policy_version": "evidence-v1",
      "retrieval_mode": "lexical",
      "retrieval_ms": 0,
      "semantic_ms": 0,
      "status": "disabled",
      "validation_ms": 0
    },
    "grading_metadata": {}
  },
  "feedback": [
    ""
  ],
  "session_id": "",
  "metrics": {},
  "metadata": {}
}
Response (422)
{
  "detail": "Provide station or station_slug."
}
Response (503)
{
  "detail": {
    "message": "asr provider 'deepgram' failed.",
    "stage": "asr",
    "provider": "deepgram",
    "error_type": "RuntimeError",
    "error": "Invalid audio payload",
    "fallback": {
      "message": "asr provider 'openai' failed.",
      "stage": "asr",
      "provider": "openai",
      "error_type": "RuntimeError",
      "error": "Invalid audio payload"
    }
  }
}
POST/chat/text

Public Chat Text

Request payload (application/json)
{
  "avatar_provider": "did",
  "station": "",
  "station_slug": "",
  "session_id": "",
  "candidate_id": "",
  "messages": [
    {
      "role": "user",
      "content": ""
    }
  ],
  "user_input": "",
  "include_tts": true,
  "include_avatar": true,
  "dry_run": true,
  "eval_mode": "",
  "feedback_mode": ""
}
Response (200)
{
  "reply": "",
  "messages": [
    {
      "role": "user",
      "content": ""
    }
  ],
  "speaker": {
    "display_name": "",
    "role": ""
  },
  "turn_id": "",
  "affect": {
    "label": "",
    "confidence": 0.0,
    "source": ""
  },
  "tts_url": "",
  "avatar": {
    "provider": "did",
    "mode": "",
    "status": "created",
    "session_id": "",
    "vendor_session_id": "",
    "job_id": "",
    "stream_url": "",
    "video_url": "",
    "thumbnail_url": "",
    "token": "",
    "expires_at": "",
    "capabilities": {
      "provider": "did",
      "supports_live_session": true,
      "supports_async_render": true,
      "requires_client_sdk": true,
      "requires_webrtc": true,
      "supports_text_input": true,
      "supports_audio_input": true,
      "candidate_input": [
        "text"
      ],
      "patient_delivery": "text",
      "affect_control": "none",
      "audio_source": "avatar_room",
      "enabled": true,
      "healthy": true,
      "availability": "available",
      "detail": ""
    },
    "transport": {
      "type": "",
      "room_url": "",
      "client_token": ""
    },
    "avatar_selection": {
      "provider": "did",
      "persona_role": "",
      "pal_role": "patient",
      "face_id": "",
      "avatar_id": "",
      "display_name": ""
    },
    "participant": {
      "display_name": "",
      "role": ""
    },
    "metadata": {},
    "error": ""
  },
  "error": "",
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "evaluation": {
    "overall_rating": "",
    "total_score": 0.0,
    "score_percent": 0.0,
    "domain_scores": [
      {
        "label": "",
        "rating": "",
        "score": 0.0,
        "rationale": "",
        "evidence": [
          ""
        ]
      }
    ],
    "strengths": [
      ""
    ],
    "missed_points": [
      ""
    ],
    "feedback": [
      ""
    ],
    "critical_failures": [
      {
        "label": "",
        "rationale": ""
      }
    ],
    "performance_breakdown": {
      "strongest_domains": [
        ""
      ],
      "improvement_domains": [
        ""
      ],
      "domains": [
        {}
      ]
    },
    "learning_explanation": "",
    "learning_evidence": {
      "citations": [],
      "policy_version": "evidence-v1",
      "retrieval_mode": "lexical",
      "retrieval_ms": 0,
      "semantic_ms": 0,
      "status": "disabled",
      "validation_ms": 0
    },
    "grading_metadata": {}
  },
  "feedback": [
    ""
  ],
  "session_id": "",
  "metrics": {},
  "metadata": {}
}
Response (422)
{
  "detail": "Provide station or station_slug."
}
Response (503)
{
  "detail": {
    "message": "tts provider 'openai' failed.",
    "stage": "tts",
    "provider": "openai",
    "error_type": "RuntimeError",
    "error": "Upstream provider unavailable"
  }
}
POST/evaluate

Public Evaluate

Request payload (application/json)
{
  "station_slug": "",
  "session_id": "",
  "candidate_id": "",
  "attempt_id": "",
  "transcript_complete": true,
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "speaker": "candidate",
      "content": ""
    }
  ],
  "feedback_mode": ""
}
Response (200)
{
  "overall_rating": "",
  "total_score": 0.0,
  "score_percent": 0.0,
  "domain_scores": [
    {
      "label": "",
      "rating": "",
      "score": 0.0,
      "rationale": "",
      "evidence": [
        ""
      ]
    }
  ],
  "strengths": [
    ""
  ],
  "missed_points": [
    ""
  ],
  "feedback": [
    ""
  ],
  "critical_failures": [
    {
      "label": "",
      "rationale": ""
    }
  ],
  "performance_breakdown": {
    "strongest_domains": [
      ""
    ],
    "improvement_domains": [
      ""
    ],
    "domains": [
      {
        "label": "",
        "rating": "",
        "score": 0.0,
        "score_percent": 0.0,
        "rationale": "",
        "evidence": [
          ""
        ],
        "strength": true,
        "improvement_priority": true
      }
    ]
  },
  "learning_explanation": "",
  "learning_evidence": {
    "citations": [],
    "policy_version": "evidence-v1",
    "retrieval_mode": "lexical",
    "retrieval_ms": 0,
    "semantic_ms": 0,
    "status": "disabled",
    "validation_ms": 0
  },
  "grading_metadata": {}
}
Response (409)
{
  "detail": {
    "code": "evaluation_withheld",
    "reason": "transcript_completeness_not_confirmed",
    "message": "Assessment requires review; no numerical result has been published."
  }
}
Response (503)
{
  "detail": {
    "code": "evaluation_withheld",
    "reason": "grading_provider_unavailable",
    "message": "Assessment requires review; no numerical result has been published."
  }
}
Response (422)
{
  "detail": "A transcript or session_id is required."
}
POST/feedback

Public Feedback

Request payload (application/json)
{
  "text": "",
  "station_slug": "",
  "session_id": "",
  "exam_slug": "",
  "category": "",
  "page_url": "",
  "source": ""
}
Response (200)
{
  "interaction": {
    "id": 0,
    "kind": "ask",
    "station_slug": "",
    "session_id": "",
    "exam_slug": "",
    "category": "",
    "user_text": "",
    "ai_text": "",
    "payload": {},
    "attachment_paths": [
      ""
    ],
    "created_at": ""
  },
  "accepted": true,
  "notes": [
    ""
  ]
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/media/{path}

Get Media

Parameters
NameInRequiredTypeDescription
pathpathYesstring
tokenqueryNostringShort-lived token returned with protected media URLs.
x-api-keyheaderNostringAlternative to the signed media URL token.
Response (200)
{}
Response (401)
{
  "detail": "Valid API key or media URL token required."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/mock-exams

List Mock Exams

Parameters
NameInRequiredTypeDescription
seedqueryNostring
Response (200)
{
  "items": [
    {
      "slug": "",
      "title": "",
      "session_label": "",
      "station_slugs": [
        ""
      ],
      "notes": {},
      "created_at": "",
      "updated_at": ""
    }
  ],
  "total": 0
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/mock-exams/{slug}

Get Mock Exam

Parameters
NameInRequiredTypeDescription
slugpathYesstring
seedqueryNostring
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/mock-exams/{slug}/station-ids

Get Mock Exam Station Ids

Parameters
NameInRequiredTypeDescription
slugpathYesstring
seedqueryNostring
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/provider-defaults

Provider Defaults Admin Page

Response (200)
HTML document response.
POST/review

Public Review

Request payload (application/json)
{
  "text": "",
  "station_slug": "",
  "session_id": "",
  "exam_slug": "",
  "category": "",
  "generate_ai_response": true
}
Response (200)
{
  "interaction": {
    "id": 0,
    "kind": "ask",
    "station_slug": "",
    "session_id": "",
    "exam_slug": "",
    "category": "",
    "user_text": "",
    "ai_text": "",
    "payload": {},
    "attachment_paths": [
      ""
    ],
    "created_at": ""
  },
  "extracted_text": "",
  "attachments": [
    {
      "filename": "",
      "media_path": "",
      "content_type": "",
      "extracted_text": "",
      "size_bytes": 0
    }
  ],
  "provider": "",
  "model": "",
  "answer": "",
  "response_mode": "clinical",
  "notes": [
    ""
  ],
  "evidence": {
    "citations": [],
    "policy_version": "evidence-v1",
    "retrieval_mode": "lexical",
    "retrieval_ms": 0,
    "semantic_ms": 0,
    "status": "disabled",
    "validation_ms": 0
  }
}
Response (409)
{
  "detail": {
    "code": "evaluation_withheld",
    "reason": "transcript_completeness_not_confirmed",
    "message": "Assessment requires review; no numerical result has been published."
  }
}
Response (503)
{
  "detail": {
    "code": "evaluation_withheld",
    "reason": "grading_provider_unavailable",
    "message": "Assessment requires review; no numerical result has been published."
  }
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/session/end

Public Session End

Request payload (application/json)
{
  "session_id": "",
  "station_slug": "",
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "speaker": "candidate",
      "content": ""
    }
  ],
  "reason": "",
  "transcript_complete": true
}
Response (200)
{
  "session_id": "",
  "domains": {},
  "checklist": {},
  "overall_band": "",
  "tips": [
    ""
  ],
  "evaluation": {
    "overall_rating": "",
    "total_score": 0.0,
    "score_percent": 0.0,
    "domain_scores": [
      {
        "label": "",
        "rating": "",
        "score": 0.0,
        "rationale": "",
        "evidence": [
          ""
        ]
      }
    ],
    "strengths": [
      ""
    ],
    "missed_points": [
      ""
    ],
    "feedback": [
      ""
    ],
    "critical_failures": [
      {
        "label": "",
        "rationale": ""
      }
    ],
    "performance_breakdown": {
      "strongest_domains": [
        ""
      ],
      "improvement_domains": [
        ""
      ],
      "domains": [
        {}
      ]
    },
    "learning_explanation": "",
    "learning_evidence": {
      "citations": [],
      "policy_version": "evidence-v1",
      "retrieval_mode": "lexical",
      "retrieval_ms": 0,
      "semantic_ms": 0,
      "status": "disabled",
      "validation_ms": 0
    },
    "grading_metadata": {}
  }
}
Response (409)
{
  "detail": {
    "code": "evaluation_withheld",
    "reason": "transcript_completeness_not_confirmed",
    "message": "Assessment requires review; no numerical result has been published."
  }
}
Response (503)
{
  "detail": {
    "code": "evaluation_withheld",
    "reason": "grading_provider_unavailable",
    "message": "Assessment requires review; no numerical result has been published."
  }
}
Response (422)
{
  "detail": "A transcript or session_id is required."
}
POST/session/start

Public Session Start

Request payload (application/json)
{
  "station_slug": "",
  "candidate_id": "",
  "session_id": "",
  "attempt_id": "",
  "exam_slug": "",
  "attempt_type": "",
  "metadata": {}
}
Response (200)
{
  "session_id": ""
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/user-feedback

Public User Feedback

Request payload (application/json)
{
  "text": "",
  "station_slug": "",
  "session_id": "",
  "exam_slug": "",
  "category": "",
  "page_url": "",
  "source": ""
}
Response (200)
{
  "interaction": {
    "id": 0,
    "kind": "ask",
    "station_slug": "",
    "session_id": "",
    "exam_slug": "",
    "category": "",
    "user_text": "",
    "ai_text": "",
    "payload": {},
    "attachment_paths": [
      ""
    ],
    "created_at": ""
  },
  "accepted": true,
  "notes": [
    ""
  ]
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}

Sessions

GET/sessions

List Sessions

Response (200)
[
  {
    "session_id": "",
    "station_slug": "",
    "status": "",
    "started_at": "",
    "ended_at": "",
    "turn_count": 0,
    "message_count": 0,
    "exchange_count": 0,
    "candidate_turn_count": 0,
    "patient_turn_count": 0
  }
]
Response (401)
{
  "detail": "Invalid API key."
}
POST/sessions

Create Session

Request payload (application/json)
{
  "station_slug": "",
  "session_id": "",
  "candidate_id": "",
  "metadata": {}
}
Response (201)
{
  "session_id": "",
  "station_slug": "",
  "status": "active",
  "started_at": "",
  "ended_at": "",
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "state": {
    "distress_level": "",
    "handoff_required": true,
    "end_status": "",
    "disclosed_items": [
      ""
    ],
    "rapport_level": 0,
    "turn_index": 0,
    "topics_covered": [
      ""
    ],
    "last_candidate_intent": "",
    "last_patient_focus": "",
    "facts_revealed_by_topic": {},
    "conversation_summary": [
      ""
    ],
    "recent_candidate_themes": [
      ""
    ],
    "reply_style": "",
    "notes": {}
  },
  "metadata": {}
}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/sessions/{session_id}

Get Session

Parameters
NameInRequiredTypeDescription
session_idpathYesstring
Response (200)
{
  "session_id": "",
  "station_slug": "",
  "status": "active",
  "started_at": "",
  "ended_at": "",
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "state": {
    "distress_level": "",
    "handoff_required": true,
    "end_status": "",
    "disclosed_items": [
      ""
    ],
    "rapport_level": 0,
    "turn_index": 0,
    "topics_covered": [
      ""
    ],
    "last_candidate_intent": "",
    "last_patient_focus": "",
    "facts_revealed_by_topic": {},
    "conversation_summary": [
      ""
    ],
    "recent_candidate_themes": [
      ""
    ],
    "reply_style": "",
    "notes": {}
  },
  "metadata": {}
}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/sessions/{session_id}/end

End Session

Parameters
NameInRequiredTypeDescription
session_idpathYesstring
Request payload (application/json)
{
  "reason": ""
}
Response (200)
{
  "session_id": "",
  "station_slug": "",
  "status": "active",
  "started_at": "",
  "ended_at": "",
  "transcript": [
    {
      "role": "candidate",
      "text": "",
      "timestamp": "",
      "metadata": {}
    }
  ],
  "state": {
    "distress_level": "",
    "handoff_required": true,
    "end_status": "",
    "disclosed_items": [
      ""
    ],
    "rapport_level": 0,
    "turn_index": 0,
    "topics_covered": [
      ""
    ],
    "last_candidate_intent": "",
    "last_patient_focus": "",
    "facts_revealed_by_topic": {},
    "conversation_summary": [
      ""
    ],
    "recent_candidate_themes": [
      ""
    ],
    "reply_style": "",
    "notes": {}
  },
  "metadata": {}
}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}

Stations

GET/stations

List Stations

Parameters
NameInRequiredTypeDescription
publication_statusqueryNostringFilter returned stations by publication state. Supported values are 'published' (default), 'unpublished' (admin only), and 'all' (admin only). Public requests may only use 'published'. The retired value 'inactive' is rejected with HTTP 422.
Response (200)
{
  "items": [
    {
      "slug": "",
      "section": "",
      "title": "",
      "time_limit_minutes": 0,
      "station_category": "",
      "publication_status": "published",
      "has_rubric": true,
      "has_key_points": true,
      "has_persona": true,
      "simulation_ready": true,
      "evaluation_ready": true
    }
  ],
  "total": 0
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/stations

Create Station

Parameters
NameInRequiredTypeDescription
X-Station-Editor-VersionheaderNostring
X-Station-Appearance-ReviewheaderNostring
Request payload (application/json)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (201)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/stations/categories/replace

Replace Station Category

Request payload (application/json)
{
  "from_value": "",
  "to_value": ""
}
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/editor-catalogue

Get Editor Catalogue

Response (200)
{}
POST/stations/editor-preview

Preview Editor Station

Request payload (application/json)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (200)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/metadata

Get Station Metadata

Parameters
NameInRequiredTypeDescription
publication_statusqueryNostringFilter metadata by publication state. Supported values are 'published' (default), 'unpublished' (admin only), and 'all' (admin only). Public requests may only use 'published'. The retired value 'inactive' is rejected with HTTP 422.
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/publication/check

Check Station Publication

Parameters
NameInRequiredTypeDescription
actionqueryNostring
stationsqueryNostring
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/stations/publication/requests

Start Station Publication

Request payload (application/json)
{
  "action": "publish",
  "stations": "",
  "reviewer": "",
  "reviewed_on": "",
  "note": "",
  "confirm_rollout_id": ""
}
Response (202)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/publication/requests/{request_id}

Get Station Publication Progress

Parameters
NameInRequiredTypeDescription
request_idpathYesstring
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/publication/status

Get Station Publication Status

Response (200)
{}
GET/stations/review

Review Stations Page

Parameters
NameInRequiredTypeDescription
modequeryNostring
Response (200)
HTML document response.
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/stations/review

Grant Station Review Access

Request payload (application/json)
{
  "access_token": ""
}
Response (204)
No structured response body documented.
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/stations/sections/replace

Replace Station Section

Request payload (application/json)
{
  "from_value": "",
  "to_value": ""
}
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
DELETE/stations/{slug}

Delete Station

Parameters
NameInRequiredTypeDescription
slugpathYesstring
Response (204)
No structured response body documented.
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/{slug}

Get Station

Parameters
NameInRequiredTypeDescription
slugpathYesstring
publication_statusqueryNostringReturn a station only if it matches the requested publication state. Supported values are 'published' (default), 'unpublished' (admin only), and 'all' (admin only). Public requests may only use 'published'. The retired value 'inactive' is rejected with HTTP 422.
Response (200)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
PUT/stations/{slug}

Update Station

Parameters
NameInRequiredTypeDescription
slugpathYesstring
X-Station-Editor-VersionheaderNostring
X-Station-Appearance-ReviewheaderNostring
Request payload (application/json)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (200)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/{slug}/archive-url

Get Station Archive Url

Parameters
NameInRequiredTypeDescription
slugpathYesstring
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/{slug}/candidate-prompts

Get Station Candidate Prompts

Parameters
NameInRequiredTypeDescription
slugpathYesstring
Response (200)
{
  "station_slug": "",
  "prompts": [
    ""
  ]
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/{slug}/editor-version

Get Editor Version

Parameters
NameInRequiredTypeDescription
slugpathYesstring
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/stations/{slug}/rename

Rename Station

Parameters
NameInRequiredTypeDescription
slugpathYesstring
X-Station-Editor-VersionheaderNostring
Request payload (application/json)
{
  "new_slug": ""
}
Response (200)
{
  "slug": "",
  "section": "",
  "title": "",
  "task": "",
  "prompts": {
    "station_name": "",
    "case_synopsis": "",
    "generated_from": [
      ""
    ]
  },
  "lead": "",
  "key_points": [
    ""
  ],
  "persona": {
    "name": "",
    "age": 0,
    "affect": "",
    "communication_style": "",
    "role": "direct_patient",
    "goals_concerns": [
      ""
    ],
    "nonverbal_cues": [
      ""
    ],
    "do_not_volunteer": [
      ""
    ],
    "affect_profile": {
      "initial_internal_affect": "",
      "allowed_internal_affects": [
        ""
      ],
      "tavus_mapping": {},
      "rules": [
        {}
      ]
    }
  },
  "avatar": {
    "tavus": {
      "face_id": "",
      "display_name": ""
    },
    "liveavatar": {
      "avatar_id": "",
      "display_name": ""
    }
  },
  "avatar_review": {},
  "guardrails": {
    "forbidden_topics": [
      ""
    ],
    "mandatory_disclosures": [
      ""
    ],
    "handoff_triggers": [
      ""
    ],
    "privacy_rules": [
      ""
    ],
    "out_of_scope_responses": [
      ""
    ],
    "role_boundary": "",
    "unknown_information_rule": "",
    "clinical_consistency_rules": [
      ""
    ]
  },
  "rubric": {
    "marking_sheet_title": "",
    "overall_scale": [
      ""
    ],
    "domain_rating_scale": [
      ""
    ],
    "rating_to_score": {},
    "competency_items": [
      {
        "label": "",
        "weight": 0.0,
        "scoring_mode": "",
        "critical": true,
        "hints": [
          ""
        ],
        "id": "",
        "criterion_ids": [
          ""
        ],
        "criteria": [
          {}
        ],
        "anchors": {}
      }
    ],
    "feedback_checklist": [
      {
        "id": 0,
        "title": "",
        "details": "",
        "domain_id": ""
      }
    ],
    "scope": "",
    "evidence_rules": [
      ""
    ],
    "aggregation": {
      "formula": "",
      "rounding": "",
      "thresholds": [
        {}
      ],
      "threshold_status": "",
      "incomplete_transcript": "",
      "grade_release": ""
    },
    "safety_flags": [
      {
        "id": "",
        "trigger": "",
        "effect": "",
        "not_triggered_by": "",
        "cap_at": "",
        "requires_disclosure": true
      }
    ],
    "safety_flag_policy": ""
  },
  "evaluation": {
    "version": "",
    "method": "",
    "inputs": [
      ""
    ],
    "excluded_inputs": [
      ""
    ],
    "output_contract": {},
    "validation_rules": [
      ""
    ],
    "calibration": {}
  },
  "sources": {
    "pdf": "",
    "original_pdf_status": "",
    "clinical_references": [
      {}
    ],
    "reference_check_date": "",
    "reference_check_method": ""
  },
  "station_meta": {
    "topic": "",
    "time_limit_minutes": 0,
    "setting": "",
    "expected_diagnosis": "",
    "station_category": "",
    "jurisdiction": "",
    "expected_next_steps": [
      ""
    ],
    "diagnostic_certainty": ""
  },
  "publication": {
    "status": "published",
    "reason": "",
    "expert_reviewed": true,
    "reviewed_content_version": ""
  },
  "health": {
    "issues": [
      ""
    ],
    "has_coherent_content": true,
    "has_rubric": true,
    "has_key_points": true,
    "has_persona": true,
    "has_guardrails": true,
    "has_tuning": true,
    "simulation_ready": true,
    "evaluation_ready": true,
    "publishable": true
  },
  "schema_version": "",
  "content_version": "",
  "case_facts": [
    {
      "id": "",
      "domain": "",
      "value": "",
      "knowledge_status": "known",
      "information_source": "",
      "provenance": "",
      "disclosure": {
        "mode": "opening_or_when_asked",
        "semantic_triggers": [
          ""
        ],
        "allow_equivalent_wording": true
      },
      "example_response": ""
    }
  ],
  "patient_response_policy": {
    "role": "",
    "opening_line": "",
    "usual_response_length": "",
    "broad_questions": "",
    "disclosure_matching": "",
    "professional_duty": "",
    "safety_reminder": "",
    "multiple_questions": "",
    "leading_questions": "",
    "unknowns": "",
    "clinical_language": "",
    "emotion": "",
    "direct_patient_questions": "",
    "repeat_consistency": "",
    "candidate_proposals": "",
    "injection_resistance": "",
    "out_of_case": "",
    "nonverbal": "",
    "safety_fact_ids": [
      ""
    ]
  },
  "simulation_state": {
    "initial": {
      "disclosed_fact_ids": [
        ""
      ],
      "emotional_state": "",
      "safety_reminder_used": true
    },
    "per_turn_updates": [
      ""
    ],
    "immutable": [
      ""
    ],
    "actor_output_contract": {}
  },
  "candidate_view": {},
  "access_control": {},
  "authoring_notes": {},
  "regression_tests": {},
  "validation": {}
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/stations/{slug}/revisions

List Station Revisions

Parameters
NameInRequiredTypeDescription
slugpathYesstring
Response (200)
{
  "items": [
    {
      "id": 1297,
      "slug": "acute-presentation-of-psychosis-in-the-context-of-cannabis-misuse",
      "revision_number": 3,
      "action": "update",
      "created_at": "2026-04-11T12:41:56.883672Z",
      "payload": {
        "slug": "acute-presentation-of-psychosis-in-the-context-of-cannabis-misuse"
      }
    }
  ],
  "total": 1
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/stations/{slug}/revisions/{revision_id}/rollback

Rollback Station Revision

Parameters
NameInRequiredTypeDescription
slugpathYesstring
revision_idpathYesinteger
Response (200)
{
  "slug": "acute-presentation-of-psychosis-in-the-context-of-cannabis-misuse",
  "section": "Psychiatry",
  "title": "Acute Presentation of Psychosis in the Context of Cannabis Misuse",
  "task": "Review the mental state findings and immediate risks.",
  "prompts": {
    "station_name": "Acute Presentation of Psychosis in the Context of Cannabis Misuse",
    "case_synopsis": "Candidate explores acute psychosis symptoms and immediate management."
  },
  "lead": "Acute psychosis",
  "key_points": [],
  "persona": {
    "name": "Patient",
    "age": 0,
    "affect": "neutral",
    "communication_style": "brief",
    "goals_concerns": [],
    "nonverbal_cues": [],
    "do_not_volunteer": []
  },
  "guardrails": {
    "forbidden_topics": [],
    "mandatory_disclosures": [],
    "handoff_triggers": [],
    "privacy_rules": [
      "no real third-party identifiers"
    ],
    "out_of_scope_responses": []
  },
  "rubric": {
    "marking_sheet_title": "MARKING SHEET",
    "overall_scale": [
      "SEVERE FAIL",
      "FAIL",
      "BORDERLINE FAIL",
      "BORDERLINE PASS",
      "PASS",
      "EXCELLENT PASS"
    ],
    "domain_rating_scale": [
      "0",
      "1",
      "2",
      "3",
      "4"
    ],
    "rating_to_score": {
      "0": 0.0,
      "1": 0.25,
      "2": 0.5,
      "3": 0.75,
      "4": 1.0
    },
    "competency_items": [],
    "feedback_checklist": []
  },
  "evaluation": {
    "version": "ev-1.0.0"
  },
  "sources": {
    "pdf": "NEWSTATIONS.pdf"
  },
  "station_meta": {
    "topic": "Acute psychosis",
    "time_limit_minutes": 7,
    "setting": "Clinic",
    "expected_diagnosis": "Working diagnosis",
    "station_category": "management"
  }
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}

System

DELETE/admin/provider-defaults

Clear Provider Defaults

Parameters
NameInRequiredTypeDescription
actorqueryNostring
notequeryNostring
dry_runqueryNoboolean
Response (200)
{
  "defaults": {
    "asr": {
      "category": "asr",
      "provider_name": "",
      "updated_by": "",
      "note": "",
      "created_at": "",
      "updated_at": ""
    },
    "nlp": {
      "category": "asr",
      "provider_name": "",
      "updated_by": "",
      "note": "",
      "created_at": "",
      "updated_at": ""
    },
    "tts": {
      "category": "asr",
      "provider_name": "",
      "updated_by": "",
      "note": "",
      "created_at": "",
      "updated_at": ""
    }
  },
  "supported": {
    "asr": [
      "faster_whisper"
    ],
    "nlp": [
      ""
    ],
    "tts": [
      "elevenlabs"
    ]
  },
  "updated": true
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/admin/provider-defaults

Get Provider Defaults

Response (200)
{
  "defaults": {
    "asr": {
      "category": "asr",
      "provider_name": "azure",
      "created_at": "2026-04-06T09:00:03.961692Z",
      "updated_at": "2026-04-11T12:42:27.419272Z"
    },
    "nlp": {
      "category": "nlp",
      "provider_name": "openai",
      "created_at": "2026-04-06T09:00:03.961709Z",
      "updated_at": "2026-04-11T12:42:27.419272Z"
    },
    "tts": {
      "category": "tts",
      "provider_name": "polly",
      "created_at": "2026-04-06T09:00:03.961714Z",
      "updated_at": "2026-04-11T12:42:27.419272Z"
    }
  },
  "supported": {
    "asr": [
      "faster_whisper",
      "whisper",
      "openai",
      "deepgram",
      "elevenlabs",
      "azure",
      "aws_transcribe_medical",
      "parakeet_stream",
      "multitalker_parakeet"
    ],
    "nlp": [
      "openai"
    ],
    "tts": [
      "elevenlabs",
      "azure",
      "deepgram",
      "openai",
      "polly"
    ]
  }
}
Response (401)
{
  "detail": "Invalid API key."
}
PUT/admin/provider-defaults

Update Provider Defaults

Request payload (application/json)
{
  "asr_provider": "faster_whisper",
  "nlp_provider": "",
  "tts_provider": "elevenlabs",
  "actor": "",
  "note": "",
  "source": ""
}
Response (200)
{
  "defaults": {
    "asr": {
      "category": "asr",
      "provider_name": "azure",
      "created_at": "2026-04-06T09:00:03.961692Z",
      "updated_at": "2026-04-11T12:42:27.419272Z"
    },
    "nlp": {
      "category": "nlp",
      "provider_name": "openai",
      "created_at": "2026-04-06T09:00:03.961709Z",
      "updated_at": "2026-04-11T12:42:27.419272Z"
    },
    "tts": {
      "category": "tts",
      "provider_name": "polly",
      "created_at": "2026-04-06T09:00:03.961714Z",
      "updated_at": "2026-04-11T12:42:27.419272Z"
    }
  },
  "supported": {
    "asr": [
      "faster_whisper",
      "whisper",
      "openai",
      "deepgram",
      "elevenlabs",
      "azure",
      "aws_transcribe_medical",
      "parakeet_stream",
      "multitalker_parakeet"
    ],
    "nlp": [
      "openai"
    ],
    "tts": [
      "elevenlabs",
      "azure",
      "deepgram",
      "openai",
      "polly"
    ]
  },
  "updated": true
}
Response (401)
{
  "detail": "Invalid API key."
}
Response (422)
{
  "detail": [
    {
      "loc": [
        "body",
        "nlp_provider"
      ],
      "msg": "Input should be 'openai'",
      "type": "literal_error"
    }
  ]
}
GET/admin/provider-defaults/audit

List Provider Default Audit

Parameters
NameInRequiredTypeDescription
limitqueryNointeger
Response (200)
{
  "items": [
    {
      "id": 0,
      "category": "asr",
      "old_provider_name": "",
      "new_provider_name": "",
      "actor": "",
      "note": "",
      "source": "",
      "payload": {},
      "created_at": ""
    }
  ],
  "total": 0
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/evidence/status

Evidence Status

Response (200)
{}
GET/health

Health

Response (200)
{}
GET/health/release

Health Release

Response (200)
{
  "service": "medicaitutor-api",
  "environment": "staging",
  "version": "0.1.0",
  "release_at": "2026-04-20 06:16 WAT",
  "image_uri": "757052694893.dkr.ecr.us-east-1.amazonaws.com/medicaitutor:a1e8233afcc2d65ae5b826bb982d890207794119",
  "source_sha": "a1e8233afcc2d65ae5b826bb982d890207794119"
}
GET/healthz

Healthz

Response (200)
{}
GET/metrics

Metrics

Response (200)
{}
GET/metrics/prometheus

Metrics Prometheus

Response (200)
{}
POST/providers/benchmark

Run Provider Benchmark

Parameters
NameInRequiredTypeDescription
smokequeryNoboolean
Response (200)
{
  "environment": {
    "audio_fixture": "benchmark_synthetic.wav",
    "station_slug": "acute-presentation-of-psychosis-in-the-context-of-cannabis-misuse"
  },
  "ranking": {
    "asr": [
      {
        "latency_ms": 0.03,
        "provider": "mock",
        "status": "ok"
      }
    ],
    "nlp": [
      {
        "latency_ms": 640.4,
        "provider": "openai",
        "status": "ok"
      }
    ],
    "tts": [
      {
        "latency_ms": 210.11,
        "provider": "polly",
        "status": "ok"
      }
    ]
  },
  "regressions": [],
  "results": {
    "asr": [
      {
        "detail": "mock provider",
        "latency_ms": 0.03,
        "provider": "mock",
        "provider_type": "asr",
        "ready": true,
        "status": "ok",
        "transcript_chars": 56,
        "transcript_preview": "mock transcript 32044 bytes from benchmark_synthetic.wav"
      }
    ],
    "nlp": [
      {
        "detail": {
          "configured": true
        },
        "latency_ms": 640.4,
        "output_provider": "openai",
        "provider": "openai",
        "provider_type": "nlp",
        "ready": true,
        "response_preview": "Hello. I'm Patient.",
        "status": "ok"
      }
    ],
    "tts": [
      {
        "bytes": 4096,
        "detail": {
          "configured": true
        },
        "latency_ms": 210.11,
        "provider": "polly",
        "provider_type": "tts",
        "ready": true,
        "status": "ok"
      }
    ]
  },
  "timestamp": "2026-04-11T12:58:10.118673+00:00"
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/providers/benchmark/history

Provider Benchmark History

Parameters
NameInRequiredTypeDescription
limitqueryNointeger
Response (200)
{
  "items": [
    {
      "environment": {
        "audio_fixture": "benchmark_synthetic.wav",
        "station_slug": "acute-presentation-of-psychosis-in-the-context-of-cannabis-misuse"
      },
      "ranking": {
        "asr": [],
        "nlp": [],
        "tts": []
      },
      "regressions": [],
      "results": {
        "asr": [],
        "nlp": [],
        "tts": []
      },
      "timestamp": "2026-04-11T12:58:10.118673+00:00"
    }
  ],
  "total": 1
}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/providers/status

Provider Status

Parameters
NameInRequiredTypeDescription
livequeryNoboolean
refreshqueryNoboolean
catalog_livequeryNoboolean
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/ready

Ready

Response (200)
{}

Tts

POST/tts/speak

Speak

Request payload (application/json)
{
  "text": "",
  "voice": ""
}
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
GET/tts/{provider}

Get Provider Status

Parameters
NameInRequiredTypeDescription
providerpathYesstringTTS provider name. Options: elevenlabs, azure, deepgram, openai, polly.
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}
POST/tts/{provider}/speak

Speak Provider

Parameters
NameInRequiredTypeDescription
providerpathYesstringTTS provider name. Options: elevenlabs, azure, deepgram, openai, polly.
Request payload (application/json)
{
  "text": "",
  "voice": ""
}
Response (200)
{}
Response (422)
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": "",
      "ctx": {}
    }
  ]
}