MAGENT

Liver · LIVE

Revised original AIH score (IAIHG 1999)

Original AIH score

Sum the Alvarez 1999 revised original IAIHG autoimmune-hepatitis score from caller-assigned sex, ALP:AST or ALP:ALT ratio, globulin/IgG, ANA/SMA/LKM titer, AMA, viral markers, drugs, alcohol, additive histology, other autoimmune disease, and optional HLA/other autoantibodies and treatment response, and return pretreatment or posttreatment definite, probable, or not_aih.

LIVE $0.005 USDC GET /api/calc/aih_original

Markdown: /docs/aih-original.md · Canonical: https://magentlab.com/docs/aih-original

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Sum the Alvarez 1999 revised original IAIHG autoimmune-hepatitis score from caller-assigned sex, ALP:AST or ALP:ALT ratio, globulin/IgG, ANA/SMA/LKM titer, AMA, viral markers, drugs, alcohol, additive histology, other autoimmune disease, and optional HLA/other autoantibodies and treatment response, and return pretreatment or posttreatment definite, probable, or not_aih.

When to use

When an agent already has Alvarez 1999 table items assigned and needs the published total and pre/post bands, not an autoimmune-hepatitis diagnosis and not the Hennes 2008 simplified score.

When not to use

  • Not a medical device and not an autoimmune-hepatitis diagnosis, biopsy order, or immunosuppression order. magent does not examine the patient.
  • This is the Alvarez 1999 revised original IAIHG score, not the Hennes 2008 simplified AIH criteria.
  • magent does not titer autoantibodies, assay globulin/IgG vs ULN, or read liver histology. All items are caller-assigned. Optional HLA and other autoantibodies score only when ANA/SMA/LKM are seronegative (titer lt_1_40), as published.
  • This API does not collect names, MRNs, or dates of birth.

Formula

revised original IAIHG AIH (Alvarez 1999) = sex (male 0, female 2) + alp_ratio (lt_1_5 2, 1_5_to_3 0, gt_3 -2) + globulin_igg (lt_1x 0, 1_to_1_5x 1, 1_5_to_2x 2, gt_2x 3) + autoantibody_titer (lt_1_40 0, 1_40 1, 1_80 2, gt_1_80 3) + ama_positive (true -4) + viral_markers (positive -3, negative 3) + hepatotoxic_drugs (true -4, false 1) + alcohol (lt_25 2, 25_to_60 0, gt_60 -2) + histology (interface 3, lymphoplasmacytic 1, rosettes 1, none of those -5, biliary -3, other atypical -3; additive) + other_autoimmune_disease (true 2) + other_autoantibodies (true 2 if titer lt_1_40) + hla_dr3_or_dr4 (true 1 if titer lt_1_40) + treatment_response (complete 2, relapse 3); max 26; pretreatment definite >15, probable 10-15; posttreatment definite >17, probable 12-17

Citation

Title
International Autoimmune Hepatitis Group Report: review of criteria for diagnosis of autoimmune hepatitis
Authors
Alvarez F, Berg PA, Bianchi FB, et al.
Source
J Hepatol. 1999;31(5):929-938
DOI
10.1016/s0168-8278(99)80297-9

Worked example

Lowest tabulated penalties (male, cholestatic ratio, AMA, viral, drugs, alcohol, no typical histology, biliary and other atypical)

Given: alcohol_intake=gt_60alp_ratio=gt_3ama_positive=trueautoantibody_titer=lt_1_40biliary_changes=trueglobulin_igg=lt_1xhepatotoxic_drugs=trueinterface_hepatitis=falseliver_cell_rosettes=falselymphoplasmacytic_infiltrate=falseother_atypical_histology=trueother_autoimmune_disease=falsesex=maleviral_markers_positive=true

  1. male 0; alp_ratio gt_3 -2; globulin lt_1x 0; titer lt_1_40 0; AMA -4; viral -3; drugs -4; alcohol gt_60 -2
  2. no interface/plasma/rosettes -5; biliary -3; other atypical -3; other autoimmune 0
  3. Score = -26 (max 26); timing = pretreatment; aih_band = not_aih

