# Maddrey Discriminant Function Calculator

> Maddrey Discriminant Function 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 Maddrey Discriminant Function (MDF) score for alcoholic hepatitis severity from patient and control prothrombin times and serum bilirubin

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/maddrey
- 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/maddrey-discriminant-function-calculator-55cb2dd5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6lXiQP5lrldFswyCYyZoF

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 maddrey-discriminant-function-calculator-55cb2dd5
```

Example prompt: Calculate the Maddrey discriminant function for a patient with a prothrombin time of 22 seconds, a control PT of 12 seconds, and a total bilirubin of 15 mg/dL — I need to know the MDF score.

## When to prefer this

Use this endpoint when you need a deterministic, citation-backed Maddrey Discriminant Function score computed from raw prothrombin times in seconds (not INR) and serum bilirubin. Prefer this over manual calculation to avoid arithmetic errors and to get a structured, citable result. It is not appropriate for endpoints requiring INR input, MELD score calculation, or clinical decision output beyond the MDF formula itself.

## Known failure modes

- Missing required parameters (pt_patient_sec or pt_control_sec) returns a validation error
- Bilirubin not provided in either mg/dL or µmol/L returns an error
- Out-of-range values (e.g. PT control outside 8-20 sec, bilirubin outside 0.1-40 mg/dL) may return a validation error
- INR values submitted instead of PT seconds are not accepted and will produce incorrect or rejected results
- Payment not included or invalid x402 payment returns 402 Payment Required

## How this service works

Maddrey discriminant function (1978) from patient and control prothrombin time in seconds plus bilirubin. Deterministic published formula with citation; not a diagnosis or steroid order.

## Output

Returns the calculated Maddrey Discriminant Function score (a numeric value where ≥32 indicates severe alcoholic hepatitis per the 1978 Maddrey publication), along with the formula applied, input values used, and a bibliographic citation. Does not provide a diagnosis or steroid treatment recommendation.

## 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": [
      "pt_patient_sec",
      "pt_control_sec"
     ],
     "properties": {
      "pt_control_sec": {
       "type": "number",
       "description": "Laboratory control prothrombin time in seconds (8-20). INR is not accepted."
      },
      "pt_patient_sec": {
       "type": "number",
       "description": "Patient prothrombin time in seconds (8-120). INR is not accepted."
      },
      "bilirubin_mg_dl": {
       "type": "number",
       "description": "Total bilirubin in mg/dL (0.1-40). Provide this or bilirubin_umol_l."
      },
      "bilirubin_umol_l": {
       "type": "number",
       "description": "Total bilirubin in µmol/L (2-684). Converted as mg/dL = µmol/L / 17.1."
      }
     }
    }
   },
   "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/maddrey",
  "count": 2,
  "items": [
   {
    "df": 44.8,
    "formula": "maddrey_1978",
    "citation": {
     "id": "maddrey-1978",
     "doi": "10.1016/0016-5085(78)90401-8",
     "title": "Corticosteroid therapy of alcoholic hepatitis",
     "source": "Gastroenterology. 1978;75(2):193-199",
     "authors": "Maddrey WC, Boitnott JK, Bedine MS, Weber FL Jr, Mezey E, White RI Jr"
    },
    "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.",
    "pt_control_sec": 12,
    "pt_patient_sec": 20,
    "bilirubin_mg_dl": 8,
    "formula_expression": "DF = 4.6 * (pt_patient_sec - pt_control_sec) + bilirubin_mg_dl"
   },
   {
    "df": 44.8,
    "formula": "maddrey_1978",
    "citation": {
     "id": "maddrey-1978",
     "doi": "10.1016/0016-5085(78)90401-8",
     "title": "Corticosteroid therapy of alcoholic hepatitis",
     "source": "Gastroenterology. 1978;75(2):193-199",
     "authors": "Maddrey WC, Boitnott JK, Bedine MS, Weber FL Jr, Mezey E, White RI Jr"
    },
    "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.",
    "pt_control_sec": 12,
    "pt_patient_sec": 20,
    "bilirubin_mg_dl": 8,
    "formula_expression": "DF = 4.6 * (pt_patient_sec - pt_control_sec) + bilirubin_mg_dl"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/maddrey-discriminant-function-calculator-55cb2dd5/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)
