# Fatty liver index

Fatty liver index

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/fli`
HTML: https://magentlab.com/docs/fli
Markdown: https://magentlab.com/docs/fli.md

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

## What it computes

Compute the Bedogni 2006 fatty liver index from caller-supplied BMI, waist circumference, triglycerides, and GGT as a predictor of hepatic steatosis in the general population.

## When to use

When an agent needs published Bedogni 2006 FLI arithmetic and must not invent an imaging diagnosis, hepatic steatosis index cutoffs, or NAFLD fibrosis score bands.

## When not to use

- Not a medical device. Not a steatosis diagnosis and not a substitute for imaging.
- BMI is caller-supplied. magent does not compute BMI from height and weight in this tool.
- Bedogni 2006 FLI only. Not the hepatic steatosis index, not the NAFLD fibrosis score, not FIB-4, and not APRI.

## Formula

```
L = 0.953 * loge(triglycerides_mg_dl) + 0.139 * bmi_kg_m2 + 0.718 * loge(ggt_u_l) + 0.053 * waist_cm - 15.745; FLI = (e^L / (1 + e^L)) * 100
```

## Citation

[The Fatty Liver Index: a simple and accurate predictor of hepatic steatosis in the general population](https://doi.org/10.1186/1471-230X-6-33)
Bedogni G, Bellentani S, Miglioli L, Masutti F, Passalacqua M, Castiglione A, Tiribelli C
BMC Gastroenterol. 2006;6:33
DOI: [10.1186/1471-230X-6-33](https://doi.org/10.1186/1471-230X-6-33)

## Worked example

### BMI 22, waist 70 cm, triglycerides 80 mg/dL, GGT 20 U/L

Given: `bmi_kg_m2=22, ggt_u_l=20, triglycerides_mg_dl=80, waist_cm=70`

1. L = 0.953 * loge(80) + 0.139 * 22 + 0.718 * loge(20) + 0.053 * 70 - 15.745 = -2.65
2. FLI = (e^L / (1 + e^L)) * 100 = 6.6
3. FLI < 30 → bedogni_band rule_out


## Also searched as

- fatty liver index
- FLI Bedogni
- Bedogni 2006 FLI
- hepatic steatosis FLI
- fatty liver index BMI waist GGT
- FLI triglycerides GGT
- Bedogni fatty liver

## Parameters

- `bmi_kg_m2` (number, required): Body-mass index in kg/m^2 (10-80). Caller-supplied; magent does not compute BMI.
- `waist_cm` (number, required): Waist circumference in cm (40-200).
- `ggt_u_l` (number, required): Gamma-glutamyltransferase in U/L (1-2000).
- `triglycerides_mg_dl` (number, optional): Triglycerides in mg/dL (10-2000). Italian lab units in Bedogni 2006. Provide this or triglycerides_mmol_l, not both.
- `triglycerides_mmol_l` (number, optional): Triglycerides in mmol/L (0.11-22.6). Converted as mg/dL = mmol/L * 88.57. Provide this or triglycerides_mg_dl, not both.

## 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.

Method: `POST /api/calc/fli`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: 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:

```json
{
  "items": [
    {
      "bmi_kg_m2": "22",
      "ggt_u_l": "20",
      "triglycerides_mg_dl": "80",
      "waist_cm": "70"
    },
    {
      "bmi_kg_m2": "22",
      "ggt_u_l": "20",
      "triglycerides_mg_dl": "80",
      "waist_cm": "70"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/fli

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/fli",
  "items": [
    {
      "l": -2.65,
      "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": "Bedogni G, Bellentani S, Miglioli L, Masutti F, Passalacqua M, Castiglione A, Tiribelli C",
        "doi": "10.1186/1471-230X-6-33",
        "id": "bedogni-2006",
        "pmid": "17081293",
        "source": "BMC Gastroenterol. 2006;6:33",
        "title": "The Fatty Liver Index: a simple and accurate predictor of hepatic steatosis in the general population"
      },
      "formula": "fli",
      "formula_expression": "L = 0.953 * loge(triglycerides_mg_dl) + 0.139 * bmi_kg_m2 + 0.718 * loge(ggt_u_l) + 0.053 * waist_cm - 15.745; FLI = (e^L / (1 + e^L)) * 100",
      "bmi_kg_m2": 22.0,
      "bedogni_band": "rule_out",
      "fli": 6.6,
      "ggt_u_l": 20.0,
      "triglycerides_mg_dl": 80.0,
      "waist_cm": 70.0
    },
    {
      "l": -2.65,
      "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": "Bedogni G, Bellentani S, Miglioli L, Masutti F, Passalacqua M, Castiglione A, Tiribelli C",
        "doi": "10.1186/1471-230X-6-33",
        "id": "bedogni-2006",
        "pmid": "17081293",
        "source": "BMC Gastroenterol. 2006;6:33",
        "title": "The Fatty Liver Index: a simple and accurate predictor of hepatic steatosis in the general population"
      },
      "formula": "fli",
      "formula_expression": "L = 0.953 * loge(triglycerides_mg_dl) + 0.139 * bmi_kg_m2 + 0.718 * loge(ggt_u_l) + 0.053 * waist_cm - 15.745; FLI = (e^L / (1 + e^L)) * 100",
      "bmi_kg_m2": 22.0,
      "bedogni_band": "rule_out",
      "fli": 6.6,
      "ggt_u_l": 20.0,
      "triglycerides_mg_dl": 80.0,
      "waist_cm": 70.0
    }
  ]
}
```

## Response fields

- `formula` (string): fli
- `formula_expression` (string): Exact Bedogni 2006 expression (natural log, triglycerides in mg/dL)
- `bmi_kg_m2` (number): Caller-supplied BMI in kg/m^2
- `waist_cm` (number): Waist circumference in cm
- `ggt_u_l` (number): GGT in U/L
- `triglycerides_mg_dl` (number): Triglycerides used in mg/dL (after mmol/L conversion when supplied)
- `l` (number): Linear predictor L, 4 decimals
- `fli` (number): Fatty liver index, 1 decimal
- `bedogni_band` (string): Published Bedogni 2006 operating points: rule_out (FLI < 30), indeterminate (30 <= FLI < 60), rule_in (FLI >= 60). Not a diagnosis.
- `citation` (object): Bedogni BMC Gastroenterol 2006 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "l": -2.65,
  "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": "Bedogni G, Bellentani S, Miglioli L, Masutti F, Passalacqua M, Castiglione A, Tiribelli C",
    "doi": "10.1186/1471-230X-6-33",
    "id": "bedogni-2006",
    "pmid": "17081293",
    "source": "BMC Gastroenterol. 2006;6:33",
    "title": "The Fatty Liver Index: a simple and accurate predictor of hepatic steatosis in the general population"
  },
  "formula": "fli",
  "formula_expression": "L = 0.953 * loge(triglycerides_mg_dl) + 0.139 * bmi_kg_m2 + 0.718 * loge(ggt_u_l) + 0.053 * waist_cm - 15.745; FLI = (e^L / (1 + e^L)) * 100",
  "bmi_kg_m2": 22.0,
  "bedogni_band": "rule_out",
  "fli": 6.6,
  "ggt_u_l": 20.0,
  "triglycerides_mg_dl": 80.0,
  "waist_cm": 70.0
}
```

## Errors

- HTTP 400 `invalid_bmi_kg_m2`: bmi_kg_m2 must be a number from 10 to 80. Returned before settlement; you are not charged.
- HTTP 400 `invalid_waist_cm`: waist_cm must be a number from 40 to 200 (Bedogni 2006 FLI). Returned before settlement; you are not charged.
- HTTP 400 `invalid_ggt`: ggt_u_l must be a number from 1 to 2000 (Bedogni 2006 FLI). Returned before settlement; you are not charged.
- HTTP 400 `invalid_fli_triglyceride`: triglycerides_mg_dl (10-2000) or triglycerides_mmol_l (0.11-22.6) is required, not both (Bedogni 2006 FLI; mg/dL = mmol/L * 88.57). Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [NAFLD fibrosis score](https://magentlab.com/docs/nafld-fibrosis) — 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.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/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.
- 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.