Pretreatment definite (female, hepatitic ratio, high IgG and titer, negative viral/AMA/drugs, typical histology, other autoimmune disease)

Given: alcohol_intake=lt_25alp_ratio=lt_1_5ama_positive=falseautoantibody_titer=gt_1_80biliary_changes=falseglobulin_igg=gt_2xhepatotoxic_drugs=falseinterface_hepatitis=trueliver_cell_rosettes=truelymphoplasmacytic_infiltrate=trueother_atypical_histology=falseother_autoimmune_disease=truesex=femaleviral_markers_positive=false

  1. female 2; alp_ratio lt_1_5 2; globulin gt_2x 3; titer gt_1_80 3; AMA 0; viral 3; drugs 1; alcohol lt_25 2
  2. interface 3; lymphoplasmacytic 1; rosettes 1; other autoimmune 2
  3. Score = 23 (max 26); timing = pretreatment; aih_band = definite (>15)

Also searched as

  • original IAIHG score
  • revised original AIH score
  • Alvarez 1999 AIH
  • IAHG 1999 score
  • autoimmune hepatitis original score
  • revised IAIHG criteria
  • 1999 AIH diagnostic score
  • original autoimmune hepatitis score

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/aih_original?sex=male&alp_ratio=gt_3&globulin_igg=lt_1x&autoantibody_titer=lt_1_40&ama_positive=true&viral_markers_positive=true&hepatotoxic_drugs=true&alcohol_intake=gt_60&interface_hepatitis=false&lymphoplasmacytic_infiltrate=false&liver_cell_rosettes=false&biliary_changes=true&other_atypical_histology=true&other_autoimmune_disease=false

Full URL: https://api.magentlab.com/api/calc/aih_original?sex=male&alp_ratio=gt_3&globulin_igg=lt_1x&autoantibody_titer=lt_1_40&ama_positive=true&viral_markers_positive=true&hepatotoxic_drugs=true&alcohol_intake=gt_60&interface_hepatitis=false&lymphoplasmacytic_infiltrate=false&liver_cell_rosettes=false&biliary_changes=true&other_atypical_histology=true&other_autoimmune_disease=false

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/aih_original?sex=male&alp_ratio=gt_3&globulin_igg=lt_1x&autoantibody_titer=lt_1_40&ama_positive=true&viral_markers_positive=true&hepatotoxic_drugs=true&alcohol_intake=gt_60&interface_hepatitis=false&lymphoplasmacytic_infiltrate=false&liver_cell_rosettes=false&biliary_changes=true&other_atypical_histology=true&other_autoimmune_disease=false"

Parameters

