{"openapi":"3.1.0","info":{"title":"TraceCDS API","description":"Traceable, source-checked answers to drug-information questions, kept within FDA's non-device clinical decision support criteria. Every statement is verified against its cited source and directive language is removed before the answer is returned.\n\n**Research use only. Not for clinical use. Not a medical device.**\n\nAuthenticate with an API key: `Authorization: Bearer <key>` (or the `X-API-Key` header).","version":"0.2.0"},"paths":{"/v1/health":{"get":{"tags":["service"],"summary":"Liveness check (no key required)","operationId":"v1_health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response V1 Health V1 Health Get"}}}}}}},"/v1/info":{"get":{"tags":["service"],"summary":"Service capabilities and options","operationId":"v1_info_v1_info_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response V1 Info V1 Info Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ask":{"post":{"tags":["answers"],"summary":"Ask a drug-information question","description":"Returns source-checked statements, their cited sources (with trust tier and effective date), the FDA non-device CDS criteria results, limitations, and any statements that were removed because they could not be verified.","operationId":"v1_ask_v1_ask_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/interactions":{"post":{"tags":["answers"],"summary":"Check drug–drug interactions","description":"Reports what the drugs' FDA labels say about interactions among them — surfacing passages in one drug's label that name another of the drugs first. Each statement is cited and verified against its source. Reports what the labels say; it does not decide whether to co-prescribe.","operationId":"v1_interactions_v1_interactions_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1InteractionsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"V1AskRequest":{"properties":{"question":{"type":"string","title":"Question","description":"The drug-information question to answer.","examples":["What are the contraindications for metformin?"]},"answer_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer Mode","description":"One of ['Written answer', 'Quoted from label']. Default: Written answer."},"source_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mode","description":"One of ['FDA labels only']. Default: FDA labels only."},"history":{"items":{"type":"string"},"type":"array","title":"History","description":"Prior user questions (oldest first) so follow-ups resolve references."}},"type":"object","required":["question"],"title":"V1AskRequest"},"V1AskResponse":{"properties":{"status":{"type":"string","title":"Status","description":"answered | abstained | blocked"},"question":{"type":"string","title":"Question","description":"The question as received."},"query_used":{"type":"string","title":"Query Used","description":"The (possibly rewritten) standalone query used for retrieval."},"answer_mode":{"type":"string","title":"Answer Mode"},"source_mode":{"type":"string","title":"Source Mode"},"message":{"type":"string","title":"Message"},"statements":{"items":{"type":"string"},"type":"array","title":"Statements"},"citations":{"items":{"$ref":"#/components/schemas/V1Citation"},"type":"array","title":"Citations"},"criteria":{"items":{"$ref":"#/components/schemas/V1Criterion"},"type":"array","title":"Criteria"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"removed_statements":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Removed Statements"}},"type":"object","required":["status","question","query_used","answer_mode","source_mode","message","statements","citations","criteria","limitations","warnings","removed_statements"],"title":"V1AskResponse"},"V1Citation":{"properties":{"label":{"type":"string","title":"Label"},"score":{"type":"number","title":"Score"},"passage_id":{"type":"string","title":"Passage Id"},"text":{"type":"string","title":"Text"},"drug":{"type":"string","title":"Drug"},"section":{"type":"string","title":"Section"},"source_title":{"type":"string","title":"Source Title"},"source_url":{"type":"string","title":"Source Url"},"effective_date":{"type":"string","title":"Effective Date"},"is_table":{"type":"boolean","title":"Is Table"},"trust":{"type":"string","title":"Trust","description":"approved | reputable | unverified"},"publisher":{"type":"string","title":"Publisher"}},"type":"object","required":["label","score","passage_id","text","drug","section","source_title","source_url","effective_date","is_table","trust","publisher"],"title":"V1Citation"},"V1Criterion":{"properties":{"criterion":{"type":"integer","title":"Criterion"},"name":{"type":"string","title":"Name"},"passed":{"type":"boolean","title":"Passed"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["criterion","name","passed","detail"],"title":"V1Criterion"},"V1InteractionsRequest":{"properties":{"drugs":{"items":{"type":"string"},"type":"array","minItems":2,"title":"Drugs","description":"Two or more generic drug names to check for interactions.","examples":[["warfarin","amoxicillin"]]},"answer_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer Mode","description":"One of ['Written answer', 'Quoted from label']. Default: Written answer."}},"type":"object","required":["drugs"],"title":"V1InteractionsRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}