{"openapi":"3.1.0","info":{"title":"Medera Biomarker Inference API","version":"1.0.0","summary":"Measured mental-health biomarkers from voice, physiology, face and clinical context, and the inference engine that reads them.","description":"Every value is measured, never generated, and carries its unit, method, quality gate and references.\n\nThe inference engine compares a person with their own baseline and computes condition probabilities only from validated instruments with stated priors.\n\nSandbox: use the public key mk_sandbox_medera_public (limits: 30 requests per minute, 30 s of audio). Live keys are issued on request.\n\nStateless and zero retention: nothing you send is stored. Not a diagnosis and not a medical device.","contact":{"name":"Medera, Inc.","url":"https://www.medera.info/contact?request=api-access"}},"servers":[{"url":"https://www.medera.info/api","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Service"},{"name":"Catalog"},{"name":"Vocal"},{"name":"Physiological"},{"name":"Facial"},{"name":"Clinical context"},{"name":"Inference"}],"paths":{"/v1":{"get":{"operationId":"index","tags":["Service"],"summary":"API index","description":"Version, engine and the list of endpoints.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiIndex"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/health":{"get":{"operationId":"health","tags":["Service"],"summary":"Health","description":"Liveness of the service. No authentication.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/openapi.json":{"get":{"operationId":"openapi","tags":["Service"],"summary":"OpenAPI document","description":"This contract, as OpenAPI 3.1.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDocument"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/samples/{kind}":{"get":{"operationId":"samples","tags":["Service"],"summary":"Download a sample request","description":"A synthetic, deterministic request body for an analyze endpoint, so a first request needs nothing but curl: vocal (a six-second WAV file), physiological, facial, clinical-context, inference or analyze (JSON). No real person's data. No authentication.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SampleRequest"}},"audio/wav":{"schema":{"type":"string","contentMediaType":"audio/wav"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"enum":["vocal","physiological","facial","clinical-context","inference","analyze"]},"description":"Which endpoint the sample is for."}]}},"/v1/biomarkers":{"get":{"operationId":"biomarkers","tags":["Catalog"],"summary":"List biomarkers","description":"Every measured biomarker with its unit, definition, method, quality gate, published associations, RDoC domain and references. Filter with ?modality=vocal|physiological|facial|clinical.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BiomarkerList"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"parameters":[{"name":"modality","in":"query","required":false,"schema":{"enum":["vocal","physiological","facial","clinical"]}}]}},"/v1/biomarkers/{key}":{"get":{"operationId":"biomarker","tags":["Catalog"],"summary":"Retrieve a biomarker","description":"One catalog entry by key, for example f0SdSemitones.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Biomarker"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"Biomarker key."}]}},"/v1/vocal/analyze":{"post":{"operationId":"vocal","tags":["Vocal"],"summary":"Analyze voice","description":"Measures the vocal panel from a WAV recording: pitch, voice quality, spectrum, articulation and timing for each channel, plus word rates and language markers when a transcript is attached. Send multipart/form-data with an audio part (and an optional options part holding JSON), or a raw audio/wav body with channel_roles and language as query parameters.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VocalAnalysis"}}}},"400":{"description":"Invalid JSON","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Payload too large","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported media type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["audio"],"properties":{"audio":{"type":"string","contentMediaType":"audio/wav","description":"PCM or IEEE-float WAV, 8–192 kHz, 1–8 channels."},"options":{"$ref":"#/components/schemas/VocalOptions","description":"JSON text."}}},"encoding":{"options":{"contentType":"application/json"}}},"audio/wav":{"schema":{"type":"string","contentMediaType":"audio/wav"}}}},"parameters":[{"name":"channel_roles","in":"query","required":false,"schema":{"type":"string"},"description":"For audio/wav bodies: comma-separated labels."},{"name":"language","in":"query","required":false,"schema":{"enum":["en","ar"]}}]}},"/v1/physiological/analyze":{"post":{"operationId":"physiological","tags":["Physiological"],"summary":"Analyze physiological signals","description":"Heart rate variability from RR intervals or PPG, electrodermal activity, sleep and the rest-activity rhythm. Every signal is optional.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhysiologicalAnalysis"}}}},"400":{"description":"Invalid JSON","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Payload too large","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported media type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhysiologicalRequest"}}}}}},"/v1/facial/analyze":{"post":{"operationId":"facial","tags":["Facial"],"summary":"Analyze facial behavior","description":"Expression, gaze, blink and head-motion biomarkers from per-frame MediaPipe Face Landmarker blendshapes computed on the device. No image is sent or stored.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacialAnalysis"}}}},"400":{"description":"Invalid JSON","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Payload too large","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported media type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacialRequest"}}}}}},"/v1/clinical-context/analyze":{"post":{"operationId":"clinical","tags":["Clinical context"],"summary":"Analyze clinical context","description":"Scores PHQ-9, GAD-7, PCL-5, MDQ and the C-SSRS screener with their published rules, measures language markers from a transcript, checks ICD-10-CM codes, and returns a safety block that routes risk items to a clinician.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClinicalContextAnalysis"}}}},"400":{"description":"Invalid JSON","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Payload too large","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported media type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClinicalContextRequest"}}}}}},"/v1/inference":{"post":{"operationId":"inference","tags":["Inference"],"summary":"Run inference","description":"Compares a session with the same person's baseline per RDoC domain (conformal or parametric p-values, stable / watch / review tiers) and computes condition probabilities from validated instruments with setting priors.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Inference"}}}},"400":{"description":"Invalid JSON","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Payload too large","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported media type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceRequest"}}}}}},"/v1/analyze":{"post":{"operationId":"analyze","tags":["Inference"],"summary":"Analyze a session end to end","description":"One call for a whole session: any of audio, physiological, facial and clinical-context inputs, plus the baseline. Runs every modality, merges the subject's biomarkers and returns the inference. Send multipart/form-data (audio part plus JSON parts named vocal, physiological, facial, clinical_context, baseline, context, options) or application/json without audio.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Analysis"}}}},"400":{"description":"Invalid JSON","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Payload too large","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported media type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"audio":{"type":"string","contentMediaType":"audio/wav"},"vocal":{"$ref":"#/components/schemas/VocalOptions"},"physiological":{"$ref":"#/components/schemas/PhysiologicalRequest"},"facial":{"$ref":"#/components/schemas/FacialRequest"},"clinical_context":{"$ref":"#/components/schemas/ClinicalContextRequest"},"baseline":{"type":"object"},"context":{"type":"object"},"options":{"type":"object"}}}},"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequest"}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Authorization: Bearer <key>. Sandbox key: mk_sandbox_medera_public."}},"schemas":{"VocalOptions":{"type":"object","properties":{"channel_roles":{"description":"A label per channel, for example [\"clinician\", \"patient\"]. Channels are treated as separated speakers.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":32}},"language":{"type":"string","enum":["en","ar"],"description":"Transcript language: English or Arabic."},"transcripts":{"description":"Optional transcripts. They unlock speaking and articulation rate and the language markers.","maxItems":8,"type":"array","items":{"type":"object","properties":{"channel":{"default":0,"description":"Channel the transcript belongs to.","type":"integer","minimum":0,"maximum":7},"text":{"type":"string","minLength":1,"maxLength":100000,"description":"Verbatim transcript; keep fillers for disfluency markers."},"language":{"type":"string","enum":["en","ar"],"description":"Transcript language: English or Arabic."}},"required":["text"],"additionalProperties":false}},"subject_channel":{"description":"For /v1/analyze: which channel is the person being measured. Defaults to the channel labeled patient, else 0.","type":"integer","minimum":0,"maximum":7}},"additionalProperties":false},"Night":{"type":"object","properties":{"sleep_onset":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"ISO 8601 date-time with a UTC offset."},"wake_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"ISO 8601 date-time with a UTC offset."},"total_sleep_minutes":{"type":"number","minimum":0,"maximum":1440},"time_in_bed_minutes":{"type":"number","minimum":0,"maximum":1440},"sleep_onset_latency_minutes":{"type":"number","minimum":0,"maximum":600},"sleep_efficiency_pct":{"type":"number","minimum":0,"maximum":100}},"required":["sleep_onset","wake_time"],"additionalProperties":false},"PhysiologicalRequest":{"type":"object","properties":{"heart":{"type":"object","properties":{"rr_ms":{"description":"RR or inter-beat intervals in milliseconds, in order.","minItems":2,"type":"array","items":{"type":"number","exclusiveMinimum":0}},"ppg":{"description":"Raw photoplethysmogram; systolic peaks are detected server-side (Elgendi 2013).","type":"object","properties":{"sample_rate_hz":{"type":"number","minimum":20,"maximum":1000},"samples":{"minItems":1,"type":"array","items":{"type":"number"}}},"required":["sample_rate_hz","samples"],"additionalProperties":false}},"additionalProperties":false},"eda":{"type":"object","properties":{"sample_rate_hz":{"type":"number","minimum":1,"maximum":1000},"samples_us":{"minItems":1,"type":"array","items":{"type":"number","minimum":0,"maximum":100},"description":"Skin conductance in microsiemens."},"scr_min_amplitude_us":{"description":"SCR amplitude criterion, 0.01 to 0.05 µS (default 0.05).","type":"number","minimum":0.01,"maximum":0.05}},"required":["sample_rate_hz","samples_us"],"additionalProperties":false},"sleep":{"type":"object","properties":{"nights":{"maxItems":400,"type":"array","items":{"$ref":"#/components/schemas/Night"}},"epochs":{"description":"Sleep/wake epochs for the Sleep Regularity Index.","type":"object","properties":{"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"ISO 8601 date-time with a UTC offset."},"epoch_seconds":{"anyOf":[{"type":"number","const":30},{"type":"number","const":60}]},"states":{"type":"array","items":{"anyOf":[{"type":"number","const":0},{"type":"number","const":1}]},"description":"1 = asleep, 0 = awake, one value per epoch."}},"required":["start","epoch_seconds","states"],"additionalProperties":false}},"required":["nights"],"additionalProperties":false},"activity":{"type":"object","properties":{"hourly_counts":{"description":"Hourly activity counts, starting at the top of an hour.","type":"array","items":{"type":"number","minimum":0}},"daily_steps":{"type":"array","items":{"type":"number","minimum":0}}},"additionalProperties":false}},"additionalProperties":false},"FacialRequest":{"type":"object","properties":{"fps":{"type":"number","minimum":1,"maximum":120,"description":"Frames per second of the landmarker output."},"frames":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"null","description":"No face detected in this frame."},{"type":"object","properties":{"blendshapes":{"anyOf":[{"minItems":52,"maxItems":52,"type":"array","items":{"type":"number","minimum":0,"maximum":1},"description":"52 scores in MediaPipe index order (index 0 is _neutral)."},{"type":"object","propertyNames":{"type":"string","enum":["_neutral","browDownLeft","browDownRight","browInnerUp","browOuterUpLeft","browOuterUpRight","cheekPuff","cheekSquintLeft","cheekSquintRight","eyeBlinkLeft","eyeBlinkRight","eyeLookDownLeft","eyeLookDownRight","eyeLookInLeft","eyeLookInRight","eyeLookOutLeft","eyeLookOutRight","eyeLookUpLeft","eyeLookUpRight","eyeSquintLeft","eyeSquintRight","eyeWideLeft","eyeWideRight","jawForward","jawLeft","jawOpen","jawRight","mouthClose","mouthDimpleLeft","mouthDimpleRight","mouthFrownLeft","mouthFrownRight","mouthFunnel","mouthLeft","mouthLowerDownLeft","mouthLowerDownRight","mouthPressLeft","mouthPressRight","mouthPucker","mouthRight","mouthRollLower","mouthRollUpper","mouthShrugLower","mouthShrugUpper","mouthSmileLeft","mouthSmileRight","mouthStretchLeft","mouthStretchRight","mouthUpperUpLeft","mouthUpperUpRight","noseSneerLeft","noseSneerRight"]},"additionalProperties":{"type":"number","minimum":0,"maximum":1},"description":"Scores by MediaPipe category name; missing names count as 0."}],"description":"MediaPipe Face Landmarker blendshape scores."},"head_pose":{"description":"Head pose in degrees.","type":"object","properties":{"yaw":{"type":"number","minimum":-180,"maximum":180},"pitch":{"type":"number","minimum":-180,"maximum":180},"roll":{"type":"number","minimum":-180,"maximum":180}},"required":["yaw","pitch","roll"],"additionalProperties":false}},"required":["blendshapes"],"additionalProperties":false}]}}},"required":["fps","frames"],"additionalProperties":false},"Instruments":{"type":"object","properties":{"phq9":{"description":"PHQ-9: nine items scored 0–3, in order; optional difficulty item.","type":"object","properties":{"items":{"minItems":9,"maxItems":9,"type":"array","items":{"type":"integer","minimum":0,"maximum":3}},"difficulty":{"type":"integer","minimum":0,"maximum":3}},"required":["items"],"additionalProperties":false},"gad7":{"description":"GAD-7: seven items scored 0–3.","type":"object","properties":{"items":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":3}}},"required":["items"],"additionalProperties":false},"pcl5":{"description":"PCL-5: twenty items scored 0–4.","type":"object","properties":{"items":{"minItems":20,"maxItems":20,"type":"array","items":{"type":"integer","minimum":0,"maximum":4}}},"required":["items"],"additionalProperties":false},"mdq":{"description":"Mood Disorder Questionnaire: 13 yes/no items, question 2 and question 3.","type":"object","properties":{"items":{"minItems":13,"maxItems":13,"type":"array","items":{"type":"boolean"}},"same_period":{"type":"boolean"},"problem":{"type":"string","enum":["none","minor","moderate","serious"]}},"required":["items","same_period","problem"],"additionalProperties":false},"cssrs":{"description":"C-SSRS screener answers (questions 1–5 for the past month or since last contact; question 6 behavior).","type":"object","properties":{"version":{"type":"string","enum":["lifetime_recent","since_last_contact"]},"wish_dead":{"type":"boolean"},"thoughts":{"type":"boolean"},"method":{"type":"boolean"},"intent":{"type":"boolean"},"plan":{"type":"boolean"},"behavior":{"type":"boolean"},"behavior_within_3_months":{"type":"boolean"}},"required":["version","wish_dead","thoughts","behavior"],"additionalProperties":false}},"additionalProperties":false},"ClinicalContextRequest":{"type":"object","properties":{"instruments":{"$ref":"#/components/schemas/Instruments"},"transcript":{"description":"What the person said, for the language markers.","type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":200000},"language":{"type":"string","enum":["en","ar"],"description":"Transcript language: English or Arabic."}},"required":["text"],"additionalProperties":false},"diagnoses":{"description":"ICD-10-CM codes from the record.","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":16}}},"additionalProperties":false},"InferenceRequest":{"type":"object","properties":{"current":{"type":"object","properties":{"biomarkers":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"null"}]},"description":"Biomarker key → value, as returned by the analyze endpoints."}},"required":["biomarkers"],"additionalProperties":false},"baseline":{"type":"object","properties":{"sessions":{"description":"Earlier sessions of the same person. 19 or more enable conformal p-values at alpha 0.05.","type":"array","items":{"type":"object","properties":{"biomarkers":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"null"}]},"description":"Biomarker key → value, as returned by the analyze endpoints."},"captured_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"ISO 8601 date-time with a UTC offset."}},"required":["biomarkers"],"additionalProperties":false}},"stats":{"description":"Alternatively, per-biomarker baseline mean, standard deviation and count.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"object","properties":{"mean":{"type":"number"},"sd":{"type":"number","minimum":0},"n":{"type":"integer","minimum":2,"maximum":9007199254740991}},"required":["mean","sd","n"],"additionalProperties":false}}},"additionalProperties":false},"instruments":{"$ref":"#/components/schemas/Instruments"},"context":{"type":"object","properties":{"setting":{"type":"string","enum":["primary_care","specialty_outpatient","mental_health","general_population","veterans"],"description":"Care setting; selects the prevalence prior and setting-specific likelihood ratios."},"pretest_probability":{"description":"Your own pre-test probabilities; they override the setting priors.","type":"object","propertyNames":{"type":"string","enum":["mdd","gad","ptsd","bipolar"]},"additionalProperties":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}}},"additionalProperties":false},"options":{"type":"object","properties":{"alpha_watch":{"type":"number","exclusiveMinimum":0,"maximum":0.2},"alpha_review":{"type":"number","exclusiveMinimum":0,"maximum":0.1},"rho_within_modality":{"type":"number","minimum":0,"maximum":0.95},"rho_across_modalities":{"type":"number","minimum":0,"maximum":0.95},"rho_same_condition":{"type":"number","minimum":0,"maximum":0.95},"min_baseline":{"type":"integer","minimum":3,"maximum":100}},"additionalProperties":false}},"required":["current"],"additionalProperties":false},"Problem":{"type":"object","description":"RFC 9457 problem details.","required":["type","title","status","code","detail","request_id"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"enum":["invalid_json","invalid_request","unauthorized","not_found","method_not_allowed","payload_too_large","unsupported_media_type","validation_failed","invalid_audio","rate_limited","internal_error"]},"detail":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}},"Quality":{"type":"object","description":"What was measured and why any value is missing. flags lists every gate that withheld a value.","properties":{"flags":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"ApiIndex":{"type":"object","properties":{"object":{"const":"api"},"api_version":{"type":"string"},"engine":{"type":"object"},"docs":{"type":"string"},"endpoints":{"type":"array"}}},"Health":{"type":"object","required":["status"],"properties":{"status":{"const":"ok"},"api_version":{"type":"string"},"engine":{"type":"object"},"time":{"type":"string","format":"date-time"}}},"OpenApiDocument":{"type":"object","description":"An OpenAPI 3.1 document."},"SampleRequest":{"type":"object","description":"A request body for the named endpoint, ready to POST to it unchanged."},"Biomarker":{"type":"object","required":["object","key","name","modality","unit","definition","method","associations","domain","references"],"properties":{"object":{"const":"biomarker"},"key":{"type":"string"},"name":{"type":"string"},"modality":{"enum":["vocal","physiological","facial","clinical"]},"group":{"type":"string"},"unit":{"type":"string"},"definition":{"type":"string"},"method":{"type":"string"},"gate":{"type":"string"},"associations":{"type":"array","items":{"type":"object","properties":{"condition":{"enum":["depression","anxiety","ptsd","bipolar","schizophrenia","suicide"]},"direction":{"enum":["up","down","different","mixed","ns"]},"evidence":{"enum":["MA","R","S",null]},"refs":{"type":"array","items":{"type":"string"}},"note":{"type":"string"}}}},"domain":{"oneOf":[{"type":"null"},{"type":"object","properties":{"key":{"type":"string"},"concern":{"enum":["up","down"]},"weight":{"enum":[0.5,1]},"rationale":{"type":"string"}}}]},"references":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"cite":{"type":"string"},"link":{"type":["string","null"]}}}}}},"BiomarkerList":{"type":"object","properties":{"object":{"const":"list"},"count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Biomarker"}}}},"VocalAnalysis":{"type":"object","required":["object","id","created","api_version","mode","engine","intended_use","input","separation","speakers"],"properties":{"object":{"const":"vocal.analysis"},"id":{"type":"string"},"created":{"type":"string","format":"date-time"},"api_version":{"const":"v1"},"mode":{"enum":["sandbox","live"]},"engine":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"vocal":{"type":"string"}}},"intended_use":{"type":"string"},"input":{"type":"object","properties":{"sample_rate_hz":{"type":"integer"},"channels":{"type":"integer"},"duration_s":{"type":"number"},"bits_per_sample":{"type":"integer"},"encoding":{"enum":["pcm","float"]}}},"separation":{"enum":["channels","none"]},"speakers":{"type":"array","items":{"type":"object","required":["label","channel","biomarkers","quality"],"properties":{"label":{"type":"string"},"channel":{"type":"integer"},"biomarkers":{"type":"object","additionalProperties":{"type":["number","null"]},"description":"Biomarker key → measured value, or null with the reason in quality.flags."},"mfcc":{"type":"object","properties":{"mean":{"type":["array","null"]},"sd":{"type":["array","null"]}}},"quality":{"$ref":"#/components/schemas/Quality"}}}}}},"PhysiologicalAnalysis":{"type":"object","required":["object","id","created","api_version","mode","engine","intended_use","biomarkers","quality"],"properties":{"object":{"const":"physiological.analysis"},"id":{"type":"string"},"created":{"type":"string","format":"date-time"},"api_version":{"const":"v1"},"mode":{"enum":["sandbox","live"]},"engine":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"vocal":{"type":"string"}}},"intended_use":{"type":"string"},"biomarkers":{"type":"object","additionalProperties":{"type":["number","null"]},"description":"Biomarker key → measured value, or null with the reason in quality.flags."},"quality":{"type":"object","additionalProperties":true}}},"FacialAnalysis":{"type":"object","required":["object","id","created","api_version","mode","engine","intended_use","biomarkers","quality"],"properties":{"object":{"const":"facial.analysis"},"id":{"type":"string"},"created":{"type":"string","format":"date-time"},"api_version":{"const":"v1"},"mode":{"enum":["sandbox","live"]},"engine":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"vocal":{"type":"string"}}},"intended_use":{"type":"string"},"biomarkers":{"type":"object","additionalProperties":{"type":["number","null"]},"description":"Biomarker key → measured value, or null with the reason in quality.flags."},"quality":{"$ref":"#/components/schemas/Quality"}}},"Safety":{"type":"object","required":["review_required","priority","reasons"],"properties":{"review_required":{"type":"boolean"},"priority":{"enum":["routine","elevated","urgent"]},"reasons":{"type":"array","items":{"type":"string"}}}},"ClinicalContextAnalysis":{"type":"object","required":["object","id","created","api_version","mode","engine","intended_use","instruments","biomarkers","diagnoses","safety"],"properties":{"object":{"const":"clinical_context.analysis"},"id":{"type":"string"},"created":{"type":"string","format":"date-time"},"api_version":{"const":"v1"},"mode":{"enum":["sandbox","live"]},"engine":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"vocal":{"type":"string"}}},"intended_use":{"type":"string"},"instruments":{"type":"object","additionalProperties":true},"language":{"type":["object","null"]},"biomarkers":{"type":"object","additionalProperties":{"type":["number","null"]},"description":"Biomarker key → measured value, or null with the reason in quality.flags."},"diagnoses":{"type":"array","items":{"type":"object"}},"safety":{"$ref":"#/components/schemas/Safety"}}},"Inference":{"type":"object","required":["object","id","created","api_version","mode","engine","intended_use","tier","change","conditions","safety","biomarker_model"],"properties":{"object":{"const":"inference"},"id":{"type":"string"},"created":{"type":"string","format":"date-time"},"api_version":{"const":"v1"},"mode":{"enum":["sandbox","live"]},"engine":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"vocal":{"type":"string"}}},"intended_use":{"type":"string"},"tier":{"enum":["stable","watch","review"]},"change":{"type":"object","description":"Within-person change: method, per-biomarker deviations, per-domain scores, p-values, q-values and tiers, and the guarantee."},"conditions":{"type":"array","items":{"type":"object","properties":{"condition":{"enum":["mdd","gad","ptsd","bipolar"]},"status":{"enum":["computed","prior_required","no_evidence"]},"prior":{"type":["object","null"]},"evidence":{"type":"array"},"combined_likelihood_ratio":{"type":["number","null"]},"probability":{"type":["number","null"]}}}},"safety":{"$ref":"#/components/schemas/Safety"},"biomarker_model":{"type":"object","properties":{"status":{"enum":["not_configured","applied","unavailable"]}}}}},"Analysis":{"type":"object","required":["object","id","created","api_version","mode","engine","intended_use","modalities","biomarkers","inference"],"properties":{"object":{"const":"analysis"},"id":{"type":"string"},"created":{"type":"string","format":"date-time"},"api_version":{"const":"v1"},"mode":{"enum":["sandbox","live"]},"engine":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"vocal":{"type":"string"}}},"intended_use":{"type":"string"},"modalities":{"type":"object","properties":{"vocal":{"type":["object","null"]},"physiological":{"type":["object","null"]},"facial":{"type":["object","null"]},"clinical_context":{"type":["object","null"]}}},"subject":{"type":"object"},"biomarkers":{"type":"object","additionalProperties":{"type":["number","null"]},"description":"Biomarker key → measured value, or null with the reason in quality.flags."},"inference":{"type":"object"}}},"AnalyzeRequest":{"type":"object","description":"JSON form of /v1/analyze (audio requires multipart/form-data, with the same names as parts).","properties":{"vocal":{"$ref":"#/components/schemas/VocalOptions"},"physiological":{"$ref":"#/components/schemas/PhysiologicalRequest"},"facial":{"$ref":"#/components/schemas/FacialRequest"},"clinical_context":{"$ref":"#/components/schemas/ClinicalContextRequest"},"baseline":{"type":"object","description":"As in /v1/inference."},"context":{"type":"object","description":"As in /v1/inference."},"options":{"type":"object","description":"As in /v1/inference."}}}}}}