Name Type Required Description
sex string required · female, male Caller-assigned sex (Alvarez 1999). female scores 2; male scores 0. magent does not examine the patient.
alp_ratio string required · lt_1_5, 1_5_to_3, gt_3 Caller-assigned ALP:(AST or ALT) ratio as multiples of ULN (Alvarez 1999 note 1). lt_1_5 (<1.5) scores 2; 1_5_to_3 (1.5–3.0) scores 0; gt_3 (>3) scores -2. magent does not take raw enzymes.
globulin_igg string required · lt_1x, 1_to_1_5x, 1_5_to_2x, gt_2x Caller-assigned serum globulin or IgG as multiples of ULN (Alvarez 1999). lt_1x scores 0; 1_to_1_5x scores 1; 1_5_to_2x scores 2; gt_2x scores 3. magent does not assay globulin or IgG.
autoantibody_titer string required · lt_1_40, 1_40, 1_80, gt_1_80 Caller-assigned highest ANA, SMA, or LKM-1 immunofluorescence titer (Alvarez 1999). lt_1_40 scores 0; 1_40 scores 1; 1_80 scores 2; gt_1_80 scores 3. magent does not titer autoantibodies.
ama_positive boolean required Caller-assigned antimitochondrial antibody. true scores -4; false scores 0 (Alvarez 1999). magent does not assay AMA.
viral_markers_positive boolean required Caller-assigned hepatitis A/B/C viral markers (Alvarez 1999 note 3). true scores -3; false (negative) scores 3. magent does not interpret viral serology.
hepatotoxic_drugs boolean required Recent or current known or suspected hepatotoxic drugs (Alvarez 1999 note 4). true scores -4; false scores 1.
alcohol_intake string required · lt_25, 25_to_60, gt_60 Caller-assigned average alcohol intake (Alvarez 1999). lt_25 (<25 g/day) scores 2; 25_to_60 scores 0 (gap between the tabulated <25 and >60 cells); gt_60 (>60 g/day) scores -2.
interface_hepatitis boolean required Caller-assigned interface hepatitis on liver histology. true scores 3 (Alvarez 1999; additive). magent does not read histology.
lymphoplasmacytic_infiltrate boolean required Caller-assigned predominantly lymphoplasmacytic infiltrate. true scores 1 (Alvarez 1999; additive). magent does not read histology.
liver_cell_rosettes boolean required Caller-assigned liver-cell rosettes. true scores 1 (Alvarez 1999; additive). magent does not read histology.
biliary_changes boolean required Caller-assigned biliary changes typical of PBC or PSC (Alvarez 1999 note 5). true scores -3; additive with other histology items. magent does not read histology.
other_atypical_histology boolean required Caller-assigned other prominent histologic features suggesting a different etiology (Alvarez 1999 note 6). true scores -3; additive. magent does not read histology.
other_autoimmune_disease boolean required Any other autoimmune disorder in the patient or first-degree relatives (Alvarez 1999 note 7). true scores 2; false scores 0.
other_autoantibodies boolean optional Optional. Seropositivity for other defined autoantibodies (pANCA, anti-LC1, anti-SLA, anti-ASGPR, anti-LP, anti-sulfatide; Alvarez 1999 note 8). true scores 2 only when autoantibody_titer is lt_1_40; otherwise 0. Omit or false scores 0.
hla_dr3_or_dr4 boolean optional Optional. HLA DR3 or DR4 (Alvarez 1999 note 9). true scores 1 only when autoantibody_titer is lt_1_40; otherwise 0. Omit or false scores 0.
treatment_response string optional · none, complete, relapse Optional. Alvarez 1999 response to therapy, added to presentation points. none or omit: pretreatment bands (definite >15, probable 10-15). complete scores 2; relapse scores 3; both use posttreatment bands (definite >17, probable 12-17). Not an immunosuppression order.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/aih_original Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "alcohol_intake": "gt_60",
      "alp_ratio": "gt_3",
      "ama_positive": "true",
      "autoantibody_titer": "lt_1_40",
      "biliary_changes": "true",
      "globulin_igg": "lt_1x",
      "hepatotoxic_drugs": "true",
      "interface_hepatitis": "false",
      "liver_cell_rosettes": "false",
      "lymphoplasmacytic_infiltrate": "false",
      "other_atypical_histology": "true",
      "other_autoimmune_disease": "false",
      "sex": "male",
      "viral_markers_positive": "true"
    },
    {
      "alcohol_intake": "gt_60",
      "alp_ratio": "gt_3",
      "ama_positive": "true",
      "autoantibody_titer": "lt_1_40",
      "biliary_changes": "true",
      "globulin_igg": "lt_1x",
      "hepatotoxic_drugs": "true",
      "interface_hepatitis": "false",
      "liver_cell_rosettes": "false",
      "lymphoplasmacytic_infiltrate": "false",
      "other_atypical_histology": "true",
      "other_autoimmune_disease": "false",
      "sex": "male",
      "viral_markers_positive": "true"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/aih_original",
  "items": [
    {
      "components": [
        {
          "value": "male",
          "factor": "sex",
          "points": 0,
          "present": false
        },
        {
          "value": "gt_3",
          "factor": "alp_ratio",
          "points": -2,
          "present": true
        },
        {
          "value": "lt_1x",
          "factor": "globulin_igg",
          "points": 0,
          "present": false
        },
        {
          "value": "lt_1_40",
          "factor": "autoantibody_titer",
          "points": 0,
          "present": false
        },
        {
          "factor": "ama_positive",
          "points": -4,
          "present": true
        },
        {
          "value": true,
          "factor": "viral_markers_positive",
          "points": -3,
          "present": true
        },
        {
          "value": true,
          "factor": "hepatotoxic_drugs",
          "points": -4,
          "present": true
        },
        {
          "value": "gt_60",
          "factor": "alcohol_intake",
          "points": -2,
          "present": true
        },
        {
          "factor": "interface_hepatitis",
          "points": 0,
          "present": false
        },
        {
          "factor": "lymphoplasmacytic_infiltrate",
          "points": 0,
          "present": false
        },
        {
          "factor": "liver_cell_rosettes",
          "points": 0,
          "present": false
        },
        {
          "factor": "typical_histology_absent",
          "points": -5,
          "present": true
        },
        {
          "factor": "biliary_changes",
          "points": -3,
          "present": true
        },
        {
          "factor": "other_atypical_histology",
          "points": -3,
          "present": true
        },
        {
          "factor": "other_autoimmune_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "other_autoantibodies",
          "points": 0,
          "present": false
        },
        {
          "factor": "hla_dr3_or_dr4",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "treatment_response",
          "points": 0,
          "present": false
        }
      ],
      "timing": "pretreatment",
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Alvarez F, Berg PA, Bianchi FB, et al.",
        "doi": "10.1016/s0168-8278(99)80297-9",
        "id": "alvarez-1999",
        "pmid": "10580593",
        "source": "J Hepatol. 1999;31(5):929-938",
        "title": "International Autoimmune Hepatitis Group Report: review of criteria for diagnosis of autoimmune hepatitis"
      },
      "formula": "aih_original",
      "formula_expression": "revised original IAIHG AIH (Alvarez 1999) = sex (male 0, female 2) + alp_ratio (lt_1_5 2, 1_5_to_3 0, gt_3 -2) + globulin_igg (lt_1x 0, 1_to_1_5x 1, 1_5_to_2x 2, gt_2x 3) + autoantibody_titer (lt_1_40 0, 1_40 1, 1_80 2, gt_1_80 3) + ama_positive (true -4) + viral_markers (positive -3, negative 3) + hepatotoxic_drugs (true -4, false 1) + alcohol (lt_25 2, 25_to_60 0, gt_60 -2) + histology (interface 3, lymphoplasmacytic 1, rosettes 1, none of those -5, biliary -3, other atypical -3; additive) + other_autoimmune_disease (true 2) + other_autoantibodies (true 2 if titer lt_1_40) + hla_dr3_or_dr4 (true 1 if titer lt_1_40) + treatment_response (complete 2, relapse 3); max 26; pretreatment definite >15, probable 10-15; posttreatment definite >17, probable 12-17",
      "max_score": 26,
      "score": -26,
      "aih_band": "not_aih"
    },
    {
      "components": [
        {
          "value": "male",
          "factor": "sex",
          "points": 0,
          "present": false
        },
        {
          "value": "gt_3",
          "factor": "alp_ratio",
          "points": -2,
          "present": true
        },
        {
          "value": "lt_1x",
          "factor": "globulin_igg",
          "points": 0,
          "present": false
        },
        {
          "value": "lt_1_40",
          "factor": "autoantibody_titer",
          "points": 0,
          "present": false
        },
        {
          "factor": "ama_positive",
          "points": -4,
          "present": true
        },
        {
          "value": true,
          "factor": "viral_markers_positive",
          "points": -3,
          "present": true
        },
        {
          "value": true,
          "factor": "hepatotoxic_drugs",
          "points": -4,
          "present": true
        },
        {
          "value": "gt_60",
          "factor": "alcohol_intake",
          "points": -2,
          "present": true
        },
        {
          "factor": "interface_hepatitis",
          "points": 0,
          "present": false
        },
        {
          "factor": "lymphoplasmacytic_infiltrate",
          "points": 0,
          "present": false
        },
        {
          "factor": "liver_cell_rosettes",
          "points": 0,
          "present": false
        },
        {
          "factor": "typical_histology_absent",
          "points": -5,
          "present": true
        },
        {
          "factor": "biliary_changes",
          "points": -3,
          "present": true
        },
        {
          "factor": "other_atypical_histology",
          "points": -3,
          "present": true
        },
        {
          "factor": "other_autoimmune_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "other_autoantibodies",
          "points": 0,
          "present": false
        },
        {
          "factor": "hla_dr3_or_dr4",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "treatment_response",
          "points": 0,
          "present": false
        }
      ],
      "timing": "pretreatment",
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Alvarez F, Berg PA, Bianchi FB, et al.",
        "doi": "10.1016/s0168-8278(99)80297-9",
        "id": "alvarez-1999",
        "pmid": "10580593",
        "source": "J Hepatol. 1999;31(5):929-938",
        "title": "International Autoimmune Hepatitis Group Report: review of criteria for diagnosis of autoimmune hepatitis"
      },
      "formula": "aih_original",
      "formula_expression": "revised original IAIHG AIH (Alvarez 1999) = sex (male 0, female 2) + alp_ratio (lt_1_5 2, 1_5_to_3 0, gt_3 -2) + globulin_igg (lt_1x 0, 1_to_1_5x 1, 1_5_to_2x 2, gt_2x 3) + autoantibody_titer (lt_1_40 0, 1_40 1, 1_80 2, gt_1_80 3) + ama_positive (true -4) + viral_markers (positive -3, negative 3) + hepatotoxic_drugs (true -4, false 1) + alcohol (lt_25 2, 25_to_60 0, gt_60 -2) + histology (interface 3, lymphoplasmacytic 1, rosettes 1, none of those -5, biliary -3, other atypical -3; additive) + other_autoimmune_disease (true 2) + other_autoantibodies (true 2 if titer lt_1_40) + hla_dr3_or_dr4 (true 1 if titer lt_1_40) + treatment_response (complete 2, relapse 3); max 26; pretreatment definite >15, probable 10-15; posttreatment definite >17, probable 12-17",
      "max_score": 26,
      "score": -26,
      "aih_band": "not_aih"
    }
  ]
}

