MAGENT

Liver · LIVE

pFIB-c pediatric fibrosis

pFIB-c

Compute the Lefere 2025 pFIB-c logistic probability of significant (≥F2) liver fibrosis in pediatric MASLD from sex, hypertension, ALT, a caller-assigned weight Z-score, HOMA-IR, and caller-assigned Black ethnicity.

LIVE $0.005 USDC GET /api/calc/pfib_c

Markdown: /docs/pfib-c.md · Canonical: https://magentlab.com/docs/pfib-c

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Compute the Lefere 2025 pFIB-c logistic probability of significant (≥F2) liver fibrosis in pediatric MASLD from sex, hypertension, ALT, a caller-assigned weight Z-score, HOMA-IR, and caller-assigned Black ethnicity.

When to use

When an agent already has pediatric MASLD sex (boy or girl), hypertension, ALT in U/L, a caller-assigned CDC or WHO weight Z-score, HOMA-IR, and caller-assigned Black ethnicity as Lefere 2025 used the term, and needs the published Table 2 probability and derivation-cohort rule-out cutoff 0.226, not pFIB-6, FIB-4, APRI, or the NAFLD fibrosis score.

When not to use

  • Not a medical device and not a diagnosis. Not a liver-biopsy substitute or a treatment order.
  • black_ethnicity is caller-assigned Black ethnicity as used in Lefere 2025. magent does not assign race or ethnicity.
  • weight_z_score is a caller-assigned CDC or WHO weight-for-age Z-score. magent does not compute LMS tables from height, weight, age, or sex.
  • HOMA-IR is caller-assigned. magent does not compute HOMA-IR from glucose and insulin.
  • The 0.226 cutoff is the Lefere 2025 derivation-cohort rule-out for significant (≥F2) fibrosis (high NPV). magent does not invent other probability bands. This is pFIB-c only, not the ordinal pFIB-6 score.

Formula

x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6

Citation

Title
Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD
Authors
Lefere S, Dupont E, De Guchtenaere A, et al.
Source
Hepatology. 2025;81(4):1276-1287
DOI
10.1097/hep.0000000000001016

Worked example

Girl, no hypertension, ALT 30, weight Z 1.0, HOMA-IR 2.0

Given: alt_u_l=30black_ethnicity=falsehoma_ir=2.0hypertension=falsesex=girlweight_z_score=1.0

  1. girl (sex_boy=0); hypertension false; black_ethnicity false
  2. x = -5.155 + 0.019*30 + 0.633*1.0 + 0.079*2.0 = -3.794
  3. probability = exp(x)/(1+exp(x)), 3 decimals; below_rule_out_cutoff iff probability < 0.226

Boy, otherwise the girl worked example

Given: alt_u_l=30black_ethnicity=falsehoma_ir=2.0hypertension=falsesex=boyweight_z_score=1.0

  1. same ALT, weight Z, HOMA-IR, and flags as the girl example; sex_boy term 1.194
  2. x = -5.155 + 1.194 + 0.019*30 + 0.633*1.0 + 0.079*2.0 = -2.600
  3. probability from the unrounded x, 3 decimals; below_rule_out_cutoff iff probability < 0.226

Also searched as

  • pFIB-c
  • pediatric fibrosis score continuous
  • Lefere pFIB
  • pediatric MASLD fibrosis
  • pFIB continuous
  • exclusion of significant fibrosis children
  • Lefere 2025 pFIB-c
  • pediatric fatty liver fibrosis

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/pfib_c?sex=girl&hypertension=false&alt_u_l=30&weight_z_score=1.0&homa_ir=2.0&black_ethnicity=false

Full URL: https://api.magentlab.com/api/calc/pfib_c?sex=girl&hypertension=false&alt_u_l=30&weight_z_score=1.0&homa_ir=2.0&black_ethnicity=false

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/pfib_c?sex=girl&hypertension=false&alt_u_l=30&weight_z_score=1.0&homa_ir=2.0&black_ethnicity=false"

Parameters

