# Appendicitis inflammatory response score

AIR score

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

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

## What it computes

Compute the Andersson 2008 appendicitis inflammatory response (AIR) score from caller-assigned findings, temperature, WBC, neutrophil percent, and CRP in mg/L.

## When to use

When an agent needs the published Andersson 2008 AIR total and must not invent abdominal findings or treat the total as an operating-room protocol.

## When not to use

- Not a medical device. Not a diagnosis or operating-room protocol.
- Findings, rebound or guarding grade, and laboratory values are caller-assigned. magent does not examine the abdomen.
- CRP is scored in mg/L, not mg/dL (Andersson 2008 AIR table as restated in the 2021 same-group validation table).
- Bands 0-4, 5-8, and 9-12 are published AIR strata. magent does not return probability percents or operate-versus-observe orders.

## Formula

```
AIR = vomiting + rif_pain + rebound_or_guarding (none 0, light 1, medium 2, strong 3) + (temperature_c >= 38.5) + WBC 10^9/L (<10 → 0; 10.0–14.9 → 1; ≥15.0 → 2) + neutrophil_percent (<70 → 0; 70–84 → 1; ≥85 → 2) + crp_mg_l (<10 → 0; 10–49 → 1; ≥50 → 2); max 12; bands 0-4 / 5-8 / 9-12
```

## Citation