Response

Field Type Description
formula string aih_original
formula_expression string Exact expression used
score integer Alvarez 1999 revised original IAIHG integer sum (can be negative); max 26
max_score integer 26 including optional relapse
aih_band string definite, probable, or not_aih. Pretreatment: definite >15, probable 10-15. Posttreatment: definite >17, probable 12-17 (Alvarez 1999). Not a diagnosis. Not Hennes 2008 simplified AIH.
timing string pretreatment when treatment_response is none or omitted; posttreatment when complete or relapse
components array Per-factor points
citation object Alvarez 1999 J Hepatol citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "components": [
    {
      "value": "male",
      "factor": "sex",
      "points": 0,
      "present": false
    },
    {
      "value": "gt_3",
      "factor": "alp_ratio",
      "points": -2,
      "present": true
    },
    {
      "value": "lt_1x",
      "factor": "globulin_igg",
      "points": 0,
      "present": false
    },
    {
      "value": "lt_1_40",
      "factor": "autoantibody_titer",
      "points": 0,
      "present": false
    },
    {
      "factor": "ama_positive",
      "points": -4,
      "present": true
    },
    {
      "value": true,
      "factor": "viral_markers_positive",
      "points": -3,
      "present": true
    },
    {
      "value": true,
      "factor": "hepatotoxic_drugs",
      "points": -4,
      "present": true
    },
    {
      "value": "gt_60",
      "factor": "alcohol_intake",
      "points": -2,
      "present": true
    },
    {
      "factor": "interface_hepatitis",
      "points": 0,
      "present": false
    },
    {
      "factor": "lymphoplasmacytic_infiltrate",
      "points": 0,
      "present": false
    },
    {
      "factor": "liver_cell_rosettes",
      "points": 0,
      "present": false
    },
    {
      "factor": "typical_histology_absent",
      "points": -5,
      "present": true
    },
    {
      "factor": "biliary_changes",
      "points": -3,
      "present": true
    },
    {
      "factor": "other_atypical_histology",
      "points": -3,
      "present": true
    },
    {
      "factor": "other_autoimmune_disease",
      "points": 0,
      "present": false
    },
    {
      "factor": "other_autoantibodies",
      "points": 0,
      "present": false
    },
    {
      "factor": "hla_dr3_or_dr4",
      "points": 0,
      "present": false
    },
    {
      "value": "none",
      "factor": "treatment_response",
      "points": 0,
      "present": false
    }
  ],
  "timing": "pretreatment",
  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "Alvarez F, Berg PA, Bianchi FB, et al.",
    "doi": "10.1016/s0168-8278(99)80297-9",
    "id": "alvarez-1999",
    "pmid": "10580593",
    "source": "J Hepatol. 1999;31(5):929-938",
    "title": "International Autoimmune Hepatitis Group Report: review of criteria for diagnosis of autoimmune hepatitis"
  },
  "formula": "aih_original",
  "formula_expression": "revised original IAIHG AIH (Alvarez 1999) = sex (male 0, female 2) + alp_ratio (lt_1_5 2, 1_5_to_3 0, gt_3 -2) + globulin_igg (lt_1x 0, 1_to_1_5x 1, 1_5_to_2x 2, gt_2x 3) + autoantibody_titer (lt_1_40 0, 1_40 1, 1_80 2, gt_1_80 3) + ama_positive (true -4) + viral_markers (positive -3, negative 3) + hepatotoxic_drugs (true -4, false 1) + alcohol (lt_25 2, 25_to_60 0, gt_60 -2) + histology (interface 3, lymphoplasmacytic 1, rosettes 1, none of those -5, biliary -3, other atypical -3; additive) + other_autoimmune_disease (true 2) + other_autoantibodies (true 2 if titer lt_1_40) + hla_dr3_or_dr4 (true 1 if titer lt_1_40) + treatment_response (complete 2, relapse 3); max 26; pretreatment definite >15, probable 10-15; posttreatment definite >17, probable 12-17",
  "max_score": 26,
  "score": -26,
  "aih_band": "not_aih"
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_aih_original Revised original AIH score inputs must match Alvarez 1999 International Autoimmune Hepatitis Group criteria from that paper. Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • Simplified AIH — Sum the Hennes 2008 simplified autoimmune-hepatitis criteria (Table 2) from caller-assigned autoantibody, IgG, histology, and viral-hepatitis points and return not_aih (<6), probable (6), or definite (≥7).
  • R factor — Compute the Bénichou 1990 / CIOMS R ratio from ALT, ALP, and their laboratory upper limits of normal, then classify hepatocellular (R ≥ 5), cholestatic (R ≤ 2), or mixed (2 < R < 5).
  • King's College criteria — Apply the O'Grady 1989 King's College poor-prognosis criteria for fulminant hepatic failure, with separate acetaminophen and non-acetaminophen trees using prothrombin time in seconds.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /docs/mcp.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.