{"info":{"version":"0.1.0","description":"Clinical ground-truth APIs gated by x402 V2 payments (USDC on Base). Human docs at https://magentlab.com/docs. See /llms.txt for agent onboarding and /v1/catalog for parameters and prices. Not a medical device.","title":"magent API","contact":{"url":"https://magentlab.com"}},"components":{"securitySchemes":{"x402":{"description":"x402 V2 PAYMENT-SIGNATURE (base64 JSON)","in":"header","name":"PAYMENT-SIGNATURE","type":"apiKey"}},"x-x402":{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","network":"eip155:8453","scheme":"exact","version":2}},"paths":{"/.well-known/x402":{"get":{"description":"version + resource URLs for x402scan and agents.","summary":"x402 discovery manifest","responses":{"200":{"description":"application/json"}}}},"/api/calc/bsa_mosteller":{"get":{"description":"Mosteller body surface area from height and weight. Use for oncology dosing arithmetic. Deterministic published formula with citation; not a dosing recommendation. Requires x402 V2 payment (USDC on Base).","parameters":[{"in":"query","name":"height_cm","description":"Height in centimeters. Provide height_cm or height_in.","required":false,"schema":{"type":"number"},"example":"170"},{"in":"query","name":"weight_kg","description":"Weight in kilograms. Provide weight_kg or weight_lb.","required":false,"schema":{"type":"number"},"example":"70"},{"in":"query","name":"height_in","description":"Height in inches. Converted as cm = in * 2.54.","required":false,"schema":{"type":"number"},"example":"67"},{"in":"query","name":"weight_lb","description":"Weight in pounds. Converted as kg = lb * 0.45359237.","required":false,"schema":{"type":"number"},"example":"154"}],"summary":"Mosteller BSA","responses":{"200":{"description":"200 JSON fields: formula, formula_expression, height_cm, weight_kg, bsa_m2, citation, disclaimer.","content":{"application/json":{"example":{"disclaimer":"Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.","bsa_m2":1.8181,"citation":{"authors":"Mosteller RD","doi":"10.1056/NEJM198710223171717","id":"mosteller-1987","source":"N Engl J Med. 1987;317(17):1098","title":"Simplified calculation of body-surface area"},"formula":"mosteller","formula_expression":"BSA_m2 = sqrt((height_cm * weight_kg) / 3600)","height_cm":170.0,"weight_kg":70.0}}}},"400":{"description":"invalid_height: height_cm (50-250) or height_in (20-98) is required; invalid_weight: weight_kg (1-500) or weight_lb (2-1100) is required"},"402":{"description":"Payment required. Decode the PAYMENT-REQUIRED header (base64 JSON)."},"409":{"description":"payment_in_progress: The same authorization nonce is already being settled; retry shortly"},"429":{"description":"rate_limited: Too many requests from this client"},"503":{"description":"settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE; facilitator_unavailable: Payment facilitator unavailable; facilitator_misconfigured: Payment facilitator is not configured; facilitator_unauthorized: Payment facilitator rejected credentials; ledger_unavailable: Payment ledger unavailable; payment_unavailable: Payment processing unavailable"}},"security":[{"x402":[]}],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}}}},"/api/calc/cha2ds2_vasc":{"get":{"description":"CHA2DS2-VASc score from discrete clinical flags. Use for stroke-risk stratification arithmetic in atrial fibrillation. Deterministic published score with citation. Requires x402 V2 payment (USDC on Base).","parameters":[{"in":"query","name":"age","description":"Age in years (18-120). ≥75 scores 2; 65-74 scores 1.","required":true,"schema":{"type":"integer"},"example":"78"},{"in":"query","name":"sex","description":"female scores 1 (Sc); male scores 0.","required":true,"schema":{"type":"string","enum":["female","male"]},"example":"female"},{"in":"query","name":"chf","description":"Congestive heart failure or LV dysfunction. true or false.","required":true,"schema":{"type":"boolean"},"example":"false"},{"in":"query","name":"hypertension","description":"Hypertension history. true or false.","required":true,"schema":{"type":"boolean"},"example":"true"},{"in":"query","name":"diabetes","description":"Diabetes mellitus. true or false.","required":true,"schema":{"type":"boolean"},"example":"true"},{"in":"query","name":"stroke_tia","description":"Prior stroke, TIA, or thromboembolism. true or false (2 points).","required":true,"schema":{"type":"boolean"},"example":"false"},{"in":"query","name":"vascular_disease","description":"Prior MI, peripheral artery disease, or aortic plaque. true or false.","required":true,"schema":{"type":"boolean"},"example":"false"}],"summary":"CHA2DS2-VASc","responses":{"200":{"description":"200 JSON fields: formula, score, max_score, sex, age_years, components, citation, disclaimer.","content":{"application/json":{"example":{"components":[{"factor":"congestive_heart_failure","points":0,"present":false},{"factor":"hypertension","points":1,"present":true},{"value":78,"factor":"age","points":2,"present":true},{"factor":"diabetes","points":1,"present":true},{"factor":"stroke_tia_thromboembolism","points":0,"present":false},{"factor":"vascular_disease","points":0,"present":false},{"factor":"sex_female","points":1,"present":true}],"disclaimer":"Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.","citation":{"authors":"Lip GYH, Nieuwlaat R, Pisters R, Lane DA, Crijns HJ","doi":"10.1378/chest.09-1584","id":"lip-2010","source":"Chest. 2010;137(2):263-272","title":"Refining clinical risk stratification for predicting stroke and thromboembolism in atrial fibrillation using a novel risk factor-based approach: the euro heart survey on atrial fibrillation"},"formula":"cha2ds2_vasc","age_years":78,"max_score":9,"score":5,"sex":"female"}}}},"400":{"description":"invalid_age: age must be an integer from 18 to 120; invalid_sex: sex must be female or male; invalid_flag: chf, hypertension, diabetes, stroke_tia, and vascular_disease must be true or false"},"402":{"description":"Payment required. Decode the PAYMENT-REQUIRED header (base64 JSON)."},"409":{"description":"payment_in_progress: The same authorization nonce is already being settled; retry shortly"},"429":{"description":"rate_limited: Too many requests from this client"},"503":{"description":"settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE; facilitator_unavailable: Payment facilitator unavailable; facilitator_misconfigured: Payment facilitator is not configured; facilitator_unauthorized: Payment facilitator rejected credentials; ledger_unavailable: Payment ledger unavailable; payment_unavailable: Payment processing unavailable"}},"security":[{"x402":[]}],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}}}},"/api/calc/egfr_ckd_epi":{"get":{"description":"CKD-EPI 2021 creatinine eGFR (race-free). Use when an agent must not guess kidney function from a language model. Deterministic published formula with citation. Requires x402 V2 payment (USDC on Base).","parameters":[{"in":"query","name":"creatinine_mg_dl","description":"Serum creatinine in mg/dL. Provide this or creatinine_umol_l.","required":false,"schema":{"type":"number"},"example":"1.1"},{"in":"query","name":"creatinine_umol_l","description":"Serum creatinine in µmol/L. Converted as mg/dL = µmol/L / 88.42.","required":false,"schema":{"type":"number"},"example":"97.2"},{"in":"query","name":"age","description":"Age in years (18-120). CKD-EPI 2021 is validated in adults.","required":true,"schema":{"type":"integer"},"example":"65"},{"in":"query","name":"sex","description":"Sex used by the published equation. female or male.","required":true,"schema":{"type":"string","enum":["female","male"]},"example":"female"}],"summary":"CKD-EPI 2021 eGFR","responses":{"200":{"description":"200 JSON fields: formula, formula_expression, creatinine_mg_dl, age_years, sex, egfr_ml_min_1_73m2, units, citation, disclaimer.","content":{"application/json":{"example":{"units":"mL/min/1.73m2","disclaimer":"Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.","citation":{"authors":"Inker LA, Eneanya ND, Coresh J, et al.","doi":"10.1056/NEJMoa2102953","id":"inker-2021","source":"N Engl J Med. 2021;385(19):1737-1749","title":"New Creatinine- and Cystatin C-Based Equations to Estimate GFR without Race"},"formula":"ckd_epi_2021_creatinine","formula_expression":"142 * min(Scr/κ,1)^α * max(Scr/κ,1)^(-1.200) * 0.9938^age * (1.012 if female)","age_years":65,"sex":"female","creatinine_mg_dl":1.1,"egfr_ml_min_1_73m2":55.8}}}},"400":{"description":"invalid_creatinine: creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required; invalid_age: age must be an integer from 18 to 120; invalid_sex: sex must be female or male"},"402":{"description":"Payment required. Decode the PAYMENT-REQUIRED header (base64 JSON)."},"409":{"description":"payment_in_progress: The same authorization nonce is already being settled; retry shortly"},"429":{"description":"rate_limited: Too many requests from this client"},"503":{"description":"settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE; facilitator_unavailable: Payment facilitator unavailable; facilitator_misconfigured: Payment facilitator is not configured; facilitator_unauthorized: Payment facilitator rejected credentials; ledger_unavailable: Payment ledger unavailable; payment_unavailable: Payment processing unavailable"}},"security":[{"x402":[]}],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}}}},"/api/ontology/translate":{"get":{"description":"Map a natural-language drug, diagnosis, or lab phrase to a current RxNorm, ICD-10-CM, or LOINC code. Use when an agent must not hallucinate or invent a billing/pharmacy code. Requires x402 V2 payment (USDC on Base).","parameters":[{"in":"query","name":"query","description":"Natural-language drug, diagnosis, or lab description. Max 512 characters. Do not send patient names.","required":true,"schema":{"type":"string"},"example":"Tylenol 500mg"},{"in":"query","name":"system","description":"Restrict to rxnorm, icd10 (ICD-10-CM), or loinc. Omit to search all.","required":false,"schema":{"type":"string","enum":["rxnorm","icd10","loinc"]},"example":"rxnorm"},{"in":"query","name":"tty","description":"Restrict term type. Pharmacy orders typically want SCD. ICD-10-CM is CM; LOINC is LN.","required":false,"schema":{"type":"string","enum":["SCD","SBD","IN","PIN","MIN","BN","GPCK","BPCK","DF","SCDC","SBDC","SCDF","SBDF","CM","LN"]},"example":"SCD"},{"in":"query","name":"limit","description":"Number of ranked matches to return (1-25). Default 5.","required":false,"schema":{"default":5,"type":"integer"},"example":"5"},{"in":"query","name":"min_score","description":"Minimum rank score 0-100. Default 35.","required":false,"schema":{"default":35,"type":"integer"},"example":"35"},{"in":"query","name":"include_obsolete","description":"Include deprecated/obsolete codes. Default false.","required":false,"schema":{"default":false,"type":"boolean"},"example":"false"},{"in":"query","name":"billable_only","description":"ICD-10-CM: return only HIPAA billable codes, not headers. Default true.","required":false,"schema":{"default":true,"type":"boolean"},"example":"true"}],"summary":"Ontology translation","responses":{"200":{"description":"200 JSON fields: query, system, match_count, match_quality, matches, catalog, disclaimer.","content":{"application/json":{"example":{"system":"rxnorm","matches":[{"code":"198440","status":"current","system":"rxnorm","display":"acetaminophen 500 MG Oral Tablet","tty":"SCD","obsolete":false,"billable":null,"score":95}],"query":"Tylenol 500mg","disclaimer":"Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.","catalog":{"coverage":"full","icd10cm_fy":"FY2026-04","license":{"icd10cm":"ICD-10-CM from CMS/NCHS. US claims codes, not WHO ICD-10.","loinc":"This material contains content from LOINC (http://loinc.org). LOINC is copyright © Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc.","rxnorm":"This product uses publicly available data courtesy of the U.S. National Library of Medicine (NLM), National Institutes of Health, Department of Health and Human Services; NLM is not responsible for the product and does not endorse or recommend this or any other product."},"loinc_version":"2.82","notes":"ICD-10 entries are ICD-10-CM (US claims), not WHO ICD-10. RxNorm is Current Prescribable Content until a licensed full monthly ingest lands.","rxnorm_release":"2026-08-03","source":"postgres ingest","systems":["rxnorm","icd10","loinc"],"version":"icd10:FY2026-04|loinc:2.82|rxnorm:2026-08-03"},"match_count":1,"match_quality":"high"}}}},"400":{"description":"invalid_query: query is required and must be 1-512 characters; invalid_system: system must be rxnorm, icd10, or loinc; invalid_tty: tty must be a known RxNorm, ICD-10-CM, or LOINC term type; invalid_limit: limit must be an integer from 1 to 25; invalid_min_score: min_score must be an integer from 0 to 100"},"402":{"description":"Payment required. Decode the PAYMENT-REQUIRED header (base64 JSON)."},"409":{"description":"payment_in_progress: The same authorization nonce is already being settled; retry shortly"},"429":{"description":"rate_limited: Too many requests from this client"},"503":{"description":"settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE; facilitator_unavailable: Payment facilitator unavailable; facilitator_misconfigured: Payment facilitator is not configured; facilitator_unauthorized: Payment facilitator rejected credentials; ledger_unavailable: Payment ledger unavailable; payment_unavailable: Payment processing unavailable"}},"security":[{"x402":[]}],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}}}},"/health":{"get":{"summary":"Liveness probe","responses":{"200":{"description":"OK"}}}},"/llms-full.txt":{"get":{"description":"Per-tool params, curl, and Cursor mcp.json. Ping is smoke-test only.","summary":"Expanded agent onboarding","responses":{"200":{"description":"text/plain"}}}},"/llms.txt":{"get":{"description":"Plain-text instructions for discovering, paying, and calling tools.","summary":"Agent onboarding text","responses":{"200":{"description":"text/plain"}}}},"/ready":{"get":{"summary":"Readiness probe","responses":{"200":{"description":"Ready"},"503":{"description":"Not ready"}}}},"/v1/catalog":{"get":{"description":"Lists paid tools with prices, query parameters, example URLs, example responses, and error codes.","summary":"Machine-readable tool catalog","responses":{"200":{"description":"Catalog"}}}},"/v1/tools/ping":{"get":{"description":"Confirms the x402 gate and PAYMENT-RESPONSE. Not a product tool. Do not call for production work. Not listed on Bazaar. Requires x402 V2 payment (USDC on Base).","parameters":[{"in":"query","name":"probe","description":"Ignored. Payment smoke test takes no input.","required":false,"schema":{"type":"string"},"example":"ok"}],"summary":"Payment smoke test","responses":{"200":{"description":"200 JSON fields: ok, service.","content":{"application/json":{"example":{"ok":true,"service":"magent"}}}},"402":{"description":"Payment required. Decode the PAYMENT-REQUIRED header (base64 JSON)."},"409":{"description":"payment_in_progress: The same authorization nonce is already being settled; retry shortly"},"429":{"description":"rate_limited: Too many requests from this client"},"503":{"description":"settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE; facilitator_unavailable: Payment facilitator unavailable; facilitator_misconfigured: Payment facilitator is not configured; facilitator_unauthorized: Payment facilitator rejected credentials; ledger_unavailable: Payment ledger unavailable; payment_unavailable: Payment processing unavailable"}},"security":[{"x402":[]}],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.001"}}}}},"openapi":"3.1.0","servers":[{"url":"https://api.magentlab.com"}],"x-discovery":{"ownershipProofs":["0x33236133BecE789D551d0B5c4f9A50095d4b57d3"]}}