{"openapi":"3.1.0","info":{"title":"Auddax API","version":"2026.11","description":"The Auddax API runs a governed clinical intake. Create an intake, send\neach patient message as a turn, and read the clinician handoff when the\nintake reaches a terminal state.\n\nEngine behavior: the default engine behavior mirrors Certuma Link US\nproduction. The engine asks one question per turn, uses multi-select\nred-flag screens (choice_mode multiple), closes an emergency at once,\naccepts a declined self-harm question once, and closes a patient under\n18 as not_eligible. GET /v1/health names the engine lane and build.\n\nClosing an interview: the engine closes an interview only on a done\nsignal, when the patient says it has nothing more to add. This lane has\nno turn cap. A simulated patient must say so.\n\nWhich field to read: triage is disposition. The diagnosis is\nclinical_assessment.working_diagnosis. POST /v1/evaluate with no mode is a\nseparate older deterministic path and is not the consult engine.\n\nLanguage: config.locale takes en-US (default), es-AR, or pt-BR. Set it at\ncreate for a patient who writes in Spanish or Portuguese. On auddax-sandbox\nthe clinician fields come back in English in every locale.\n\nLatency: a turn drives real model calls in the clinical engine. A\ncomplete turn takes 10 to 40 seconds. A closing turn can take longer. Set\nclient timeouts to at least 300 seconds. Use streaming for anything\npatient facing. The host api.auddax.ai runs through a proxy. The proxy\nreturns its own 502 when a response has not started in 120 seconds. That\nbody can be something other than the JSON error envelope. The turn can\nstill finish, so retry with the same Idempotency-Key.\n\nRetries: send an Idempotency-Key on every turn. A retry with the same\nkey returns the stored result, or 409 turn_in_progress while the first\nrequest still runs. One turn per intake produces its reply at a time.\n\nAgents: /llms.txt is a one-page guide to the evaluation loop.\n\nResponse headers: x-auddax-release on every response,\nx-auddax-turns-remaining on turns, x-auddax-idempotent-replay on a\nreplayed turn, Retry-After on 409 turn_in_progress, 429, and 504.\n\nSandbox terms: this is a research preview. Do not use it for real\npatient care. Do not send personal health information or real patient\ndata. Test messages persist in the engine's encounter store.\n"},"servers":[{"url":"https://api.auddax.ai"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/batches":{"post":{"summary":"Run scripted scenarios as a background batch","description":"Up to 20 scenarios with up to 12 messages each. Every scenario runs as\na real intake; a scenario stops early at a terminal state. Batch turns\ndraw from the same daily turn quota as interactive calls. One batch\nruns at a time per key. Poll the batch, or subscribe to the\nbatch.completed webhook event. Batch scenarios run in standard mode.\nEach scenario's intake carries the scenario label (or the batch\nlabel) and metadata batch_id and scenario_index, so\nGET /v1/intakes?label= finds it.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["scenarios"],"properties":{"label":{"type":"string","maxLength":120},"scenarios":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["messages"],"properties":{"label":{"type":"string","maxLength":120},"messages":{"type":"array","minItems":1,"maxItems":12,"items":{"type":"string","maxLength":8000}},"demographics":{"type":"object","properties":{"age_years":{"type":"integer","minimum":0,"maximum":130},"sex":{"type":"string","enum":["female","male","intersex"]}}},"patient_history":{"type":"string","maxLength":16000},"profile":{"type":"string","description":"A configuration bundle for this scenario. See GET /v1/config."},"config":{"type":"object","description":"Per-flag configuration for this scenario. Each scenario result echoes the resolved config and its hash.","additionalProperties":{"type":"string"}}}}}}}}}},"responses":{"202":{"description":"The batch is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"batch_id":{"type":"string"},"status":{"type":"string"},"scenario_count":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"get":{"summary":"List recent batches","responses":{"200":{"description":"Up to 20 recent batches, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"batches":{"type":"array","items":{"$ref":"#/components/schemas/Batch"}}}}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/v1/batches/{batch_id}":{"get":{"summary":"Batch status and per-scenario results","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The batch with its scenarios and turn transcripts.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Batch"},{"type":"object","properties":{"scenarios":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"label":{"type":["string","null"]},"config":{"type":["object","null"],"additionalProperties":{"type":"string"}},"config_hash":{"type":["string","null"]},"encounter_id":{"type":["string","null"]},"turns":{"type":"array","items":{"type":"object","properties":{"turn_index":{"type":"integer"},"patient_message":{"type":"string"},"assistant_message":{"type":"string"},"terminal":{"type":"boolean"},"urgent":{"type":"boolean"},"outcome":{"$ref":"#/components/schemas/Outcome"},"safety_status":{"type":["string","null"]},"disposition":{"type":["string","null"]}}}},"error":{"type":["string","null"]},"started_at":{"type":["string","null"]},"finished_at":{"type":["string","null"]}}}}}}]}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks":{"post":{"summary":"Register a webhook endpoint","description":"The API calls the endpoint when a subscribed event fires. Targets must\nbe public https URLs. Up to 3 endpoints per key. Deliveries carry the\nheaders auddax-event, auddax-delivery, and auddax-signature\n(t=unix,v1=hex; HMAC-SHA256 of \"t.body\" with the endpoint secret).\nRetries: 3 attempts with backoff. Deliveries are at-least-once.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","maxLength":2048},"events":{"type":"array","items":{"type":"string","enum":["intake.completed","intake.escalated","batch.completed"]}}}}}}},"responses":{"201":{"description":"The endpoint, with its signing secret. The secret is shown once.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"get":{"summary":"List webhook endpoints","responses":{"200":{"description":"Your endpoints, without secrets.","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{webhook_id}":{"delete":{"summary":"Delete a webhook endpoint","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/v1/usage":{"get":{"summary":"Today's usage against your quotas","description":"Counts reset at 00:00 UTC. Every turn response also carries the\nx-auddax-turns-remaining header with the same remaining-turns number.\n","responses":{"200":{"description":"The current UTC day's usage for this key.","content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"turns":{"type":"object","properties":{"used":{"type":"integer"},"quota":{"type":"integer"},"remaining":{"type":"integer"}}},"intakes":{"type":"object","properties":{"used":{"type":"integer"},"quota":{"type":"integer"},"remaining":{"type":"integer"}}},"evaluations":{"type":"object","properties":{"used":{"type":"integer"}}},"rpm_limit":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/v1/usage/history":{"get":{"summary":"Daily usage history","description":"Free. Does not count against the per-minute limit.","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":90,"default":30}}],"responses":{"200":{"description":"One row per UTC day, oldest first.","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"turns":{"type":"integer"},"intakes":{"type":"integer"}}}},"daily_turn_quota":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/v1/key":{"get":{"summary":"The calling key's metadata and limits","description":"Free. Does not count against the per-minute limit.","responses":{"200":{"description":"Key metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"key_id":{"type":"string"},"developer":{"type":"string"},"account_id":{"type":"string"},"name":{"type":["string","null"]},"created_at":{"type":["string","null"]},"daily_turn_quota":{"type":"integer"},"rpm":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/v1/evaluate":{"post":{"summary":"[beta] Evaluate supplied facts or a completed encounter","description":"With no mode, evaluation uses the existing deterministic path. That is\na separate older path and is not the consult engine: it asks no\nquestions, runs no model, returns no clinical_assessment, and consumes\nno turn quota. Set mode to encounter for\nan opt-in model review of a completed transcript through MedCanon.\nEncounter review returns a safety summary, possible missing questions,\nclarifications, and source evidence. It does not generate a treatment plan.\nOnly the locale config flag is accepted in encounter mode.\nSupported locales are en-US, es-AR, es-CL, and pt-BR.\nThe encounter body limit is 1 MiB and 120000 transcript characters.\nLimits are 6 requests per minute and 2 concurrent calls per account\nper gateway instance. The upstream timeout is 90 seconds.\nUse synthetic data only. Encounter review is disabled by default.\nAn idempotency key is required in encounter mode. Completed results\nare cached for 24 hours. A changed payload with the same key returns\n409. Pending or failed calls are not run again with that key.\n","parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Required for encounter mode. Account-scoped identifier, up to 128 characters.","schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EncounterEvaluateRequest"},{"type":"object","not":{"required":["mode"]},"properties":{"correlation_id":{"type":"string","description":"Optional. Audit correlation only; the server keeps no state for it."},"profile":{"type":"string","description":"A configuration bundle for this call. See GET /v1/config."},"config":{"type":"object","description":"Per-flag configuration for this call. The resolved config and its hash are echoed in provenance.","additionalProperties":{"type":"string"}},"input":{"type":"object","properties":{"protocol_id":{"type":"string","description":"Required when `facts` is sent; the engine may also detect it from the transcript."},"facts":{"type":"object","description":"The extracted typed field values. Deterministic path; no model.","additionalProperties":true},"transcript_text":{"type":"array","description":"The conversation so far. Read by the deterministic emergency screen; no model reads it.","items":{"type":"object","properties":{"speaker":{"type":"string","enum":["clinician","patient"]},"text":{"type":"string"}}}},"demographics":{"type":"object","properties":{"age":{"type":"integer"},"sex":{"type":"string"}}}}}}}]}}}},"responses":{"200":{"description":"The result for the selected mode. Encounter failures never return an empty safety result.","content":{"application/json":{"schema":{"type":"object","properties":{"encounter_id":{"type":"string"},"transcript_revision":{"type":"string"},"safety_summary":{"type":"string"},"summary_evidence":{"type":"array","items":{"$ref":"#/components/schemas/EncounterEvidence"}},"missing_questions":{"type":"array","items":{"$ref":"#/components/schemas/EncounterQuestion"}},"clarifications":{"type":"array","items":{"$ref":"#/components/schemas/EncounterClarification"}},"correlation_id":{"type":"string"},"coverage_state":{"type":"string","enum":["covered","uncovered","none"]},"active_protocol":{"type":["object","null"],"properties":{"id":{"type":"string"}}},"emergency":{"type":"object","properties":{"urgent":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"provenance":{"type":"string"},"protocol_id":{"type":"string"},"requirement_quote":{"type":"string"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/EncounterEvidence"}}}}}}},"protocol_result":{"type":["object","null"]},"disposition":{"type":["string","null"]},"safety_status":{"type":["string","null"]},"provenance":{"type":"object","properties":{"deterministic":{"type":"boolean"},"engine_release":{"type":"string"},"audit_ref":{"type":["string","null"]}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/v1/transcripts/assess":{"post":{"summary":"[research] Read a finished transcript in one pass","description":"A research read of a finished transcript. It is not for clinical use.\nIt forces a diagnosis, which the live product does not force. It asks\nno questions, and it is not an intake.\n\nThe route is off by default. The operator enables it per key or per\naccount. Every other key gets 503 unavailable. Do not retry that 503.\n\nThe caller must cut each transcript before the first clinician message\nthat gives a diagnosis or a plan, because the route cannot clean a\ntranscript. A message after that point reaches the engine as input.\n\nTreatment options carry no doses, by design, and the clinician decides.\nA chat judged to be about a person under 18 returns status not_eligible\nwith no assessment.\n\nLimits: a 1 MiB body, 1 to 600 messages, and 120000 transcript\ncharacters. One call uses one request of the per-minute limit and one\nunit of the daily turn quota. A request that the gateway refuses costs no\nquota.\n\nTime: the gateway waits up to 300 seconds for the engine, then returns\n504. Set your client timeout to at least 330 seconds. The host\napi.auddax.ai runs through a proxy that returns its own 502 when a\nresponse has not started in 120 seconds, and a read can take longer.\nCall this route on the direct base URL your Auddax contact gives you.\n\nRetries: the gateway stores no transcript text and no output. It logs\ncounts only and stores a hash of the request, so it cannot replay a\nresult. A second request with a used Idempotency-Key gets 409\noperation_conflict, including while the first request still runs. To\nrun the read again after a lost connection, 502, 503, or 504, send a new\nkey. That is a new model pass and uses a new quota unit. A key stays\nfree after 429 and after a connection that could not open.\n","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"description":"Account-scoped identifier, up to 128 characters. Use one key per request.","schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptAssessRequest"}}}},"responses":{"200":{"description":"The wrapper's read, returned unchanged. Check status.","headers":{"x-auddax-turns-remaining":{"schema":{"type":"integer"},"description":"Turns left in the daily quota."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptAssessment"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"}}}},"/v1/config":{"get":{"summary":"The configuration catalog","description":"The profiles and flags available to configure the engine per intake or\nbatch scenario. Every value listed is available to every key. Pass a\n`profile` and/or a `config` object of flag overrides when creating an\nintake; the resolved configuration is echoed back with a `config_hash`.\n","responses":{"200":{"description":"The catalog.","content":{"application/json":{"schema":{"type":"object","properties":{"engine":{"type":"object","properties":{"contract_version":{"type":"string"},"modes":{"type":"array","items":{"$ref":"#/components/schemas/IntakeMode"}},"session_settings":{"type":"object"},"uploads":{"type":"object"}}},"catalog_version":{"type":"string"},"profiles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"}}}},"flags":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"default":{"type":"string"},"description":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/v1/health":{"get":{"summary":"Health and release identity","security":[],"responses":{"200":{"description":"The gateway is up.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"release":{"type":"string"},"build_sha":{"type":["string","null"]},"engine":{"type":"object","description":"The MedCanon lane that serves standard mode, and the build its wrapper reports (null when unreadable).","properties":{"lane":{"type":"string"},"wrapper_build_sha":{"type":["string","null"]}}}}}}}}}}},"/v1/openapi.json":{"get":{"summary":"This specification as JSON","security":[],"responses":{"200":{"description":"The OpenAPI document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/openapi.yaml":{"get":{"summary":"This specification as YAML","security":[],"responses":{"200":{"description":"The OpenAPI document.","content":{"text/yaml":{"schema":{"type":"string"}}}}}}},"/llms.txt":{"get":{"summary":"A one-page guide for AI agents","security":[],"responses":{"200":{"description":"Plain text.","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/intakes":{"get":{"summary":"List your intakes","description":"The calling key's intakes, newest first. Free: it reads the\ngateway's records only and never calls the engine. Filter by label\nand status. Page with before = next_before from the previous page.\n","parameters":[{"name":"label","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","closed","expired"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"One page of intakes.","content":{"application/json":{"schema":{"type":"object","properties":{"intakes":{"type":"array","items":{"$ref":"#/components/schemas/IntakeSummary"}},"next_before":{"type":["string","null"],"format":"date-time"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Create an intake","description":"Starts a new encounter. The optional fields seed clinical context.\nUnknown fields are refused with 400, so a misspelled field fails\nloudly. Guided preview requires synthetic true and config.locale\nes-AR. It accepts no profile, session settings or other\nconfiguration flags. A mode that is not enabled returns 400\nmode_unavailable; GET /v1/config lists the enabled modes.\n","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"label":{"type":"string","minLength":1,"maxLength":120,"description":"A free-text tag for grouping runs, for example a scenario id or an arm name. Never sent to the engine. Filter with GET /v1/intakes?label=."},"metadata":{"type":"object","maxProperties":20,"description":"Up to 20 string pairs. Keys are 1 to 40 letters, digits, or the characters _ . : - and values are at most 200 characters. Never sent to the engine.","additionalProperties":{"type":"string","maxLength":200}},"mode":{"$ref":"#/components/schemas/IntakeMode"},"synthetic":{"type":"boolean","const":true,"description":"Required only for guided preview; refused for other modes."},"session_settings":{"$ref":"#/components/schemas/SessionSettings"},"demographics":{"type":"object","properties":{"age_years":{"type":"integer","minimum":0,"maximum":130},"sex":{"type":"string","enum":["female","male","intersex"]}}},"patient_history":{"type":"string","maxLength":16000,"description":"Free-text context, for example allergies or current medications."},"profile":{"type":"string","description":"A named configuration bundle. See GET /v1/config. Default \"default\"."},"config":{"type":"object","description":"Per-flag configuration overrides, applied over the profile. See GET /v1/config for the catalog. config.locale takes en-US (default), es-AR, or pt-BR, sets the patient-facing language for the whole intake, and does not follow the language the patient writes in. Clinician fields stay in the partner's clinician language, English on auddax-sandbox.","additionalProperties":{"type":"string"}}}}}}},"responses":{"201":{"description":"The intake is open.","content":{"application/json":{"schema":{"type":"object","required":["encounter_id","status","created_at","expires_at"],"properties":{"label":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"mode":{"$ref":"#/components/schemas/IntakeMode"},"session_settings":{"$ref":"#/components/schemas/SessionSettings"},"guided":{"$ref":"#/components/schemas/GuidedConversation"},"encounter_id":{"type":"string"},"status":{"type":"string","enum":["open"]},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"config":{"type":"object","description":"The resolved configuration this intake runs under.","additionalProperties":{"type":"string"}},"config_hash":{"type":"string","description":"Hash of the resolved config. Equal hashes mean identical configuration."}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}/guided":{"get":{"summary":"Read the current guided question and revision","parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Guided state, including a terminal result until session expiry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidedState"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}/guided-turns":{"post":{"summary":"Submit one structured guided input","description":"Reuse the exact turn_id, revision and input on retry. Do not send\nIdempotency-Key. Altered replay inputs and stale state return 409.\nstream true emits only a turn.completed event after persistence,\ncarrying the same GuidedState as the blocking response. No deltas.\nCached retries are free; uncached attempts consume the usual quota.\n","parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidedTurn"}}}},"responses":{"200":{"description":"The committed guided result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidedState"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}/turns":{"post":{"summary":"Send one patient message","description":"Refused for guided mode; use guided-turns instead.\nDrives one intake turn. With `\"stream\": true` the response is a\nServer-Sent Events stream with these events:\n\n- `message.delta` `{text}`: the next fragment of the patient-facing reply\n- `message.completed` `{elapsed_ms}`: the reply text is complete\n- `handoff.compiling` `{terminal}`: the engine is compiling the snapshot\n- `handoff.progress` `{chars}`: compile progress\n- `turn.completed`: the same object the blocking response returns\n- `error` `{code, message}`: the turn failed after the stream started\n\nYou may send the next turn as soon as `message.completed` arrives,\neven while the previous turn's handoff is still compiling.\n\nThe `Idempotency-Key` header makes a blocking turn safe to retry:\na repeated key returns the stored response and does not drive the\nengine again. While the first request with that key still runs, a\nretry gets 409 turn_in_progress with Retry-After. A key is freed when\nits turn fails, so the same key can retry a failed turn.\n\nOne turn per intake produces its reply at a time. A turn sent while\nanother is still producing its reply gets 409 turn_in_progress and\nnothing is sent to the engine. Read GET /v1/intakes/{encounter_id}\n(turn_in_progress, last_turn) to recover after a client timeout.\n\n504 upstream_timeout means the engine did not answer in time; the\nturn may still complete. Read the intake before sending anything.\nAfter a timeout, a retry with the same Idempotency-Key gets 409\nturn_outcome_unknown (not retryable): read the handoff conversation,\nand if your message is not there, send it with a new key.\n\nWith `\"stream\": true`, message.delta text can differ from the final\nreply: the engine can remove a sentence after it was streamed. The\nturn.completed event's assistant_message is the authoritative text.\n","parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","minLength":1,"maxLength":8000},"stream":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"The turn result. Content is SSE when stream is true.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Turn"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}":{"get":{"summary":"Intake status, outcome, and last turn","description":"Free. Reads the gateway's record only; never calls the engine.","parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The stored status of the intake.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IntakeSummary"},{"type":"object","properties":{"last_turn":{"oneOf":[{"$ref":"#/components/schemas/LastTurn"},{"type":"null"}]}}}]}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}/result":{"get":{"summary":"Compact result for assertions","description":"One flat object a test harness can assert on: the outcome, the safety\nand routing fields, the red flags, and the engine build. It reads the\nhandoff once, so it counts against the per-minute limit.\n","parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/v1/autonomy/scenarios":{"get":{"summary":"Read the engine scenario catalog","description":"Requires the autonomy connection. Returns the engine catalog version and synthetic scenarios.","responses":{"200":{"description":"The scenario catalog.","content":{"application/json":{"schema":{"type":"object","required":["catalog_version","scenarios"],"properties":{"catalog_version":{"type":"string"},"scenarios":{"type":"array","items":{"type":"object"}}}}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}/autonomy/reviews":{"parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Read the reviews for an owned autonomous intake","responses":{"200":{"description":"The engine review records for this intake.","content":{"application/json":{"schema":{"type":"object","properties":{"reviews":{"type":"array","items":{"$ref":"#/components/schemas/AutonomyReview"}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Add a review for an owned autonomous intake","description":"The engine must have a stored gate result. Reviewer is a label supplied\nby the caller. It is not a verified clinician identity. Each request\nappends a review. Network and engine failures are not retried.\nIdempotency-Key is not supported. The request uses the normal rate limit\nand does not consume a model turn.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyReviewInput"}}}},"responses":{"201":{"description":"The engine saved the review.","content":{"application/json":{"schema":{"type":"object","properties":{"review":{"$ref":"#/components/schemas/AutonomyReview"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}/uploads":{"post":{"summary":"Analyze a file for an intake","description":"Requires configured mode. The engine reads the analysis on the next turn.\nOne analysis attempt consumes one unit of the daily turn quota and does\nnot advance the turn index. The gateway does not store file bytes.\nNetwork and engine failures are not retried. Idempotency-Key is not\nsupported. Set upload_id to replace an analysis in the same session.\n","parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInput"}}}},"responses":{"200":{"description":"The engine replaced an analysis. Check upload.status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResult"}}}},"201":{"description":"The engine stored a new analysis. Check upload.status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResult"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/v1/intakes/{encounter_id}/handoff":{"get":{"summary":"Clinician handoff","description":"Readable for open, closed, and expired intakes.","parameters":[{"name":"encounter_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The full handoff snapshot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Handoff"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An Auddax API key, prefix adx_sb_."}},"responses":{"Error":{"description":"The error envelope. 409 turn_in_progress, 429, and 504 carry Retry-After in seconds.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying, where the error has a retry time."}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","not_found","intake_closed","intake_expired","rate_limited","quota_exceeded","batch_running","operation_conflict","turn_in_progress","turn_outcome_unknown","mode_unavailable","upstream_error","upstream_timeout","unavailable","internal_error"]},"message":{"type":"string"},"encounter_id":{"type":"string"}}}}}}}}},"schemas":{"Outcome":{"type":"string","enum":["continue","complete","urgent","not_eligible"],"description":"continue: the intake is still asking questions.\ncomplete: the intake closed with a clinician handoff.\nurgent: the intake closed with an urgent escalation.\nnot_eligible: the intake closed without a handoff, for example a patient under 18.\n"},"LastTurn":{"type":"object","properties":{"turn_index":{"type":"integer"},"at":{"type":"string","format":"date-time"},"assistant_message":{"type":"string"},"choices":{"type":"array","items":{"type":"string"}},"choice_mode":{"type":"string","enum":["multiple"]},"outcome":{"$ref":"#/components/schemas/Outcome"},"terminal":{"type":"boolean"},"urgent":{"type":"boolean"}}},"IntakeSummary":{"type":"object","properties":{"encounter_id":{"type":"string"},"status":{"type":"string","enum":["open","closed","expired"]},"label":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"mode":{"$ref":"#/components/schemas/IntakeMode"},"outcome":{"oneOf":[{"$ref":"#/components/schemas/Outcome"},{"type":"null"}],"description":"Null before the first turn."},"turn_count":{"type":"integer"},"turn_in_progress":{"type":"boolean","description":"True while a turn on this intake is producing its reply."},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"last_safety_status":{"type":["string","null"]},"last_disposition":{"type":["string","null"]},"config":{"type":["object","null"]},"config_hash":{"type":["string","null"]},"session_settings":{"$ref":"#/components/schemas/SessionSettings"}}},"Result":{"type":"object","properties":{"encounter_id":{"type":"string"},"label":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"status":{"type":"string","enum":["open","closed","expired"]},"mode":{"$ref":"#/components/schemas/IntakeMode"},"config_hash":{"type":["string","null"]},"turn_count":{"type":"integer"},"outcome":{"$ref":"#/components/schemas/Outcome"},"terminal":{"type":"boolean"},"urgent":{"type":"boolean"},"terminal_reason":{"type":["string","null"]},"safety_status":{"type":["string","null"]},"disposition":{"type":["string","null"],"description":"The field to read for triage. clinician_review, self_care, urgent_escalation, not_eligible, or continue_intake while the intake is open."},"disposition_label":{"type":["string","null"]},"active_protocol":{"type":["string","null"]},"candidate_protocols":{"type":"array","items":{"type":"string"}},"coverage_state":{"type":["string","null"]},"safety_triage":{"type":["string","null"]},"cannot_miss_screen_incomplete":{"type":["boolean","null"]},"red_flags":{"type":"array","items":{"type":"string"}},"safety_notes":{"type":"array","items":{"type":"string"}},"clinical_assessment":{"$ref":"#/components/schemas/ClinicalAssessmentOrNull"},"medication_identity_unverified":{"type":"array","items":{"type":"string"}},"patient_turns":{"type":"integer"},"last_assistant_message":{"type":["string","null"]},"provenance":{"type":"object","properties":{"release":{"type":["string","null"]},"source_commit":{"type":["string","null"]},"server_model":{"type":["string","null"]},"prompt_hash":{"type":["string","null"]},"prompt_profile":{"type":["string","null"]},"audit_ref":{"type":["string","null"]}}}}},"ClinicalAssessmentOrNull":{"type":["object","null"],"description":"The field to read for the diagnosis. The note writer's working diagnosis, differentials, and management options, for the clinician. Null when the engine did not write one, for example on an open intake, a not_eligible close, or a failed note. In an interview, working_diagnosis can read \"Undetermined\" with the reason.","properties":{"working_diagnosis":{"type":["string","null"]},"differentials":{"type":"array","items":{"type":"string"}},"management":{"type":"array","description":"Options for the clinician to decide. Nothing here is decided. A treatment option carries no dose, by design.","items":{"type":"object","required":["kind","text"],"properties":{"kind":{"type":"string","description":"obtain_history, test, treatment_option, referral, follow_up, or safety_net."},"text":{"type":"string"}}}}}},"TranscriptAssessRequest":{"type":"object","additionalProperties":false,"required":["messages"],"properties":{"messages":{"type":"array","minItems":1,"maxItems":600,"description":"The finished transcript, in order, with at least one patient message and at most 120000 characters of content. Cut it before the first clinician message that gives a diagnosis or a plan.","items":{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"type":"string","enum":["patient","clinician"]},"content":{"type":"string","minLength":1}}}},"locale":{"type":"string","enum":["en-US","es-AR","pt-BR"]},"label":{"type":"string","minLength":1,"maxLength":120,"description":"A free-text tag, sent to the engine. The gateway does not log, store, or echo it. Put no patient data in it."}}},"TranscriptAssessment":{"type":"object","description":"A research read, not for clinical use. The gateway returns the wrapper's response unchanged.","required":["status","research_read"],"properties":{"status":{"type":"string","enum":["final","not_eligible"],"description":"not_eligible means the chat was judged to be about a person under 18, or another reason in not_eligible_reason."},"not_eligible_reason":{"type":["string","null"]},"disposition":{"type":["string","null"]},"disposition_label":{"type":["string","null"]},"safety_status":{"type":["string","null"]},"requires_immediate_clinician_review":{"type":"boolean"},"clinical_assessment":{"$ref":"#/components/schemas/ClinicalAssessmentOrNull"},"clinician_note":{"type":["string","null"]},"active_protocol":{"type":["string","null"]},"grounding":{"type":["object","null"],"description":"The result of the check of the note against the transcript.","properties":{"status":{"type":["string","null"]},"reason":{"type":["string","null"]}}},"dialogue_error":{"type":["string","null"]},"research_read":{"type":"boolean","const":true},"provenance":{"type":"object","properties":{"source_commit":{"type":["string","null"]},"prompt_profile":{"type":["string","null"]},"server_model":{"type":["string","null"]},"note_effort":{"type":["string","null"]}}}}},"AutonomyResult":{"type":"object","required":["gate_version","catalog_version","outcome","reasons"],"description":"The engine gate result. The API does not change its clinical decision or plan.","properties":{"gate_version":{"type":"string"},"catalog_version":{"type":"string"},"outcome":{"type":"string","enum":["autonomous_plan","refer_to_clinician"]},"reasons":{"type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"detail":{"type":["string","null"]}}}},"condition_id":{"type":["string","null"]},"condition_version":{"type":["string","null"]},"facts":{"type":"array","items":{"type":"object"}},"plan":{"type":["object","null"]},"evaluation":{"type":["object","null"]},"model":{"type":["object","null"],"description":"The model proposal before the gate."},"agreement":{"type":["object","null"]},"patient_message":{"type":["string","null"]},"evaluated_at":{"type":"string","format":"date-time"}}},"AutonomyReviewInput":{"type":"object","additionalProperties":false,"required":["reviewer","verdict"],"properties":{"reviewer":{"type":"string","minLength":1,"maxLength":120},"verdict":{"type":"string","enum":["agree","disagree","unsafe","unsure"]},"correct_outcome":{"type":["string","null"],"enum":["autonomous_plan","refer_to_clinician",null]},"diagnosis_correct":{"type":["boolean","null"]},"regimen_correct":{"type":["boolean","null"]},"notes":{"type":["string","null"],"maxLength":4000},"scenario_id":{"type":["string","null"],"pattern":"^[a-z0-9][a-z0-9_.-]{0,119}$"}}},"AutonomyReview":{"type":"object","required":["id","encounter_id","reviewer","verdict","version","created_at"],"properties":{"id":{"type":"string"},"encounter_id":{"type":"string"},"reviewer":{"type":"string"},"verdict":{"type":"string","enum":["agree","disagree","unsafe","unsure"]},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"gate_version":{"type":["string","null"]},"catalog_version":{"type":["string","null"]},"gate_outcome":{"type":["string","null"]},"condition_id":{"type":["string","null"]}}},"IntakeMode":{"type":"string","enum":["standard","configured","autonomous","guided"],"default":"standard","description":"Configured mode uses an operator-configured connection. See GET /v1/config for enabled modes."},"GuidedTurn":{"type":"object","additionalProperties":false,"required":["turn_id","revision"],"oneOf":[{"required":["message"]},{"required":["answer"]},{"required":["action"]}],"properties":{"turn_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"},"revision":{"type":"integer","minimum":0},"stream":{"type":"boolean"},"message":{"type":"string","minLength":1,"maxLength":8000},"action":{"type":"string","enum":["already_answered","finish"]},"answer":{"type":"object","additionalProperties":false,"required":["question_id"],"oneOf":[{"required":["option_id"]},{"required":["option_ids"]},{"required":["value"]},{"required":["status"]}],"properties":{"question_id":{"type":"string","minLength":1,"maxLength":200},"option_id":{"type":"string","minLength":1,"maxLength":200},"option_ids":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":200}},"value":{"oneOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]},"status":{"type":"string","enum":["unknown","declined"]}}}}},"GuidedQuestion":{"type":"object","required":["id","revision","field_id","scope","text","input_type","options","actions","minimum","maximum"],"properties":{"id":{"type":"string"},"revision":{"type":"integer"},"field_id":{"type":"string"},"scope":{"type":"string"},"text":{"type":"string"},"input_type":{"type":"string"},"options":{"type":"array","items":{"type":"object","required":["id","label"],"properties":{"id":{"type":"string"},"label":{"type":"string"}}}},"actions":{"type":"array","items":{"type":"string"}},"minimum":{"type":["number","null"]},"maximum":{"type":["number","null"]}}},"GuidedConversation":{"type":"object","required":["mode","revision","catalog_version","catalog_hash","locale","assistant_message","question","choices","ready_for_clinician","requires_immediate_clinician_review","should_continue_intake","review_status"],"properties":{"mode":{"type":"string","const":"guided"},"revision":{"type":"integer","minimum":0},"catalog_version":{"type":"string"},"catalog_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"locale":{"type":"string"},"assistant_message":{"type":"string"},"question":{"oneOf":[{"$ref":"#/components/schemas/GuidedQuestion"},{"type":"null"}]},"choices":{"type":"array","items":{"type":"string"}},"ready_for_clinician":{"type":"boolean"},"requires_immediate_clinician_review":{"type":"boolean"},"should_continue_intake":{"type":"boolean"},"review_status":{"type":"string","const":"synthetic_only"}}},"GuidedState":{"type":"object","required":["encounter_id","mode","guided"],"properties":{"encounter_id":{"type":"string"},"mode":{"type":"string","const":"guided"},"guided":{"$ref":"#/components/schemas/GuidedConversation"}}},"SessionSettings":{"type":"object","additionalProperties":false,"description":"Settings for configured mode. The selected engine must support them.","properties":{"policies":{"type":"object","additionalProperties":false,"properties":{"interview_pacing_policy":{"type":"string","enum":["interview_pacing_v1"]},"question_budget_policy":{"type":"string","enum":["single_question_v1"]},"answer_choices_policy":{"type":"string","enum":["multi_select_screen_v1"]}}},"prompt_profile_id":{"type":"string","enum":["protocolos_studio_may11_v1","protocolos_studio_plus10_v2"]},"clinician_locale":{"type":"string","enum":["en-US","es-AR","pt-BR"]},"session_ttl_minutes":{"type":"integer","minimum":5,"maximum":1440}}},"UploadInput":{"type":"object","additionalProperties":false,"required":["content_base64"],"properties":{"content_base64":{"type":"string","maxLength":13981016,"description":"Canonical base64. The decoded file must be at most 10 MiB. Use PDF, JPEG, PNG, or WebP."},"file_name":{"type":"string","minLength":1,"maxLength":120},"model":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{2,60}$"},"upload_id":{"type":"string","pattern":"^upl_[a-f0-9]{16}$"}}},"UploadResult":{"type":"object","required":["encounter_id","upload"],"properties":{"encounter_id":{"type":"string"},"upload":{"type":"object","required":["upload_id","status"],"properties":{"upload_id":{"type":"string"},"status":{"type":"string","enum":["completed","failed"]},"file_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"integer"},"sha256":{"type":"string"},"uploaded_at":{"type":"string","format":"date-time"},"analyzed_at":{"type":"string","format":"date-time"},"analyses_count":{"type":"integer"},"model":{"type":["object","null"]},"analysis":{"type":["object","null"],"description":"The engine analysis, including extraction, verification, source references, and critical findings."}}}}},"EncounterEvaluateRequest":{"type":"object","additionalProperties":false,"required":["mode","encounter_id","transcript_revision","input"],"properties":{"mode":{"const":"encounter"},"encounter_id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},"transcript_revision":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},"correlation_id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},"config":{"type":"object","additionalProperties":false,"properties":{"locale":{"enum":["en-US","es-AR","es-CL","pt-BR"]}}},"input":{"type":"object","additionalProperties":false,"required":["transcript_text"],"properties":{"transcript_text":{"type":"array","minItems":1,"maxItems":600,"items":{"type":"object","additionalProperties":false,"required":["id","speaker","text"],"properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,128}$"},"speaker":{"enum":["clinician","patient","unknown","dictation"]},"text":{"type":"string","minLength":1,"maxLength":4000}}}},"demographics":{"type":"object","additionalProperties":false,"properties":{"age_years":{"type":"integer","minimum":0,"maximum":130},"age":{"type":"integer","minimum":0,"maximum":130},"clinically_relevant_sex":{"enum":["female","male","intersex"]},"sex":{"type":"string","description":"Alias. F and M are accepted."}}}}}}},"EncounterEvidence":{"type":"object","required":["utterance_id","quote"],"properties":{"utterance_id":{"type":"string"},"quote":{"type":"string","description":"The complete source utterance."}}},"EncounterClarification":{"type":"object","required":["question","reason","evidence"],"properties":{"question":{"type":"string"},"reason":{"type":"string"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/EncounterEvidence"}}}},"EncounterQuestion":{"allOf":[{"$ref":"#/components/schemas/EncounterClarification"},{"type":"object","required":["protocol_id","requirement_quote"],"properties":{"protocol_id":{"type":["string","null"]},"requirement_quote":{"type":"string"}}}]},"Batch":{"type":"object","properties":{"batch_id":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","completed_with_failures"]},"label":{"type":["string","null"]},"scenario_count":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"]}}},"Turn":{"type":"object","required":["encounter_id","turn_index","assistant_message","terminal"],"properties":{"mode":{"$ref":"#/components/schemas/IntakeMode"},"encounter_id":{"type":"string"},"turn_index":{"type":"integer"},"assistant_message":{"type":"string","description":"The engine's next patient-facing message. Relay it without edits."},"choices":{"type":"array","items":{"type":"string"},"description":"Engine-suggested quick replies for the next turn."},"choice_mode":{"type":"string","enum":["multiple"],"description":"Let the user select all answers that apply before submission. If absent, use the existing single-answer behavior."},"should_continue_intake":{"type":"boolean","description":"The engine states whether the intake can continue."},"terminal":{"type":"boolean","description":"True when the intake reached a terminal state. No more turns are accepted."},"urgent":{"type":"boolean","description":"True when the engine requires immediate clinician review."},"outcome":{"$ref":"#/components/schemas/Outcome"},"terminal_reason":{"type":["string","null"],"description":"Why a terminal intake closed without a handoff, for example not_eligible_under_18. Null otherwise."},"safety_status":{"type":["string","null"]},"disposition":{"type":["string","null"]},"disposition_label":{"type":["string","null"]},"handoff":{"$ref":"#/components/schemas/Handoff","description":"Present when terminal is true."}}},"Handoff":{"type":"object","properties":{"guided":{"type":"object","description":"Guided facts, history, transcript, catalogue hash and missing safety fields. No clinical assessment is generated in the synthetic preview."},"mode":{"$ref":"#/components/schemas/IntakeMode"},"autonomy":{"$ref":"#/components/schemas/AutonomyResult"},"uploaded_evidence":{"type":"array","items":{"type":"object"},"description":"The engine upload summaries, with their verification and review status."},"encounter_id":{"type":"string"},"captured_at":{"type":"string","format":"date-time"},"terminal":{"type":"boolean"},"urgent":{"type":"boolean"},"outcome":{"$ref":"#/components/schemas/Outcome"},"terminal_reason":{"type":["string","null"]},"intake_status":{"type":["string","null"]},"safety_status":{"type":["string","null"]},"safety_notes":{"type":"array","items":{"type":"string"}},"disposition":{"type":["string","null"],"description":"The field to read for triage. clinician_review, self_care, urgent_escalation, not_eligible, or continue_intake while the intake is open."},"disposition_label":{"type":["string","null"]},"soap":{"type":"object","properties":{"subjective":{"type":"string"},"objective":{"type":"string"},"assessment":{"type":"string"},"plan":{"type":"string"}}},"captured_facts":{"type":"object","properties":{"age":{"type":["string","null"]},"sex":{"type":["string","null"]},"pregnancy":{"type":["string","null"]}}},"active_protocol":{"type":["string","null"]},"candidate_protocols":{"type":"array","items":{"type":"string"}},"scores":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"total":{"type":"string"},"band":{"type":"string","enum":["strong","mid","weak"]},"components":{"type":"string"}}}},"conversation":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["assistant","patient"]},"text":{"type":"string"}}}},"red_flags":{"type":"array","items":{"type":"string"},"description":"The red flags the engine recorded, in its own words."},"protocol_result":{"type":["object","null"],"properties":{"detected_protocol":{"type":["string","null"]},"coverage_state":{"type":["string","null"]},"safety_triage":{"type":["string","null"]},"rule_id":{"type":["string","null"]},"cannot_miss_screen_incomplete":{"type":["boolean","null"],"description":"True when the intake closed with a cannot-miss screen still pending. A review signal, never a routing input."}}},"clinician_summary":{"type":["string","null"],"description":"The engine's clinician handoff summary text. It can open with a medication identity notice."},"clinical_assessment":{"$ref":"#/components/schemas/ClinicalAssessmentOrNull"},"allergies":{"type":["string","null"]},"current_medication":{"type":["string","null"]},"medication_identity":{"type":"object","description":"Generic medicine names in the note that the patient did not supply (unverified) or that the reference table resolved (verified). A review signal, not identity verification.","properties":{"unverified":{"type":"array","items":{"type":"string"}},"verified":{"type":"array","items":{"type":"string"}}}},"references":{"type":["object","null"],"description":"Evidence references for the protocols the engine used, when the engine supplies them."},"provenance":{"type":"object","description":"Server-attested run identity for audit and version pinning.","properties":{"release":{"type":["string","null"]},"server_model":{"type":["string","null"]},"prompt_hash":{"type":["string","null"]},"source_commit":{"type":["string","null"]},"directory_hash":{"type":["string","null"]},"runtime_profile":{"type":["string","null"]},"prompt_profile":{"type":["string","null"]},"voice_profile":{"type":["string","null"]},"audit_ref":{"type":["string","null"]},"latency_ms":{"type":["number","null"]},"protocol_count":{"type":["number","null"]}}}}}}}}