# COVID-GRAM Critical Illness Probability Calculator (Liang 2020)

> COVID-GRAM Critical Illness Probability Calculator (Liang 2020) 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-14).

Computes the logistic probability of critical illness (ICU admission, invasive ventilation, or death) in hospitalized COVID-19 patients using the Liang 2020 COVID-GRAM model (Table 3 coefficients).

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/cgram
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/covid-gram-critical-illness-probability-calculator-liang-2020-13f48497
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qrot8xrS55JF3KxLfLTQn

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 covid-gram-critical-illness-probability-calculator-liang-2020-13f48497
```

Example prompt: Using the Liang 2020 COVID-GRAM model, estimate the critical illness probability for a 67-year-old COVID-19 inpatient with an abnormal chest X-ray, dyspnea present, no hemoptysis, no unconsciousness, 2 comorbidities, no cancer history, a neutrophil-to-lymphocyte ratio of 8.5, LDH of 420 U/L, and direct bilirubin of 12 umol/L.

## When to prefer this

Use this endpoint when you need the validated Liang 2020 COVID-GRAM logistic score specifically, with exact Table 3 coefficients, for hospitalized COVID-19 patients. Prefer it when you already have structured clinical values (NLR, LDH, bilirubin, symptom flags) and want a reproducible, published-model probability rather than a custom heuristic. It is not a replacement for clinical judgment, chest film reading, or comorbidity counting — the caller must supply those assessments.

## Known failure modes

- Missing required query parameter (e.g. age, nlr, ldh_u_l) returns a 400 error
- Age out of range (< 1 or > 120) or NLR out of range (< 0.01 or > 200) may return a validation error
- LDH or bilirubin values in non-supported units (e.g. µkat/L instead of U/L) will produce incorrect scores without warning — caller must convert
- Payment not provided or insufficient USDC results in 402 Payment Required
- Boolean flags must be true/false; any other value may cause a parse error

## How this service works

Liang 2020 COVID-GRAM logistic probability of critical illness (ICU, invasive ventilation, or death) among hospitalized COVID-19 from age, caller-assigned chest radiograph abnormality, hemoptysis, dyspnea, unconsciousness, comorbidity count, cancer history, neutrophil-to-lymphocyte ratio, LDH (U/L), and direct bilirubin (umol/L). Table 3 coefficients. magent does not read the film or count comorbidities. Not a diagnosis or ICU-allocation order.

## Output

Returns the COVID-GRAM logistic probability (0–1) of critical illness (ICU admission, invasive mechanical ventilation, or death) for a hospitalized COVID-19 patient, derived from Liang 2020 Table 3 coefficients applied to the supplied clinical inputs.

## 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",
      "chest_xray_abnormal",
      "hemoptysis",
      "dyspnea",
      "unconsciousness",
      "number_of_comorbidities",
      "cancer_history",
      "nlr",
      "ldh_u_l",
      "direct_bilirubin_umol_l"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (integer 1-120). Liang 2020 Table 3: +0.0276 per year (OR 1.03 per year). Development cohort ages 1-95."
      },
      "nlr": {
       "type": "number",
       "description": "Neutrophil-to-lymphocyte ratio (0.01-200). Liang 2020 Table 3: +0.0562 per unit (OR 1.06). Caller assigns the ratio; magent does not compute it from counts."
      },
      "dyspnea": {
       "type": "boolean",
       "description": "Dyspnea (shortness of breath) as assigned by the caller (true or false). Liang 2020 Table 3: true adds 0.632 (OR 1.88)."
      },
      "ldh_u_l": {
       "type": "number",
       "description": "Lactate dehydrogenase in U/L (1-5000). Liang 2020 Table 3: +0.0024 per U/L (OR 1.002). magent does not convert other LDH units."
      },
      "hemoptysis": {
       "type": "boolean",
       "description": "Hemoptysis as assigned by the caller (true or false). Liang 2020 Table 3: true adds 1.5116 (OR 4.53)."
      },
      "cancer_history": {
       "type": "boolean",
       "description": "Cancer history as assigned by the caller (true or false). Liang 2020 Table 3: true adds 1.4037 (OR 4.07), separate from the comorbidity count."
      },
      "unconsciousness": {
       "type": "boolean",
       "description": "Unconsciousness as assigned by the caller (true or false). Liang 2020 Table 3: true adds 1.5494 (OR 4.71)."
      },
      "chest_xray_abnormal": {
       "type": "boolean",
       "description": "Chest radiograph abnormality as assigned by the caller (true or false). Liang 2020 Table 3: true adds 1.2205 (OR 3.39). magent does not read the film."
      },
     
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/covid-gram-critical-illness-probability-calculator-liang-2020-13f48497/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)
