# FIB-4 Fibrosis Index Calculator

> FIB-4 Fibrosis Index 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 FIB-4 liver fibrosis index from age, AST, ALT, and platelet count for MASH/NASH prior-authorization workflows

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/fib4
- 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/fib-4-fibrosis-index-calculator-753fb585
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_E1OVNQYpeFQMYfS69KfWM

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 fib-4-fibrosis-index-calculator-753fb585
```

Example prompt: Calculate the FIB-4 fibrosis index for a 54-year-old patient with an AST of 72 U/L, ALT of 58 U/L, and a platelet count of 145 × 10⁹/L so I can include it in a MASH prior-auth submission.

## When to prefer this

Use this endpoint when you need a deterministic, citable FIB-4 score for MASH/NASH prior-authorization paperwork or clinical decision support and want a zero-configuration arithmetic API rather than a full EHR integration or ML-based fibrosis model. Ideal when you already have the four required lab values (age, AST, ALT, platelets) and need a reproducible, auditable result with a published reference. Prefer this over manual spreadsheet calculation when building automated prior-auth workflows or population health pipelines that require consistent fibrosis staging.

## Known failure modes

- Missing required query parameters (age, ast_u_l, alt_u_l, platelets_10e9_l) returns a 400 validation error
- Out-of-range values (e.g., age < 18 or > 120, platelets < 1 or > 2000, AST/ALT < 1 or > 10000) return validation errors
- Division-by-zero edge case if platelets or ALT is zero (guarded by minimum value constraints)
- Payment failure via x402 protocol returns 402 Payment Required before computation
- Network timeout if the API is unreachable

## How this service works

FIB-4 fibrosis index from age, AST, ALT, and platelets. Use for MASH/NASH prior-auth arithmetic. Deterministic published index with citation; not a diagnosis.

## Output

Returns the computed FIB-4 index value (a continuous numeric score) derived from the published Sterling et al. formula: (age × AST) / (platelets × √ALT). The response includes the numeric score, interpretive thresholds (e.g., <1.30 = low risk, >2.67 = high risk), and a citation to the originating publication. No diagnosis is made; the result is deterministic arithmetic based on the four input lab values.

## 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",
      "ast_u_l",
      "alt_u_l",
      "platelets_10e9_l"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120)."
      },
      "alt_u_l": {
       "type": "number",
       "description": "Alanine aminotransferase in U/L (1-10000)."
      },
      "ast_u_l": {
       "type": "number",
       "description": "Aspartate aminotransferase in U/L (1-10000)."
      },
      "platelets_10e9_l": {
       "type": "number",
       "description": "Platelet count in 10^9/L (1-2000)."
      }
     }
    }
   },
   "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/fib4",
  "count": 2,
  "items": [
   {
    "fib4": 3.95,
    "alt_u_l": 40,
    "ast_u_l": 100,
    "formula": "fib4",
    "citation": {
     "id": "sterling-2006",
     "doi": "10.1002/hep.21172",
     "title": "Development of a simple noninvasive index to predict significant fibrosis in patients with HIV/HCV coinfection",
     "source": "Hepatology. 2006;43(6):1317-1325",
     "authors": "Sterling RK, Lissen E, Clumeck N, et al."
    },
    "age_years": 50,
    "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.",
    "sterling_band": "high",
    "platelets_10e9_l": 200,
    "formula_expression": "FIB-4 = (age_years * AST_U_L) / (platelets_10e9_L * sqrt(ALT_U_L))"
   },
   {
    "fib4": 3.95,
    "alt_u_l": 40,
    "ast_u_l": 100,
    "formula": "fib4",
    "citation": {
     "id": "sterling-2006",
     "doi": "10.1002/hep.21172",
     "title": "Development of a simple noninvasive index to predict significant fibrosis in patients with HIV/HCV coinfection",
     "source": "Hepatology. 2006;43(6):1317-1325",
     "authors": "Sterling RK, Lissen E, Clumeck N, et al."
    },
    "age_years": 50,
    "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.",
    "sterling_band": "high",
    "platelets_10e9_l": 200,
    "formula_expression": "FIB-4 = (age_years * AST_U_L) / (platelets_10e9_L * sqrt(ALT_U_L))"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fib-4-fibrosis-index-calculator-753fb585/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)
