# BODE index

BODE

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

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

## What it computes

Sum Celli 2004 BODE points from BMI, FEV1 percent predicted, MMRC dyspnea, and 6-minute walk distance.

## When to use

When an agent needs the published Celli 2004 BODE total and quartile and must not invent a GOLD stage or listing decision.

## When not to use

- Not a GOLD COPD stage and not a transplant listing protocol. Quartiles follow Celli 2004 (0-2 / 3-4 / 5-6 / 7-10).
- BMI is caller-supplied kg/m^2. magent does not compute BMI from height and weight.
- MMRC is the caller-assigned modified Medical Research Council grade 0-4. magent does not interview the patient.

## Formula

```
BODE = bmi_points + fev1_points + mmrc_points + walk_points; BMI <=21 -> 1 else 0; FEV1% >=65 -> 0, 50-64 -> 1, 36-49 -> 2, <=35 -> 3; MMRC 0-1 -> 0, 2 -> 1, 3 -> 2, 4 -> 3; 6MWD m >=350 -> 0, 250-349 -> 1, 150-249 -> 2, <=149 -> 3; quartiles 0-2 / 3-4 / 5-6 / 7-10; max 10
```

## Citation

[The body-mass index, airflow obstruction, dyspnea, and exercise capacity index in chronic obstructive pulmonary disease](https://doi.org/10.1056/NEJMoa021322)
Celli BR, Cote CG, Marin JM, et al.
N Engl J Med. 2004;350(10):1005-1012
DOI: [10.1056/NEJMoa021322](https://doi.org/10.1056/NEJMoa021322)

## Worked example

### All 0-point bands (quartile 1)

Given: `bmi_kg_m2=24, fev1_percent_predicted=70, mmrc=0, six_minute_walk_m=400`

1. BMI 24 >21 → 0; FEV1 70% ≥65 → 0; MMRC 0 → 0; 6MWD 400 m ≥350 → 0
2. Score = 0; quartile 1


### Maximum points (quartile 4)

Given: `bmi_kg_m2=21, fev1_percent_predicted=20, mmrc=4, six_minute_walk_m=100`

1. BMI 21 ≤21 → 1; FEV1 20% ≤35 → 3; MMRC 4 → 3; 6MWD 100 m ≤149 → 3
2. Score = 10; quartile 4


## Also searched as

- BODE index
- BODE score
- Celli BODE
- BMI obstruction dyspnea exercise
- COPD BODE
- 6-minute walk BODE
- MMRC BODE

## Parameters

- `bmi_kg_m2` (number, required): Body-mass index in kg/m^2 (10-80). Caller-supplied; magent does not compute BMI from height and weight. Celli 2004: >21 scores 0; <=21 scores 1.
- `fev1_percent_predicted` (number, required): FEV1 percent predicted (10-150). Celli 2004 Table 2: >=65 scores 0; 50-64 scores 1; 36-49 scores 2; <=35 scores 3.
- `mmrc` (integer, required): Modified Medical Research Council dyspnea grade as an integer 0-4 (Celli 2004). 0-1 scores 0; 2 scores 1; 3 scores 2; 4 scores 3. magent does not interview the patient.
- `six_minute_walk_m` (number, required): Six-minute walk distance in meters (0-1000). Celli 2004 Table 2: >=350 scores 0; 250-349 scores 1; 150-249 scores 2; <=149 scores 3.

## 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/bode`
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": "24",
      "fev1_percent_predicted": "70",
      "mmrc": "0",
      "six_minute_walk_m": "400"
    },
    {
      "bmi_kg_m2": "24",
      "fev1_percent_predicted": "70",
      "mmrc": "0",
      "six_minute_walk_m": "400"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/bode",
  "items": [
    {
      "components": [
        {
          "value": 24.0,
          "factor": "bmi",
          "points": 0,
          "present": false
        },
        {
          "value": 70.0,
          "factor": "fev1",
          "points": 0,
          "present": false
        },
        {
          "value": 0,
          "factor": "mmrc",
          "points": 0,
          "present": false
        },
        {
          "value": 400.0,
          "factor": "six_minute_walk",
          "points": 0,
          "present": 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": "Celli BR, Cote CG, Marin JM, et al.",
        "doi": "10.1056/NEJMoa021322",
        "id": "celli-2004",
        "pmid": "14999112",
        "source": "N Engl J Med. 2004;350(10):1005-1012",
        "title": "The body-mass index, airflow obstruction, dyspnea, and exercise capacity index in chronic obstructive pulmonary disease"
      },
      "formula": "bode",
      "formula_expression": "BODE = bmi_points + fev1_points + mmrc_points + walk_points; BMI <=21 -> 1 else 0; FEV1% >=65 -> 0, 50-64 -> 1, 36-49 -> 2, <=35 -> 3; MMRC 0-1 -> 0, 2 -> 1, 3 -> 2, 4 -> 3; 6MWD m >=350 -> 0, 250-349 -> 1, 150-249 -> 2, <=149 -> 3; quartiles 0-2 / 3-4 / 5-6 / 7-10; max 10",
      "max_score": 10,
      "score": 0,
      "bmi_kg_m2": 24.0,
      "fev1_percent_predicted": 70.0,
      "mmrc": 0,
      "quartile": 1,
      "six_minute_walk_m": 400.0
    },
    {
      "components": [
        {
          "value": 24.0,
          "factor": "bmi",
          "points": 0,
          "present": false
        },
        {
          "value": 70.0,
          "factor": "fev1",
          "points": 0,
          "present": false
        },
        {
          "value": 0,
          "factor": "mmrc",
          "points": 0,
          "present": false
        },
        {
          "value": 400.0,
          "factor": "six_minute_walk",
          "points": 0,
          "present": 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": "Celli BR, Cote CG, Marin JM, et al.",
        "doi": "10.1056/NEJMoa021322",
        "id": "celli-2004",
        "pmid": "14999112",
        "source": "N Engl J Med. 2004;350(10):1005-1012",
        "title": "The body-mass index, airflow obstruction, dyspnea, and exercise capacity index in chronic obstructive pulmonary disease"
      },
      "formula": "bode",
      "formula_expression": "BODE = bmi_points + fev1_points + mmrc_points + walk_points; BMI <=21 -> 1 else 0; FEV1% >=65 -> 0, 50-64 -> 1, 36-49 -> 2, <=35 -> 3; MMRC 0-1 -> 0, 2 -> 1, 3 -> 2, 4 -> 3; 6MWD m >=350 -> 0, 250-349 -> 1, 150-249 -> 2, <=149 -> 3; quartiles 0-2 / 3-4 / 5-6 / 7-10; max 10",
      "max_score": 10,
      "score": 0,
      "bmi_kg_m2": 24.0,
      "fev1_percent_predicted": 70.0,
      "mmrc": 0,
      "quartile": 1,
      "six_minute_walk_m": 400.0
    }
  ]
}
```

## Response fields

- `formula` (string): bode
- `formula_expression` (string): Exact Celli 2004 expression
- `score` (integer): BODE points 0-10
- `max_score` (integer): Always 10
- `quartile` (integer): Celli 2004 quartile 1 (0-2), 2 (3-4), 3 (5-6), or 4 (7-10). Not a GOLD stage.
- `bmi_kg_m2` (number): Caller-supplied BMI in kg/m^2
- `fev1_percent_predicted` (number): FEV1 percent predicted used
- `mmrc` (integer): Caller-assigned MMRC grade 0-4
- `six_minute_walk_m` (number): Six-minute walk distance in meters
- `components` (array): Per-factor points for bmi, fev1, mmrc, and six_minute_walk
- `citation` (object): Celli et al. NEJM 2004 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 24.0,
      "factor": "bmi",
      "points": 0,
      "present": false
    },
    {
      "value": 70.0,
      "factor": "fev1",
      "points": 0,
      "present": false
    },
    {
      "value": 0,
      "factor": "mmrc",
      "points": 0,
      "present": false
    },
    {
      "value": 400.0,
      "factor": "six_minute_walk",
      "points": 0,
      "present": 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": "Celli BR, Cote CG, Marin JM, et al.",
    "doi": "10.1056/NEJMoa021322",
    "id": "celli-2004",
    "pmid": "14999112",
    "source": "N Engl J Med. 2004;350(10):1005-1012",
    "title": "The body-mass index, airflow obstruction, dyspnea, and exercise capacity index in chronic obstructive pulmonary disease"
  },
  "formula": "bode",
  "formula_expression": "BODE = bmi_points + fev1_points + mmrc_points + walk_points; BMI <=21 -> 1 else 0; FEV1% >=65 -> 0, 50-64 -> 1, 36-49 -> 2, <=35 -> 3; MMRC 0-1 -> 0, 2 -> 1, 3 -> 2, 4 -> 3; 6MWD m >=350 -> 0, 250-349 -> 1, 150-249 -> 2, <=149 -> 3; quartiles 0-2 / 3-4 / 5-6 / 7-10; max 10",
  "max_score": 10,
  "score": 0,
  "bmi_kg_m2": 24.0,
  "fev1_percent_predicted": 70.0,
  "mmrc": 0,
  "quartile": 1,
  "six_minute_walk_m": 400.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_fev1_percent`: fev1_percent_predicted must be a number from 10 to 150. Returned before settlement; you are not charged.
- HTTP 400 `invalid_mmrc`: mmrc must be an integer from 0 to 4 (Celli 2004 MMRC). Returned before settlement; you are not charged.
- HTTP 400 `invalid_six_minute_walk_m`: six_minute_walk_m must be a number from 0 to 1000. 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

- [Peak expiratory flow](https://magentlab.com/docs/peak-expiratory-flow) — Compute Nunn and Gregg 1989 predicted peak expiratory flow in L/min from age, sex, and height.
- [PaO2/FiO2 ratio](https://magentlab.com/docs/pf-ratio) — Compute the PaO2/FiO2 ratio as arterial PO2 in mm Hg divided by inspired oxygen fraction.

## 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 echoing accepted, payload, and extensions when present).
- 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.
