# IgA nephropathy 5-year risk

IgAN predict

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

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

## What it computes

Compute 5-year risk of a 50% decline in eGFR or ESKD after kidney biopsy from the Barbour 2019 full International IgAN prediction model that does not use race or ethnicity.

## When to use

When an agent already has age at biopsy, a caller-supplied eGFR, MAP, proteinuria in g/day, Oxford MEST scores, and whether RAS blockade and immunosuppression were in use at biopsy, and needs that paper's race-free 5-year risk. Not a biopsy diagnosis, not KFRE, and not the race/ethnicity model.

## When not to use

- Not a medical device. Not a biopsy diagnosis, immunosuppression order, or RAS-blockade order. magent does not assay creatinine or urine protein and does not compute CKD-EPI eGFR.
- Barbour 2019 full model without race/ethnicity only (eTable 3). Does not ship the full model that includes Chinese, Japanese, White, or other race coefficients.
- Not KFRE and not a 50% eGFR-decline or ESKD diagnosis. Emits a 5-year percent, not a named risk class. Table 3 percentile bands are cohort-specific and are not returned.
- Derivation was adults 18 years or older with biopsy-proven idiopathic IgAN and without ESKD at biopsy. Age 18-120 is a magent adult clamp. Caller supplies eGFR.
- Predictors are at the time of biopsy, including RAS blockade and immunosuppression already in use. The model is not a treatment-response predictor for drugs started after biopsy.

## Formula

```
LP = -0.320*(sqrt(egfr_ml_min_1_73m2) - 8.8) + 0.002*(map_mm_hg - 97) - 0.035*(ln(proteinuria_g_day) - 0.09) + 0.004*(map_mm_hg*ln(proteinuria_g_day) - 8.73) + 0.201*M1 - 0.035*E1 + 0.084*S1 + 0.700*T1 + 1.237*T2 + 0.101*T1*ln(proteinuria_g_day) - 0.321*T2*ln(proteinuria_g_day) - 0.017*(age_years - 38) + 0.118*RASB + 0.166*RASB*ln(proteinuria_g_day) - 0.266*immunosuppression; S0(t) = 1.0003754 - 0.1131641*u^2 + 0.0964763*u^2*ln(u), u = (t + 0.1)/100, t months; 5-year risk = 1 - S0(60)^exp(LP); Barbour 2019 eTable 3 full model without race/ethnicity only; M/E/S/T1/T2 RASB and immunosuppression are 0 or 1; natural log; caller supplies eGFR; not the race model; not KFRE
```

## Citation

