# magent SAFE Score (Steatosis-Associated Fibrosis Estimator)

> magent SAFE Score (Steatosis-Associated Fibrosis Estimator) 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).

Calculates the Sripongpun 2023 SAFE score to estimate hepatic fibrosis risk from age, BMI, diabetes status, AST, ALT, globulin, and platelet count.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/safe
- 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/magent-safe-score-steatosis-associated-fibrosis-estimator-353b70b4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wjcqoCTixFKOn1GRPNuDt

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 magent-safe-score-steatosis-associated-fibrosis-estimator-353b70b4
```

Example prompt: Calculate the SAFE score for a 54-year-old patient with BMI 32, diabetes, AST 62 U/L, ALT 48 U/L, globulin 3.1 g/dL, and platelets 180 × 10⁹/L — I want to know if they rule in or rule out for steatosis-associated fibrosis.

## When to prefer this

Use this endpoint when you need the specific Sripongpun 2023 SAFE (steatosis-associated fibrosis estimator) score. Choose it over FIB-4 or NAFLD fibrosis score endpoints when the clinical protocol or study context specifically calls for the SAFE equation. It is appropriate for adult patients (18+) where all seven input lab values and clinical parameters are available. Do not use this endpoint to obtain FIB-4, APRI, BARD, or biopsy-equivalent fibrosis staging — use the dedicated magent endpoints for those scores instead.

## Known failure modes

- Missing required parameter returns validation error
- BMI outside 10–80 range rejected
- Age outside 18–120 range rejected
- AST or ALT outside 1–10000 range rejected
- Globulin outside 0.5–8.0 range rejected
- Platelets outside 1–2000 range rejected
- Payment failure (x402) if USDC balance insufficient

## How this service works

Sripongpun 2023 steatosis-associated fibrosis estimator (SAFE) from age, BMI (capped at 40 in the equation), diabetes, AST, ALT, globulin in g/dL, and platelets. Deterministic published equation with citation. Rule-out below 0; rule-in above 100. Not a biopsy, fibrosis stage, FIB-4, NAFLD fibrosis score, or BARD. magent does not compute BMI from height and weight.

## Output

Returns the numeric SAFE score computed from the Sripongpun 2023 published equation. Scores below 0 indicate rule-out for significant fibrosis; scores above 100 indicate rule-in. The caller-supplied BMI is echoed back; values above 40 are capped at 40 in the formula per the published equation.

## 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",
      "bmi_kg_m2",
      "diabetes",
      "ast_u_l",
      "alt_u_l",
      "globulin_g_dl",
      "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)."
      },
      "diabetes": {
       "type": "boolean",
       "description": "Diabetes as assigned by the caller (Sripongpun 2023; 0 or 1 in the equation). true or false. magent does not diagnose diabetes."
      },
      "bmi_kg_m2": {
       "type": "number",
       "description": "Body-mass index in kg/m^2 (10-80). Caller-supplied; magent does not compute BMI from height and weight. Values above 40 are set to 40 in the formula only (Sripongpun 2023); the caller BMI is still echoed."
      },
      "globulin_g_dl": {
       "type": "number",
       "description": "Globulin in g/dL (0.5-8.0). Total protein minus albumin. magent does not convert g/L or split protein and albumin."
      },
      "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"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/magent-safe-score-steatosis-associated-fibrosis-estimator-353b70b4/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)
