# magent (full) magent is pay-per-request clinical ground truth for autonomous medical agents. USDC on Base via x402 V2. No API keys. Distinct from npm `@x402/fetch` (a payment fetch wrapper). Call this API with that wrapper. Site: https://magentlab.com API: https://api.magentlab.com Manifest: GET https://api.magentlab.com/.well-known/x402 Catalog: GET https://api.magentlab.com/v1/catalog OpenAPI: GET https://api.magentlab.com/openapi.json Short onboarding: GET https://api.magentlab.com/llms.txt ## Pay (x402 V2) 1. GET the tool with `Accept: application/json`. 2. HTTP 402. Decode the base64 `PAYMENT-REQUIRED` header. 3. Retry the same URL with `PAYMENT-SIGNATURE` (base64 JSON echoing `accepted`, `payload`, and `extensions` when present). 4. Success is HTTP 200 JSON plus `PAYMENT-RESPONSE`. Settlement happens before the tool runs. ## Cursor mcp.json { "mcpServers": { "magent": { "args": [ "-y", "@magent/mcp" ], "command": "npx", "env": { "X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY" } } } } ## @x402/fetch example ```js import { wrapFetchWithPayment } from "@x402/fetch"; const paid = wrapFetchWithPayment(fetch, account); const res = await paid("https://api.magentlab.com/api/ontology/translate?query=Tylenol%20500mg&system=rxnorm"); ``` ## Ontology translation GET /api/ontology/translate Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/ontology/translate?query=Tylenol%20500mg&system=rxnorm Human docs: https://magentlab.com/docs/ontology x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/ontology/translate?query=Tylenol%20500mg&system=rxnorm" - query (query, required): Natural-language drug, diagnosis, or lab description. Max 512 characters. Do not send patient names. - system (query, optional, enum rxnorm|icd10|loinc): Restrict to rxnorm, icd10 (ICD-10-CM), or loinc. Omit to search all. - tty (query, optional, enum SCD|SBD|IN|PIN|MIN|BN|GPCK|BPCK|DF|SCDC|SBDC|SCDF|SBDF|CM|LN): Restrict term type. Pharmacy orders typically want SCD. ICD-10-CM is CM; LOINC is LN. - limit (query, optional, default 5): Number of ranked matches to return (1-25). Default 5. - min_score (query, optional, default 35): Minimum rank score 0-100. Default 35. - include_obsolete (query, optional, default false): Include deprecated/obsolete codes. Default false. - billable_only (query, optional, default true): ICD-10-CM: return only HIPAA billable codes, not headers. Default true. - HTTP 400 invalid_query: query is required and must be 1-512 characters - HTTP 400 invalid_system: system must be rxnorm, icd10, or loinc - HTTP 400 invalid_tty: tty must be a known RxNorm, ICD-10-CM, or LOINC term type - HTTP 400 invalid_limit: limit must be an integer from 1 to 25 - HTTP 400 invalid_min_score: min_score must be an integer from 0 to 100 - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "system": "rxnorm", "matches": [ { "code": "198440", "status": "current", "system": "rxnorm", "display": "acetaminophen 500 MG Oral Tablet", "tty": "SCD", "obsolete": false, "score": 95, "billable": null } ], "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" } ## Ontology lookup GET /api/ontology/lookup Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/ontology/lookup?system=rxnorm&code=198440 Human docs: https://magentlab.com/docs/ontology-lookup x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/ontology/lookup?system=rxnorm&code=198440" - system (query, required, enum rxnorm|icd10|loinc): rxnorm, icd10 (ICD-10-CM), or loinc. - code (query, required): Exact published identifier. ICD-10-CM accepts dotted or compact form (E11.9 or E119). Max 32 characters. - HTTP 400 invalid_system: system must be rxnorm, icd10, or loinc - HTTP 400 invalid_code: code is required and must be 1-32 characters - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "code": "198440", "status": "current", "system": "rxnorm", "display": "acetaminophen 500 MG Oral Tablet", "tty": "SCD", "obsolete": false, "found": 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.", "billable": null, "synonyms": [ "acetaminophen 500 MG Oral Tablet", "APAP 500 MG Oral Tablet" ], "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" } } ## Mosteller BSA GET /api/calc/bsa_mosteller Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/calc/bsa_mosteller?height_cm=170&weight_kg=70 Human docs: https://magentlab.com/docs/bsa x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/bsa_mosteller?height_cm=170&weight_kg=70" - height_cm (query, optional): Height in centimeters. Provide height_cm or height_in. - weight_kg (query, optional): Weight in kilograms. Provide weight_kg or weight_lb. - height_in (query, optional): Height in inches. Converted as cm = in * 2.54. - weight_lb (query, optional): Weight in pounds. Converted as kg = lb * 0.45359237. - HTTP 400 invalid_height: height_cm (50-250) or height_in (20-98) is required - HTTP 400 invalid_weight: weight_kg (1-500) or weight_lb (2-1100) is required - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "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": "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)", "weight_kg": 70.0, "bsa_m2": 1.8181, "height_cm": 170.0 } ## CKD-EPI 2021 eGFR GET /api/calc/egfr_ckd_epi Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/calc/egfr_ckd_epi?creatinine_mg_dl=1.1&age=65&sex=female Human docs: https://magentlab.com/docs/egfr x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/egfr_ckd_epi?creatinine_mg_dl=1.1&age=65&sex=female" - creatinine_mg_dl (query, optional): Serum creatinine in mg/dL. Provide this or creatinine_umol_l. - creatinine_umol_l (query, optional): Serum creatinine in µmol/L. Converted as mg/dL = µmol/L / 88.42. - age (query, required): Age in years (18-120). CKD-EPI 2021 is validated in adults. - sex (query, required, enum female|male): Sex used by the published equation. female or male. - HTTP 400 invalid_creatinine: creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required - HTTP 400 invalid_age: age must be an integer from 18 to 120 - HTTP 400 invalid_sex: sex must be female or male - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "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.", "age_years": 65, "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" }, "creatinine_mg_dl": 1.1, "egfr_ml_min_1_73m2": 55.8, "formula": "ckd_epi_2021_creatinine", "formula_expression": "142 * min(Scr/κ,1)^α * max(Scr/κ,1)^(-1.200) * 0.9938^age * (1.012 if female)", "sex": "female" } ## CHA2DS2-VASc GET /api/calc/cha2ds2_vasc Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/calc/cha2ds2_vasc?age=78&sex=female&chf=false&hypertension=true&diabetes=true&stroke_tia=false&vascular_disease=false Human docs: https://magentlab.com/docs/cha2ds2-vasc x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/cha2ds2_vasc?age=78&sex=female&chf=false&hypertension=true&diabetes=true&stroke_tia=false&vascular_disease=false" - age (query, required): Age in years (18-120). ≥75 scores 2; 65-74 scores 1. - sex (query, required, enum female|male): female scores 1 (Sc); male scores 0. - chf (query, required): Congestive heart failure or LV dysfunction. true or false. - hypertension (query, required): Hypertension history. true or false. - diabetes (query, required): Diabetes mellitus. true or false. - stroke_tia (query, required): Prior stroke, TIA, or thromboembolism. true or false (2 points). - vascular_disease (query, required): Prior MI, peripheral artery disease, or aortic plaque. true or false. - HTTP 400 invalid_age: age must be an integer from 18 to 120 - HTTP 400 invalid_sex: sex must be female or male - HTTP 400 invalid_flag: boolean clinical flags must be true or false - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "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.", "age_years": 78, "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", "sex": "female", "max_score": 9, "score": 5 } ## BMI GET /api/calc/bmi Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/calc/bmi?height_cm=170&weight_kg=70 Human docs: https://magentlab.com/docs/bmi x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/bmi?height_cm=170&weight_kg=70" - height_cm (query, optional): Height in centimeters. Provide height_cm or height_in. - weight_kg (query, optional): Weight in kilograms. Provide weight_kg or weight_lb. - height_in (query, optional): Height in inches. Converted as cm = in * 2.54. - weight_lb (query, optional): Weight in pounds. Converted as kg = lb * 0.45359237. - HTTP 400 invalid_height: height_cm (50-250) or height_in (20-98) is required - HTTP 400 invalid_weight: weight_kg (1-500) or weight_lb (2-1100) is required - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "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": "Keys A, Fidanza F, Karvonen MJ, Kimura N, Taylor HL", "doi": "10.1016/0021-9681(72)90027-6", "id": "keys-1972", "source": "J Chronic Dis. 1972;25(6):329-343", "title": "Indices of relative weight and obesity" }, "formula": "bmi", "formula_expression": "BMI = weight_kg / (height_m ^ 2)", "weight_kg": 70.0, "height_cm": 170.0, "bmi": 24.2, "who_adult_category": "normal" } ## HAS-BLED GET /api/calc/has_bled Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/calc/has_bled?age=78&hypertension=true&abnormal_renal=false&abnormal_liver=false&stroke=false&bleeding=false&labile_inr=false&drugs=false&alcohol=false Human docs: https://magentlab.com/docs/has-bled x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/has_bled?age=78&hypertension=true&abnormal_renal=false&abnormal_liver=false&stroke=false&bleeding=false&labile_inr=false&drugs=false&alcohol=false" - age (query, required): Age in years (18-120). Age >65 scores 1 (E). - hypertension (query, required): Uncontrolled hypertension (H). true or false. - abnormal_renal (query, required): Abnormal renal function (A). true or false. - abnormal_liver (query, required): Abnormal liver function (A). true or false. Renal and liver each score 1. - stroke (query, required): Prior stroke (S). true or false. - bleeding (query, required): Bleeding history or predisposition (B). true or false. - labile_inr (query, required): Labile INR (L). true or false. - drugs (query, required): Concomitant antiplatelet or NSAID (D). true or false. - alcohol (query, required): Alcohol excess (D). true or false. Drugs and alcohol each score 1. - HTTP 400 invalid_age: age must be an integer from 18 to 120 - HTTP 400 invalid_flag: boolean clinical flags must be true or false - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "components": [ { "factor": "hypertension", "points": 1, "present": true }, { "factor": "abnormal_renal", "points": 0, "present": false }, { "factor": "abnormal_liver", "points": 0, "present": false }, { "factor": "stroke", "points": 0, "present": false }, { "factor": "bleeding", "points": 0, "present": false }, { "factor": "labile_inr", "points": 0, "present": false }, { "value": 78, "factor": "elderly_age_gt_65", "points": 1, "present": true }, { "factor": "drugs", "points": 0, "present": false }, { "factor": "alcohol", "points": 0, "present": false } ], "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.", "age_years": 78, "citation": { "authors": "Pisters R, Lane DA, Nieuwlaat R, de Vos CB, Crijns HJ, Lip GYH", "doi": "10.1378/chest.10-0134", "id": "pisters-2010", "source": "Chest. 2010;138(5):1093-1100", "title": "A novel user-friendly score (HAS-BLED) to assess 1-year risk of major bleeding in patients with atrial fibrillation: the Euro Heart Survey" }, "formula": "has_bled", "max_score": 9, "score": 2 } ## Cockcroft–Gault CrCl GET /api/calc/crcl_cockcroft_gault Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/calc/crcl_cockcroft_gault?age=65&sex=female&weight_kg=70&creatinine_mg_dl=1.1 Human docs: https://magentlab.com/docs/crcl x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/crcl_cockcroft_gault?age=65&sex=female&weight_kg=70&creatinine_mg_dl=1.1" - age (query, required): Age in years (18-120). - sex (query, required, enum female|male): female applies the published 0.85 factor; male does not. - weight_kg (query, optional): Total body weight in kilograms. Provide weight_kg or weight_lb. - weight_lb (query, optional): Total body weight in pounds. Converted as kg = lb * 0.45359237. - creatinine_mg_dl (query, optional): Serum creatinine in mg/dL. Provide this or creatinine_umol_l. - creatinine_umol_l (query, optional): Serum creatinine in µmol/L. Converted as mg/dL = µmol/L / 88.42. - HTTP 400 invalid_age: age must be an integer from 18 to 120 - HTTP 400 invalid_sex: sex must be female or male - HTTP 400 invalid_weight: weight_kg (1-500) or weight_lb (2-1100) is required - HTTP 400 invalid_creatinine: creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "units": "mL/min", "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.", "age_years": 65, "citation": { "authors": "Cockcroft DW, Gault MH", "doi": "10.1159/000180580", "id": "cockcroft-1976", "source": "Nephron. 1976;16(1):31-41", "title": "Prediction of creatinine clearance from serum creatinine" }, "creatinine_mg_dl": 1.1, "formula": "cockcroft_gault", "formula_expression": "CrCl_mL_min = ((140 - age) * weight_kg * (0.85 if female else 1)) / (72 * Scr_mg_dL)", "sex": "female", "weight_kg": 70.0, "crcl_ml_min": 56.3, "weight_basis": "total_body_weight" } ## FIB-4 GET /api/calc/fib4 Price: $0.005 USDC (5000 atomic) on eip155:8453 Example: https://api.magentlab.com/api/calc/fib4?age=50&ast_u_l=100&alt_u_l=40&platelets_10e9_l=200 Human docs: https://magentlab.com/docs/fib4 x402 V2 curl (expect 402 until paid): curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/fib4?age=50&ast_u_l=100&alt_u_l=40&platelets_10e9_l=200" - age (query, required): Age in years (18-120). - ast_u_l (query, required): Aspartate aminotransferase in U/L (1-10000). - alt_u_l (query, required): Alanine aminotransferase in U/L (1-10000). - platelets_10e9_l (query, required): Platelet count in 10^9/L (1-2000). - HTTP 400 invalid_age: age must be an integer from 18 to 120 - HTTP 400 invalid_ast: ast_u_l must be a number from 1 to 10000 - HTTP 400 invalid_alt: alt_u_l must be a number from 1 to 10000 - HTTP 400 invalid_platelets: platelets_10e9_l must be a number from 1 to 2000 - HTTP 402 payment_required: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header - HTTP 409 payment_in_progress: The same authorization nonce is already being settled; retry shortly - HTTP 429 rate_limited: Too many requests from this client - HTTP 503 settlement_uncertain: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE - HTTP 503 facilitator_unavailable: Payment facilitator unavailable - HTTP 503 facilitator_misconfigured: Payment facilitator is not configured - HTTP 503 facilitator_unauthorized: Payment facilitator rejected credentials - HTTP 503 ledger_unavailable: Payment ledger unavailable - HTTP 503 payment_unavailable: Payment processing unavailable Example 200 (fixture, not a live lookup): { "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.", "age_years": 50, "citation": { "authors": "Sterling RK, Lissen E, Clumeck N, et al.", "doi": "10.1002/hep.21172", "id": "sterling-2006", "source": "Hepatology. 2006;43(6):1317-1325", "title": "Development of a simple noninvasive index to predict significant fibrosis in patients with HIV/HCV coinfection" }, "formula": "fib4", "formula_expression": "FIB-4 = (age_years * AST_U_L) / (platelets_10e9_L * sqrt(ALT_U_L))", "alt_u_l": 40.0, "ast_u_l": 100.0, "fib4": 3.95, "platelets_10e9_l": 200.0, "sterling_band": "high" } ## Payment smoke (not a product) GET /v1/tools/ping — $0.001 USDC. Confirms the x402 gate and PAYMENT-RESPONSE. Not a product tool. Do not call for production work. Not listed on Bazaar. Do not call GET /v1/tools/ping for production work; it is a payment smoke test only. ## Not a medical device Outputs are deterministic codes and published-formula arithmetic. A licensed clinician remains responsible for care.