Name Type Required Description
sex string required · boy, girl Sex as Lefere 2025 Table 2 (boy or girl). boy adds 1.194 (sex_boy=1); girl adds 0. Paper terms.
hypertension boolean required Hypertension as assigned by the caller (true or false). Lefere 2025 Table 2: true adds 1.636.
alt_u_l number required Alanine aminotransferase in U/L (5-500). Lefere 2025 Table 2: +0.019 per U/L. magent does not convert other ALT units.
weight_z_score number required Caller-assigned CDC or WHO weight-for-age Z-score (-5 to 8). Lefere 2025 Table 2: +0.633 per unit. magent does not compute LMS tables from height, weight, age, or sex.
homa_ir number required Caller-assigned HOMA-IR (0-50). Lefere 2025 Table 2: +0.079 per unit. magent does not compute HOMA-IR from glucose and insulin.
black_ethnicity boolean required Caller-assigned Black ethnicity as used in Lefere 2025 (true or false). Table 2: true adds -2.453. magent does not assign race or ethnicity.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/pfib_c Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "alt_u_l": "30",
      "black_ethnicity": "false",
      "homa_ir": "2.0",
      "hypertension": "false",
      "sex": "girl",
      "weight_z_score": "1.0"
    },
    {
      "alt_u_l": "30",
      "black_ethnicity": "false",
      "homa_ir": "2.0",
      "hypertension": "false",
      "sex": "girl",
      "weight_z_score": "1.0"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/pfib_c",
  "items": [
    {
      "x": -3.794,
      "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.",
      "citation": {
        "authors": "Lefere S, Dupont E, De Guchtenaere A, et al.",
        "doi": "10.1097/hep.0000000000001016",
        "id": "lefere-2025-pfib",
        "pmid": "39028885",
        "source": "Hepatology. 2025;81(4):1276-1287",
        "title": "Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD"
      },
      "formula": "pfib_c",
      "formula_expression": "x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6",
      "sex": "girl",
      "alt_u_l": 30.0,
      "probability": 0.022,
      "hypertension": false,
      "homa_ir": 2.0,
      "below_rule_out_cutoff": true,
      "black_ethnicity": false,
      "weight_z_score": 1.0
    },
    {
      "x": -3.794,
      "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.",
      "citation": {
        "authors": "Lefere S, Dupont E, De Guchtenaere A, et al.",
        "doi": "10.1097/hep.0000000000001016",
        "id": "lefere-2025-pfib",
        "pmid": "39028885",
        "source": "Hepatology. 2025;81(4):1276-1287",
        "title": "Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD"
      },
      "formula": "pfib_c",
      "formula_expression": "x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6",
      "sex": "girl",
      "alt_u_l": 30.0,
      "probability": 0.022,
      "hypertension": false,
      "homa_ir": 2.0,
      "below_rule_out_cutoff": true,
      "black_ethnicity": false,
      "weight_z_score": 1.0
    }
  ]
}

Response

Field Type Description
formula string pfib_c
formula_expression string Lefere 2025 Table 2 logistic linear predictor and probability
sex string boy or girl used
hypertension boolean Caller-assigned hypertension
alt_u_l number Input ALT in U/L
weight_z_score number Caller-assigned CDC or WHO weight-for-age Z-score
homa_ir number Caller-assigned HOMA-IR
black_ethnicity boolean Caller-assigned Black ethnicity as used in Lefere 2025
x number Unrounded linear predictor, 3 decimals
probability number pFIB-c probability of significant (≥F2) fibrosis from the unrounded x, 3 decimals (0-1). Not a biopsy.
below_rule_out_cutoff boolean true iff probability < 0.226 (Lefere 2025 derivation-cohort high NPV for significant fibrosis). Not a biopsy.
citation object Lefere 2025 pFIB-c citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "x": -3.794,
  "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.",
  "citation": {
    "authors": "Lefere S, Dupont E, De Guchtenaere A, et al.",
    "doi": "10.1097/hep.0000000000001016",
    "id": "lefere-2025-pfib",
    "pmid": "39028885",
    "source": "Hepatology. 2025;81(4):1276-1287",
    "title": "Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD"
  },
  "formula": "pfib_c",
  "formula_expression": "x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6",
  "sex": "girl",
  "alt_u_l": 30.0,
  "probability": 0.022,
  "hypertension": false,
  "homa_ir": 2.0,
  "below_rule_out_cutoff": true,
  "black_ethnicity": false,
  "weight_z_score": 1.0
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_pfib_c pFIB-c inputs must match Lefere 2025 sex, caller-assigned Black ethnicity, hypertension, ALT, caller-assigned weight Z-score, and HOMA-IR. Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • FIB-4 — Compute the FIB-4 fibrosis index from age, AST, ALT, and platelets.
  • APRI — Compute the AST to platelet ratio index (APRI) from AST, laboratory AST ULN, and platelet count.
  • NAFLD fibrosis score — Compute the Angulo 2007 NAFLD fibrosis score from age, BMI, IFG/diabetes, AST, ALT, platelets, and albumin.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /docs/mcp.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.