[Evaluating a new international risk-prediction tool in IgA nephropathy](https://doi.org/10.1001/jamainternmed.2019.0600)
Barbour SJ, Coppo R, Zhang H, Liu ZH, Suzuki Y, Matsuzaki K, Katafuchi R, Er L, Espino-Hernandez G, Kim SJ, Reich HN, Cattran DC, Feehally J; International IgA Nephropathy Network
JAMA Intern Med. 2019;179(7):942-952
DOI: [10.1001/jamainternmed.2019.0600](https://doi.org/10.1001/jamainternmed.2019.0600)

## Worked example

### Age 38, eGFR 77, MAP 97, proteinuria 1.1 g/day, M1 E0 S1 T0, RASB, no immunosuppression

Given: `age_years=38, egfr_ml_min_1_73m2=77, immunosuppression_at_biopsy=false, map_mm_hg=97, mest_e=0, mest_m=1, mest_s=1, mest_t=0, proteinuria_g_day=1.1, rasb_at_biopsy=true`

1. ln(1.1) = 0.0953101798
2. eGFR term = -0.320 * (sqrt(77) - 8.8) = 0.0080113960
3. MAP term = 0.002 * (97 - 97) = 0
4. proteinuria term = -0.035 * (0.0953101798 - 0.09) = -0.0001858563
5. MAP×proteinuria term = 0.004 * (97*0.0953101798 - 8.73) = 0.0020603498
6. M1 = 0.201; E1 = 0; S1 = 0.084; T1 = T2 = 0
7. age term = -0.017 * (38 - 38) = 0
8. RASB = 0.118; RASB×proteinuria = 0.166 * 0.0953101798 = 0.0158214898; immunosuppression = 0
9. LP = 0.42870738 → 0.4287
10. S0(60) from eTable 3 S0(t) → 0.94176
11. 5-year = 1 - S0(60)^exp(LP) → 8.8%


## Also searched as

- IgA nephropathy risk
- IgAN prediction
- Barbour 2019 IgAN
- International IgAN prediction
- MEST IgAN risk
- IgA nephropathy ESKD risk
- 50 percent eGFR decline IgAN

## Parameters

- `age_years` (integer, required): Age at biopsy in years (integer 18-120). Barbour 2019 derivation was adults 18 years or older. Enters the linear predictor as age_years - 38.
- `egfr_ml_min_1_73m2` (number, required): Caller-supplied eGFR in mL/min/1.73 m2 (5-200). Enters as sqrt(eGFR) centered at 8.8. Derivation used CKD-EPI and excluded ESKD at biopsy. magent does not compute CKD-EPI and does not assay creatinine.
- `map_mm_hg` (number, required): Mean arterial pressure at biopsy in mm Hg (30-180). Enters centered at 97 and in the proteinuria×MAP interaction.
- `proteinuria_g_day` (number, required): Proteinuria at biopsy in g/day (0.01-20). Enters as natural log, centered at 0.09, plus interactions with MAP, T, and RASB. magent does not assay urine protein.
- `mest_m` (integer, required): Oxford MEST mesangial hypercellularity at biopsy. 0 = M0, 1 = M1. magent does not score the biopsy.
- `mest_e` (integer, required): Oxford MEST endocapillary hypercellularity at biopsy. 0 = E0, 1 = E1. magent does not score the biopsy.
- `mest_s` (integer, required): Oxford MEST segmental sclerosis at biopsy. 0 = S0, 1 = S1. magent does not score the biopsy.
- `mest_t` (integer, required): Oxford MEST tubular atrophy/interstitial fibrosis at biopsy. 0 = T0, 1 = T1, 2 = T2. T1 and T2 have main-effect and proteinuria-interaction terms. magent does not score the biopsy.
- `rasb_at_biopsy` (boolean, required): true if renin-angiotensin system blockade (ACE inhibitor or ARB) was in use at biopsy. Enters as 1 or 0 plus a RASB×proteinuria term. magent does not prescribe RAS blockade.
- `immunosuppression_at_biopsy` (boolean, required): true if immunosuppression was in use at biopsy. Enters as 1 or 0. magent does not prescribe immunosuppression.

## 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/igan_predict`
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": [
    {
      "age_years": "38",
      "egfr_ml_min_1_73m2": "77",
      "immunosuppression_at_biopsy": "false",
      "map_mm_hg": "97",
      "mest_e": "0",
      "mest_m": "1",
      "mest_s": "1",
      "mest_t": "0",
      "proteinuria_g_day": "1.1",
      "rasb_at_biopsy": "true"
    },
    {
      "age_years": "38",
      "egfr_ml_min_1_73m2": "77",
      "immunosuppression_at_biopsy": "false",
      "map_mm_hg": "97",
      "mest_e": "0",
      "mest_m": "1",
      "mest_s": "1",
      "mest_t": "0",
      "proteinuria_g_day": "1.1",
      "rasb_at_biopsy": "true"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/igan_predict",
  "items": [
    {
      "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": "Barbour SJ, Coppo R, Zhang H, Liu ZH, Suzuki Y, Matsuzaki K, Katafuchi R, Er L, Espino-Hernandez G, Kim SJ, Reich HN, Cattran DC, Feehally J; International IgA Nephropathy Network",
        "doi": "10.1001/jamainternmed.2019.0600",
        "id": "barbour-2019-igan",
        "pmid": "30980653",
        "source": "JAMA Intern Med. 2019;179(7):942-952",
        "title": "Evaluating a new international risk-prediction tool in IgA nephropathy"
      },
      "formula": "igan_predict",
      "formula_expression": "LP = -0.320*(sqrt(egfr_ml_min_1_73m2) - 8.8) + 0.002*(map_mm_hg - 97) - 0.035*(ln(proteinuria_g_day) - 0.09) + 0.004*(map_mm_hg*ln(proteinuria_g_day) - 8.73) + 0.201*M1 - 0.035*E1 + 0.084*S1 + 0.700*T1 + 1.237*T2 + 0.101*T1*ln(proteinuria_g_day) - 0.321*T2*ln(proteinuria_g_day) - 0.017*(age_years - 38) + 0.118*RASB + 0.166*RASB*ln(proteinuria_g_day) - 0.266*immunosuppression; S0(t) = 1.0003754 - 0.1131641*u^2 + 0.0964763*u^2*ln(u), u = (t + 0.1)/100, t months; 5-year risk = 1 - S0(60)^exp(LP); Barbour 2019 eTable 3 full model without race/ethnicity only; M/E/S/T1/T2 RASB and immunosuppression are 0 or 1; natural log; caller supplies eGFR; not the race model; not KFRE",
      "age_years": 38,
      "linear_predictor": 0.4287,
      "egfr_ml_min_1_73m2": 77.0,
      "map_mm_hg": 97.0,
      "five_year_risk_percent": 8.8,
      "horizon_months": 60,
      "immunosuppression_at_biopsy": false,
      "mest_e": 0,
      "mest_m": 1,
      "mest_s": 1,
      "mest_t": 0,
      "proteinuria_g_day": 1.1,
      "rasb_at_biopsy": true,
      "s0_5_year": 0.94176
    },
    {
      "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": "Barbour SJ, Coppo R, Zhang H, Liu ZH, Suzuki Y, Matsuzaki K, Katafuchi R, Er L, Espino-Hernandez G, Kim SJ, Reich HN, Cattran DC, Feehally J; International IgA Nephropathy Network",
        "doi": "10.1001/jamainternmed.2019.0600",
        "id": "barbour-2019-igan",
        "pmid": "30980653",
        "source": "JAMA Intern Med. 2019;179(7):942-952",
        "title": "Evaluating a new international risk-prediction tool in IgA nephropathy"
      },
      "formula": "igan_predict",
      "formula_expression": "LP = -0.320*(sqrt(egfr_ml_min_1_73m2) - 8.8) + 0.002*(map_mm_hg - 97) - 0.035*(ln(proteinuria_g_day) - 0.09) + 0.004*(map_mm_hg*ln(proteinuria_g_day) - 8.73) + 0.201*M1 - 0.035*E1 + 0.084*S1 + 0.700*T1 + 1.237*T2 + 0.101*T1*ln(proteinuria_g_day) - 0.321*T2*ln(proteinuria_g_day) - 0.017*(age_years - 38) + 0.118*RASB + 0.166*RASB*ln(proteinuria_g_day) - 0.266*immunosuppression; S0(t) = 1.0003754 - 0.1131641*u^2 + 0.0964763*u^2*ln(u), u = (t + 0.1)/100, t months; 5-year risk = 1 - S0(60)^exp(LP); Barbour 2019 eTable 3 full model without race/ethnicity only; M/E/S/T1/T2 RASB and immunosuppression are 0 or 1; natural log; caller supplies eGFR; not the race model; not KFRE",
      "age_years": 38,
      "linear_predictor": 0.4287,
      "egfr_ml_min_1_73m2": 77.0,
      "map_mm_hg": 97.0,
      "five_year_risk_percent": 8.8,
      "horizon_months": 60,
      "immunosuppression_at_biopsy": false,
      "mest_e": 0,
      "mest_m": 1,
      "mest_s": 1,
      "mest_t": 0,
      "proteinuria_g_day": 1.1,
      "rasb_at_biopsy": true,
      "s0_5_year": 0.94176
    }
  ]
}
```

## Response fields

- `formula` (string): igan_predict
- `formula_expression` (string): Barbour 2019 eTable 3 race-free full-model LP and S0(t)
- `age_years` (integer): Age at biopsy in years used (18-120)
- `egfr_ml_min_1_73m2` (number): Caller-supplied eGFR used, mL/min/1.73 m2
- `map_mm_hg` (number): MAP at biopsy used, mm Hg
- `proteinuria_g_day` (number): Proteinuria at biopsy used, g/day
- `mest_m` (integer): Oxford M 0 or 1 used
- `mest_e` (integer): Oxford E 0 or 1 used
- `mest_s` (integer): Oxford S 0 or 1 used
- `mest_t` (integer): Oxford T 0, 1, or 2 used
- `rasb_at_biopsy` (boolean): RAS blockade at biopsy flag used
- `immunosuppression_at_biopsy` (boolean): Immunosuppression at biopsy flag used
- `linear_predictor` (number): Barbour 2019 race-free full-model centered LP, 4 decimals
- `five_year_risk_percent` (number): 5-year risk of 50% eGFR decline or ESKD, 1 decimal (1 - S0(60)^exp(LP))
- `s0_5_year` (number): Barbour 2019 race-free S0 at 60 months, 5 decimals
- `horizon_months` (integer): Prediction horizon in months (60)
- `citation` (object): Barbour et al. JAMA Intern Med 2019 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Barbour SJ, Coppo R, Zhang H, Liu ZH, Suzuki Y, Matsuzaki K, Katafuchi R, Er L, Espino-Hernandez G, Kim SJ, Reich HN, Cattran DC, Feehally J; International IgA Nephropathy Network",
    "doi": "10.1001/jamainternmed.2019.0600",
    "id": "barbour-2019-igan",
    "pmid": "30980653",
    "source": "JAMA Intern Med. 2019;179(7):942-952",
    "title": "Evaluating a new international risk-prediction tool in IgA nephropathy"
  },
  "formula": "igan_predict",
  "formula_expression": "LP = -0.320*(sqrt(egfr_ml_min_1_73m2) - 8.8) + 0.002*(map_mm_hg - 97) - 0.035*(ln(proteinuria_g_day) - 0.09) + 0.004*(map_mm_hg*ln(proteinuria_g_day) - 8.73) + 0.201*M1 - 0.035*E1 + 0.084*S1 + 0.700*T1 + 1.237*T2 + 0.101*T1*ln(proteinuria_g_day) - 0.321*T2*ln(proteinuria_g_day) - 0.017*(age_years - 38) + 0.118*RASB + 0.166*RASB*ln(proteinuria_g_day) - 0.266*immunosuppression; S0(t) = 1.0003754 - 0.1131641*u^2 + 0.0964763*u^2*ln(u), u = (t + 0.1)/100, t months; 5-year risk = 1 - S0(60)^exp(LP); Barbour 2019 eTable 3 full model without race/ethnicity only; M/E/S/T1/T2 RASB and immunosuppression are 0 or 1; natural log; caller supplies eGFR; not the race model; not KFRE",
  "age_years": 38,
  "linear_predictor": 0.4287,
  "egfr_ml_min_1_73m2": 77.0,
  "map_mm_hg": 97.0,
  "five_year_risk_percent": 8.8,
  "horizon_months": 60,
  "immunosuppression_at_biopsy": false,
  "mest_e": 0,
  "mest_m": 1,
  "mest_s": 1,
  "mest_t": 0,
  "proteinuria_g_day": 1.1,
  "rasb_at_biopsy": true,
  "s0_5_year": 0.94176
}
```

