# ASCO irAE hypothyroidism grade

irAE hypothyroidism

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

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

## What it computes

Apply Brahmer 2018 ASCO Table 4.1.1 primary hypothyroidism grading and return grade 1-3 plus icpi_action from tsh_miu_l and three caller-assigned flags.

## When to use

When an agent already has TSH in mIU/L and caller-assigned moderate-symptoms, severe-or-life-threatening, and unable-to-perform-ADL flags and needs the published first-match grade and ICI continue or hold-until-baseline action. magent does not assay TSH or FT4.

## When not to use

- Not a medical device.
- Not a diagnosis. Not a levothyroxine dose.
- magent does not assay TSH or FT4. tsh_miu_l and the three flags are caller-assigned (Brahmer 2018 Table 4.1.1 primary hypothyroidism).
- Not hyperthyroidism (Brahmer 2018 Table 4.1.2).
- Paper grade 3-4 is one band; this tool returns grade 3, not a separate grade 4.

## Formula

```
irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose
```

## Citation

[Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline](https://doi.org/10.1200/JCO.2017.77.6385)
Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA
J Clin Oncol. 2018;36(17):1714-1768
DOI: [10.1200/JCO.2017.77.6385](https://doi.org/10.1200/JCO.2017.77.6385)

## Worked example

### TSH 8 mIU/L, grade 1 continue

Given: `moderate_symptoms=false, severe_or_life_threatening=false, tsh_miu_l=8, unable_to_perform_adl=false`

1. tsh_miu_l is 8 (TSH <10 mIU/L)
2. moderate_symptoms, severe_or_life_threatening, and unable_to_perform_adl are false
3. first-match is grade 1; icpi_action is continue


### TSH 12 mIU/L, grade 2 hold until baseline

Given: `moderate_symptoms=false, severe_or_life_threatening=false, tsh_miu_l=12, unable_to_perform_adl=false`

1. tsh_miu_l is 12 (persistently TSH >10 mIU/L; TSH 10 is this band)
2. moderate_symptoms, severe_or_life_threatening, and unable_to_perform_adl are false
3. first-match is grade 2; icpi_action is hold_until_baseline


## Also searched as

- irAE hypothyroidism
- immune-related hypothyroidism
- ASCO hypothyroidism grade
- Brahmer 2018 hypothyroidism
- ICI hypothyroidism
- checkpoint inhibitor TSH
- immune checkpoint thyroid
- primary hypothyroidism irAE

## Parameters

- `tsh_miu_l` (number, required): TSH in mIU/L (0.01-150; Brahmer 2018 Table 4.1.1 primary hypothyroidism). Persistently TSH >10 mIU/L is grade 2 unless a grade 3 flag is true; TSH 10 is this band. TSH <10 mIU/L with no moderate or severe flags is grade 1. magent does not assay TSH.
- `moderate_symptoms` (boolean, required): Moderate symptoms with ability to perform ADL as assigned by the caller (Brahmer 2018 Table 4.1.1 grade 2). true or false. When true and no grade 3 flag is true, grade is 2. magent does not examine the patient.
- `severe_or_life_threatening` (boolean, required): Severe symptoms, medically significant or life-threatening consequences as assigned by the caller (Brahmer 2018 Table 4.1.1 grade 3-4, returned as grade 3). true or false. When true, grade is 3. magent does not examine the patient.
- `unable_to_perform_adl` (boolean, required): Unable to perform ADL as assigned by the caller (Brahmer 2018 Table 4.1.1 grade 3-4, returned as grade 3). true or false. When true, grade is 3. magent does not assess ADL.

## 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/irae_hypothyroidism`
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": [
    {
      "moderate_symptoms": "false",
      "severe_or_life_threatening": "false",
      "tsh_miu_l": "8",
      "unable_to_perform_adl": "false"
    },
    {
      "moderate_symptoms": "false",
      "severe_or_life_threatening": "false",
      "tsh_miu_l": "8",
      "unable_to_perform_adl": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/irae_hypothyroidism",
  "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": "Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA",
        "doi": "10.1200/JCO.2017.77.6385",
        "id": "brahmer-2018",
        "pmid": "29442540",
        "source": "J Clin Oncol. 2018;36(17):1714-1768",
        "title": "Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline"
      },
      "formula": "irae_hypothyroidism",
      "formula_expression": "irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose",
      "criteria": [
        {
          "factor": "severe_or_life_threatening",
          "met": false
        },
        {
          "factor": "unable_to_perform_adl",
          "met": false
        },
        {
          "factor": "moderate_symptoms",
          "met": false
        },
        {
          "value": 8.0,
          "factor": "tsh_ge_10",
          "met": false
        }
      ],
      "grade": 1,
      "icpi_action": "continue",
      "moderate_symptoms": false,
      "severe_or_life_threatening": false,
      "tsh_miu_l": 8.0,
      "unable_to_perform_adl": false
    },
    {
      "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": "Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA",
        "doi": "10.1200/JCO.2017.77.6385",
        "id": "brahmer-2018",
        "pmid": "29442540",
        "source": "J Clin Oncol. 2018;36(17):1714-1768",
        "title": "Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline"
      },
      "formula": "irae_hypothyroidism",
      "formula_expression": "irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose",
      "criteria": [
        {
          "factor": "severe_or_life_threatening",
          "met": false
        },
        {
          "factor": "unable_to_perform_adl",
          "met": false
        },
        {
          "factor": "moderate_symptoms",
          "met": false
        },
        {
          "value": 8.0,
          "factor": "tsh_ge_10",
          "met": false
        }
      ],
      "grade": 1,
      "icpi_action": "continue",
      "moderate_symptoms": false,
      "severe_or_life_threatening": false,
      "tsh_miu_l": 8.0,
      "unable_to_perform_adl": false
    }
  ]
}
```

## Response fields

- `formula` (string): irae_hypothyroidism
- `formula_expression` (string): Brahmer 2018 Table 4.1.1 first-match primary hypothyroidism grade and icpi_action rule
- `grade` (integer): Primary hypothyroidism grade 1, 2, or 3 (Brahmer 2018 Table 4.1.1; paper G3-4 is grade 3). First-match worst-wins. Not a diagnosis.
- `icpi_action` (string): continue (grade 1) or hold_until_baseline (grade 2 or 3). Not a levothyroxine dose.
- `tsh_miu_l` (number): Echo of the caller-assigned TSH in mIU/L (0.01-150)
- `moderate_symptoms` (boolean): Echo of caller-assigned moderate symptoms (grade 2 when true)
- `severe_or_life_threatening` (boolean): Echo of caller-assigned severe or life-threatening flag (grade 3 when true)
- `unable_to_perform_adl` (boolean): Echo of caller-assigned unable to perform ADL (grade 3 when true)
- `criteria` (array): Per-factor Tree rows with factor and met for severe_or_life_threatening, unable_to_perform_adl, moderate_symptoms, and tsh_ge_10; the TSH row includes value
- `citation` (object): Brahmer 2018 J Clin Oncol ASCO irAE guideline 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": "Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA",
    "doi": "10.1200/JCO.2017.77.6385",
    "id": "brahmer-2018",
    "pmid": "29442540",
    "source": "J Clin Oncol. 2018;36(17):1714-1768",
    "title": "Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline"
  },
  "formula": "irae_hypothyroidism",
  "formula_expression": "irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose",
  "criteria": [
    {
      "factor": "severe_or_life_threatening",
      "met": false
    },
    {
      "factor": "unable_to_perform_adl",
      "met": false
    },
    {
      "factor": "moderate_symptoms",
      "met": false
    },
    {
      "value": 8.0,
      "factor": "tsh_ge_10",
      "met": false
    }
  ],
  "grade": 1,
  "icpi_action": "continue",
  "moderate_symptoms": false,
  "severe_or_life_threatening": false,
  "tsh_miu_l": 8.0,
  "unable_to_perform_adl": false
}
```

## Errors

- HTTP 400 `invalid_tsh_miu_l`: tsh_miu_l must be a number from 0.01 to 150 (Brahmer 2018 TSH mIU/L). 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

- [Myxedema coma score](https://magentlab.com/docs/myxedema-coma) — Sum Popoveniuc 2014 myxedema coma diagnostic points from caller-assigned thermoregulatory, CNS, GI, precipitating-event, cardiovascular, and metabolic bands and return ≥60 potentially diagnostic or 45–59 at risk.
- [Miller ESR](https://magentlab.com/docs/miller-esr) — Compute the Miller 1983 adult maximum normal erythrocyte sedimentation rate in mm/h from age and sex. Men: age/2. Women: (age + 10)/2. Returns the threshold only.

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