[The appendicitis inflammatory response score: a tool for the diagnosis of acute appendicitis that outperforms the Alvarado score](https://doi.org/10.1007/s00268-008-9649-y)
Andersson M, Andersson RE
World J Surg. 2008;32(8):1843-1849
DOI: [10.1007/s00268-008-9649-y](https://doi.org/10.1007/s00268-008-9649-y)

## Worked example

### All findings absent

Given: `crp_mg_l=5, neutrophil_percent=60, rebound_or_guarding=none, rif_pain=false, temperature_c=37.0, vomiting=false, wbc_ul=8000`

1. vomiting false; rif_pain false; rebound_or_guarding none; temperature 37.0 < 38.5; WBC 8000 → 8.0 ×10^9/L < 10; neutrophils 60 < 70; CRP 5 mg/L < 10
2. Score = 0; band 0-4; max 12


## Also searched as

- AIR score
- appendicitis inflammatory response
- Andersson AIR
- AIR appendicitis score
- inflammatory response score
- Andersson 2008 AIR

## Parameters

- `vomiting` (boolean, required): Vomiting (Andersson 2008). true scores 1; false scores 0.
- `rif_pain` (boolean, required): Pain in the right iliac fossa / right lower quadrant (Andersson 2008). true scores 1; false scores 0.
- `rebound_or_guarding` (string, required): Caller-assigned rebound tenderness or muscular guarding (Andersson 2008). none scores 0; light 1; medium 2; strong 3. magent does not examine the abdomen.
- `temperature_c` (number, required): Temperature in °C (30.0-45.0). ≥38.5 scores 1 (38.5 scores; 38.49 does not).
- `wbc_k_ul` (number, optional): WBC in 10^3/µL (same as 10^9/L). Provide wbc_k_ul or wbc_ul. Range 0.01-500. Converted to ×10^9/L: <10 scores 0; 10.0-14.9 scores 1; ≥15.0 scores 2.
- `wbc_ul` (number, optional): WBC in cells/µL (same as cells/mm^3). Provide wbc_k_ul or wbc_ul. Range 10-500000. Converted to ×10^9/L (= wbc_ul/1000): <10 scores 0; 10.0-14.9 scores 1; ≥15.0 scores 2.
- `neutrophil_percent` (number, required): Neutrophil percent (0-100). <70 scores 0; 70-84 scores 1; ≥85 scores 2 (69.9 does not; 70 and 84 score 1; 85 scores 2).
- `crp_mg_l` (number, required): C-reactive protein in mg/L (0-500), not mg/dL. <10 scores 0; 10-49 scores 1; ≥50 scores 2 (9.9 does not; 10 and 49 score 1; 50 scores 2).

## 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/air`
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": [
    {
      "crp_mg_l": "5",
      "neutrophil_percent": "60",
      "rebound_or_guarding": "none",
      "rif_pain": "false",
      "temperature_c": "37.0",
      "vomiting": "false",
      "wbc_ul": "8000"
    },
    {
      "crp_mg_l": "5",
      "neutrophil_percent": "60",
      "rebound_or_guarding": "none",
      "rif_pain": "false",
      "temperature_c": "37.0",
      "vomiting": "false",
      "wbc_ul": "8000"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/air",
  "items": [
    {
      "components": [
        {
          "factor": "vomiting",
          "points": 0,
          "present": false
        },
        {
          "factor": "rif_pain",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "rebound_or_guarding",
          "points": 0,
          "present": false
        },
        {
          "value": 37.0,
          "factor": "temperature_c",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0e3,
          "factor": "wbc",
          "points": 0,
          "present": false
        },
        {
          "value": 60.0,
          "factor": "neutrophil_percent",
          "points": 0,
          "present": false
        },
        {
          "value": 5.0,
          "factor": "crp_mg_l",
          "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": "Andersson M, Andersson RE",
        "doi": "10.1007/s00268-008-9649-y",
        "id": "andersson-2008",
        "pmid": "18553045",
        "source": "World J Surg. 2008;32(8):1843-1849",
        "title": "The appendicitis inflammatory response score: a tool for the diagnosis of acute appendicitis that outperforms the Alvarado score"
      },
      "formula": "air",
      "formula_expression": "AIR = vomiting + rif_pain + rebound_or_guarding (none 0, light 1, medium 2, strong 3) + (temperature_c >= 38.5) + WBC 10^9/L (<10 → 0; 10.0–14.9 → 1; ≥15.0 → 2) + neutrophil_percent (<70 → 0; 70–84 → 1; ≥85 → 2) + crp_mg_l (<10 → 0; 10–49 → 1; ≥50 → 2); max 12; bands 0-4 / 5-8 / 9-12",
      "max_score": 12,
      "score": 0,
      "neutrophil_percent": 60.0,
      "temperature_c": 37.0,
      "wbc_ul": 8.0e3,
      "air_band": "0-4",
      "crp_mg_l": 5.0,
      "rebound_or_guarding": "none",
      "rif_pain": false,
      "vomiting": false,
      "wbc_10e9_l": 8.0
    },
    {
      "components": [
        {
          "factor": "vomiting",
          "points": 0,
          "present": false
        },
        {
          "factor": "rif_pain",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "rebound_or_guarding",
          "points": 0,
          "present": false
        },
        {
          "value": 37.0,
          "factor": "temperature_c",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0e3,
          "factor": "wbc",
          "points": 0,
          "present": false
        },
        {
          "value": 60.0,
          "factor": "neutrophil_percent",
          "points": 0,
          "present": false
        },
        {
          "value": 5.0,
          "factor": "crp_mg_l",
          "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": "Andersson M, Andersson RE",
        "doi": "10.1007/s00268-008-9649-y",
        "id": "andersson-2008",
        "pmid": "18553045",
        "source": "World J Surg. 2008;32(8):1843-1849",
        "title": "The appendicitis inflammatory response score: a tool for the diagnosis of acute appendicitis that outperforms the Alvarado score"
      },
      "formula": "air",
      "formula_expression": "AIR = vomiting + rif_pain + rebound_or_guarding (none 0, light 1, medium 2, strong 3) + (temperature_c >= 38.5) + WBC 10^9/L (<10 → 0; 10.0–14.9 → 1; ≥15.0 → 2) + neutrophil_percent (<70 → 0; 70–84 → 1; ≥85 → 2) + crp_mg_l (<10 → 0; 10–49 → 1; ≥50 → 2); max 12; bands 0-4 / 5-8 / 9-12",
      "max_score": 12,
      "score": 0,
      "neutrophil_percent": 60.0,
      "temperature_c": 37.0,
      "wbc_ul": 8.0e3,
      "air_band": "0-4",
      "crp_mg_l": 5.0,
      "rebound_or_guarding": "none",
      "rif_pain": false,
      "vomiting": false,
      "wbc_10e9_l": 8.0
    }
  ]
}
```

## Response fields

- `formula` (string): air
- `formula_expression` (string): Exact expression used
- `score` (integer): Total points 0-12
- `max_score` (integer): Always 12
- `air_band` (string): 0-4 (low), 5-8 (indeterminate), or 9-12 (high) published Andersson 2008 strata. Not an operate-versus-observe order and not a percent.
- `vomiting` (boolean): Parsed vomiting flag
- `rif_pain` (boolean): Parsed right-iliac-fossa pain flag
- `rebound_or_guarding` (string): Canonical none, light, medium, or strong
- `temperature_c` (number): Temperature in °C used for scoring
- `wbc_ul` (number): Normalized WBC in cells/µL used for scoring
- `wbc_10e9_l` (number): WBC converted to ×10^9/L (wbc_ul / 1000) for Andersson 2008 bands
- `neutrophil_percent` (number): Neutrophil percent used for scoring
- `crp_mg_l` (number): CRP in mg/L used for scoring (not mg/dL)
- `components` (array): Per-factor AIR points
- `citation` (object): Andersson 2008 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "vomiting",
      "points": 0,
      "present": false
    },
    {
      "factor": "rif_pain",
      "points": 0,
      "present": false
    },
    {
      "value": "none",
      "factor": "rebound_or_guarding",
      "points": 0,
      "present": false
    },
    {
      "value": 37.0,
      "factor": "temperature_c",
      "points": 0,
      "present": false
    },
    {
      "value": 8.0e3,
      "factor": "wbc",
      "points": 0,
      "present": false
    },
    {
      "value": 60.0,
      "factor": "neutrophil_percent",
      "points": 0,
      "present": false
    },
    {
      "value": 5.0,
      "factor": "crp_mg_l",
      "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": "Andersson M, Andersson RE",
    "doi": "10.1007/s00268-008-9649-y",
    "id": "andersson-2008",
    "pmid": "18553045",
    "source": "World J Surg. 2008;32(8):1843-1849",
    "title": "The appendicitis inflammatory response score: a tool for the diagnosis of acute appendicitis that outperforms the Alvarado score"
  },
  "formula": "air",
  "formula_expression": "AIR = vomiting + rif_pain + rebound_or_guarding (none 0, light 1, medium 2, strong 3) + (temperature_c >= 38.5) + WBC 10^9/L (<10 → 0; 10.0–14.9 → 1; ≥15.0 → 2) + neutrophil_percent (<70 → 0; 70–84 → 1; ≥85 → 2) + crp_mg_l (<10 → 0; 10–49 → 1; ≥50 → 2); max 12; bands 0-4 / 5-8 / 9-12",
  "max_score": 12,
  "score": 0,
  "neutrophil_percent": 60.0,
  "temperature_c": 37.0,
  "wbc_ul": 8.0e3,
  "air_band": "0-4",
  "crp_mg_l": 5.0,
  "rebound_or_guarding": "none",
  "rif_pain": false,
  "vomiting": false,
  "wbc_10e9_l": 8.0
}
```

## Errors

- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_air_rebound`: rebound_or_guarding must be none, light, medium, or strong (Andersson 2008 AIR). Returned before settlement; you are not charged.
- HTTP 400 `invalid_temperature`: temperature_c must be a number from 30.0 to 45.0. Returned before settlement; you are not charged.
- HTTP 400 `invalid_wbc`: wbc_k_ul (0.01-500) or wbc_ul (10-500000) is required Returned before settlement; you are not charged.
- HTTP 400 `invalid_neutrophil_percent`: neutrophil_percent must be a number from 0 to 100 Returned before settlement; you are not charged.
- HTTP 400 `invalid_crp`: crp_mg_l must be a number from 0 to 500. 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

- [Alvarado score](https://magentlab.com/docs/alvarado) — Compute the Alvarado 1986 MANTRELS score from caller-assigned findings, temperature, WBC, and neutrophil percent.
- [Pediatric appendicitis score](https://magentlab.com/docs/pas) — Compute the Samuel 2002 pediatric appendicitis score from eight caller-assigned findings in children aged 4-15.

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