## Errors

- HTTP 400 `invalid_igan`: IgAN prediction needs eGFR, MAP, proteinuria, age, MEST, RASB, and immunosuppression as in Barbour 2019 without race. Returned before settlement; you are not charged.
- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_egfr`: egfr_ml_min_1_73m2 must be a number from 5 to 200 (caller-assigned eGFR; magent does not compute MDRD or CKD-EPI). Returned before settlement; you are not charged.
- HTTP 400 `invalid_map_mm_hg`: map_mm_hg must be a number from 30 to 180. Returned before settlement; you are not charged.
- HTTP 400 `invalid_proteinuria_g_day`: proteinuria_g_day must be a positive number in g/day. Returned before settlement; you are not charged.
- HTTP 400 `invalid_mest`: Oxford MEST M/E/S must be 0 or 1 and T must be 0, 1, or 2. Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false 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

- [KFRE](https://magentlab.com/docs/kfre) — Compute 2-year and 5-year risk of kidney failure (dialysis or preemptive transplant) from the Tangri 2011 4-variable Kidney Failure Risk Equation (age, sex, eGFR, urine ACR).
- [CKD-EPI 2021 eGFR](https://magentlab.com/docs/egfr) — Compute race-free CKD-EPI 2021 creatinine eGFR in mL/min/1.73m2.
- [KeGFR](https://magentlab.com/docs/kegfr) — Compute Chen 2013 kinetic eGFR (KeGFR) from two plasma creatinines, the hours between them, a caller-assigned steady-state creatinine and corresponding eGFR/CrCl, and MaxΔPCr/Day. magent does not compute MDRD or CKD-EPI.

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