# APRI Calculator (AST-to-Platelet Ratio Index)

> APRI Calculator (AST-to-Platelet Ratio Index) 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).

Calculates the Wai 2003 AST-to-Platelet Ratio Index (APRI) from AST, lab-specific AST ULN, and platelet count, returning the score plus published cut-offs for significant fibrosis and cirrhosis.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/apri
- 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/apri-calculator-ast-to-platelet-ratio-index-13e62d99
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FAljCnpsqDKKzf0mAA4vS

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 apri-calculator-ast-to-platelet-ratio-index-13e62d99
```

Example prompt: Calculate the APRI score for a patient with an AST of 72 U/L, a lab ULN of 35 U/L, and a platelet count of 110 × 10⁹/L — and tell me whether the result crosses the published cut-offs for significant fibrosis or cirrhosis.

## When to prefer this

Use this endpoint when you need a fast, formula-based APRI calculation that correctly uses the caller-supplied lab ULN rather than assuming 40 U/L — critical when integrating with labs that use non-standard reference ranges. Prefer this over FIB-4 when platelet count and AST are available but patient age is not, or when the clinical question is specifically framed around the Wai 2003 APRI cut-offs rather than FIB-4 thresholds.

## Known failure modes

- Missing required parameter (ast_u_l, ast_uln_u_l, or platelets_10e9_l) returns a 400-level error
- Values outside accepted ranges (e.g. platelets <1 or >2000, AST ULN <5 or >200) may be rejected or return a validation error
- Payment failure (x402) if USDC balance is insufficient
- Network timeout on slow connections

## How this service works

Wai 2003 AST to platelet ratio index (APRI) from AST, laboratory AST ULN, and platelet count. Returns APRI to two decimals plus published training-set cut-offs for significant fibrosis (Ishak ≥3) and cirrhosis. ULN is required; magent does not assume 40 U/L. Not a diagnosis, not FIB-4, and not a biopsy.

## Output

Returns the APRI score rounded to two decimal places, along with the Wai 2003 published training-set cut-offs for significant fibrosis (Ishak ≥3) and cirrhosis, and an indication of whether the patient's score meets or exceeds those thresholds. Does not return a clinical diagnosis.

## 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": [
      "ast_u_l",
      "ast_uln_u_l",
      "platelets_10e9_l"
     ],
     "properties": {
      "ast_u_l": {
       "type": "number",
       "description": "Aspartate aminotransferase in U/L (1-10000)."
      },
      "ast_uln_u_l": {
       "type": "number",
       "description": "Laboratory AST upper limit of normal in U/L (5-200). Required; magent does not assume 40."
      },
      "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/apri",
  "count": 2,
  "items": [
   {
    "apri": 1.67,
    "ast_u_l": 90,
    "formula": "apri",
    "citation": {
     "id": "wai-2003",
     "doi": "10.1053/jhep.2003.50346",
     "title": "A simple noninvasive index can predict both significant fibrosis and cirrhosis in patients with chronic hepatitis C",
     "source": "Hepatology. 2003;38(2):518-526",
     "authors": "Wai CT, Greenson JK, Fontana RJ, et al."
    },
    "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.",
    "ast_uln_u_l": 45,
    "platelets_10e9_l": 120,
    "wai_fibrosis_band": "high",
    "formula_expression": "APRI = ((AST / AST_ULN) / platelet_count_10e9_L) * 100",
    "wai_cirrhosis_band": "indeterminate"
   },
   {
    "apri": 1.67,
    "ast_u_l": 90,
    "formula": "apri",
    "citation": {
     "id": "wai-2003",
     "doi": "10.1053/jhep.2003.50346",
     "title": "A simple noninvasive index can predict both significant fibrosis and cirrhosis in patients with chronic hepatitis C",
     "source": "Hepatology. 2003;38(2):518-526",
     "authors": "Wai CT, Greenson JK, Fontana RJ, et al."
    },
    "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.",
    "ast_uln_u_l": 45,
    "platelets_10e9_l": 120,
    "wai_fibrosis_band": "high",
    "formula_expression": "APRI = ((AST / AST_ULN) / platelet_count_10e9_L) * 100",
    "wai_cirrhosis_band": "indeterminate"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/apri-calculator-ast-to-platelet-ratio-index-13e62d99/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)
