# Glasgow Alcoholic Hepatitis Score (GAHS) Calculator

> Glasgow Alcoholic Hepatitis Score (GAHS) Calculator is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Computes the Forrest 2005 Glasgow Alcoholic Hepatitis Score (range 5–12) from age, WBC, urea/BUN, PT ratio, and bilirubin, flagging scores ≥9 as indicating steroid benefit.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/gahs
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/glasgow-alcoholic-hepatitis-score-gahs-calculator-6e1e7003
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rrYn4LAGvgHZA9R13WC0B

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability glasgow-alcoholic-hepatitis-score-gahs-calculator-6e1e7003
```

Example prompt: Calculate the Glasgow Alcoholic Hepatitis Score for a 54-year-old patient with a WBC of 18,000 cells/µL, urea of 7.2 mmol/L, PT ratio of 1.8, and bilirubin of 290 µmol/L — and tell me if the score hits the ≥9 threshold.

## When to prefer this

Use this endpoint when you need a deterministic, citation-backed implementation of the Forrest 2005 Glasgow Alcoholic Hepatitis Score specifically — it handles unit conversions (BUN↔urea, bilirubin mg/dL↔µmol/L, WBC cells/µL↔K/µL) automatically and returns structured sub-scores. Prefer over general LLM reasoning when auditability and arithmetic exactness matter for clinical documentation.

## Known failure modes

- Missing required fields (age or pt_ratio) returns a validation error
- Out-of-range values (e.g. age <18 or pt_ratio >10) may return an error or clamp
- Providing both urea_mmol_l and bun_mg_dl simultaneously may cause a conflict error
- Providing both wbc_ul and wbc_k_ul simultaneously may cause a conflict error
- Network or payment authorization failure returns HTTP 402 or 5xx

## How this service works

Forrest 2005 Glasgow alcoholic hepatitis score from age, WBC, urea, PT ratio, and bilirubin (range 5-12) with the published ≥9 band. Deterministic published arithmetic with citation; not a steroid order.

## Output

Returns the total Glasgow Alcoholic Hepatitis Score (integer, range 5–12) based on the Forrest 2005 formula, along with individual component scores for age, WBC, urea, PT ratio, and bilirubin, and a flag indicating whether the score meets the published ≥9 threshold associated with potential steroid benefit.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "age",
      "pt_ratio"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). <50 scores 1; ≥50 scores 2 (Forrest 2005)."
      },
      "wbc_ul": {
       "type": "number",
       "description": "WBC in cells/µL. Converted as K/µL = cells/µL / 1000."
      },
      "pt_ratio": {
       "type": "number",
       "description": "Prothrombin-time ratio (0.8-10). <1.5 scores 1; 1.5-2.0 scores 2; >2.0 scores 3."
      },
      "wbc_k_ul": {
       "type": "number",
       "description": "WBC in 10^3/µL (same as 10^9/L). Provide wbc_k_ul or wbc_ul. <15 scores 1; ≥15 scores 2."
      },
      "bun_mg_dl": {
       "type": "number",
       "description": "BUN in mg/dL (3-140). Converted as urea_mmol_l = bun_mg_dl / 2.8."
      },
      "urea_mmol_l": {
       "type": "number",
       "description": "Urea in mmol/L (1-50). Provide this or bun_mg_dl, not both. <5 scores 1; ≥5 scores 2."
      },
      "bilirubin_mg_dl": {
       "type": "number",
       "description": "Total bilirubin in mg/dL (0.1-40). Converted as µmol/L = mg/dL × 17.1."
      },
      "bilirubin_umol_l": {
       "type": "number",
       "description": "Total bilirubin in µmol/L (2-684). Provide this or bilirubin_mg_dl. <125 scores 1; 125-250 scores 2; >250 scores 3."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/gahs",
  "count": 2,
  "items": [
   {
    "score": 5,
    "formula": "gahs",
    "citation": {
     "id": "forrest-2005",
     "doi": "10.1136/gut.2004.050781",
     "title": "Analysis of factors predictive of mortality in alcoholic hepatitis and derivation and validation of the Glasgow alcoholic hepatitis score",
     "source": "Gut. 2005;54(8):1174-1179",
     "authors": "Forrest EH, Evans CD, Stewart S, et al."
    },
    "pt_ratio": 1.2,
    "wbc_k_ul": 8,
    "age_years": 40,
    "gahs_band": "lt_9",
    "max_score": 12,
    "min_score": 5,
    "components": [
     {
      "value": 40,
      "factor": "age",
      "points": 1,
      "present": false
     },
     {
      "value": 8,
      "factor": "wbc",
      "points": 1,
      "present": false
     },
     {
      "value": 4,
      "factor": "urea",
      "points": 1,
      "present": false
     },
     {
      "value": 1.2,
      "factor": "pt_ratio",
      "points": 1,
      "present": false
     },
     {
      "value": 80,
      "factor": "bilirubin",
      "points": 1,
      "present": false
     }
    ],
    "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.",
    "urea_mmol_l": 4,
    "bilirubin_umol_l": 80,
    "formula_expression": "GAHS = age_points + wbc_points + urea_points + pt_ratio_points + bilirubin_points; range 5-12"
   },
   {
    "score": 5,
    "formula": "gahs",
    "citation": {
     "id": "forrest-2005",
     "doi": "10.1136/gut.2004.050781",
     "title": "Analysis of factors predictive of mortality in alcoholic hepatitis and derivation and validation of the Glasgow alcoholic hepatitis score",
     "source": "Gut. 2005;54(8):1174-1179",
     "authors": "Forrest EH, Evans CD, Stewart S, et al."
    },
    "pt_ratio": 1.2,
    "wbc_k_ul": 8,
    "age_years": 40,
    "gahs_band": "lt_9",
    "max_score": 12,
    "min_score": 5,
    "components": [
     {
      "value": 40,
      "factor": "age",
      "points": 1,
      "present": false
     },
     {
      "value": 8,
      "factor": "wbc",
      "points": 1,
      "present": false
     },
     {
      "value": 4,
      "factor": "urea",
      "points": 1,
      "present": false
     },
     {
      "value": 1.2,
      "factor": "pt_ratio",
      "points": 1,
      "present": false
     },
     {
      "value": 80,
      "fact
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/glasgow-alcoholic-hepatitis-score-gahs-calculator-6e1e7003/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
