# CIRC (Garibaldi 2020)

CIRC (Garibaldi 2020)

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

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

## What it computes

Compute Garibaldi 2020 CIRC probabilities of progression to severe disease or death at hospital days 2, 4, and 7 from admission age, nursing-home residence, caller-assigned race term, Charlson CCI, BMI, symptoms, vitals, and listed laboratories using Appendix Table 1 coefficients on the published reference-patient cumulative incidences.

## When to use

When an agent already has the Appendix Table 1 admission profile assigned and needs the printed CIRC day-2/4/7 probabilities, not 4C, VACO, or COVID-GRAM, and not the death-only Appendix Table 2 model.

## When not to use

- Not a medical device and not a diagnosis. Not a triage, treatment, isolation, or disposition order.
- magent does not assign race. The Non-White vs White term is caller-assigned as published; magent does not determine race or ethnicity.
- magent does not assign Charlson diagnoses, read a chest film, or measure the patient. CCI, symptoms, fever, troponin detectability, and the D-dimer threshold flag are caller-assigned.
- This tool applies Appendix Table 1 estimates to the printed reference cumulative incidences (day 2 10%, day 4 13%, day 7 15%). The competing-risk discharge Cox coefficients were not printed and are not used. Not the Appendix Table 2 death-only model.

## Formula

```
delta = lp(x) - lp(x0); P(t) = 1-(1-P0(t))^exp(delta); Garibaldi 2020 Appendix Table 1 estimates; x0 White female age 60-74 not from a nursing home BMI 30 CCI 0 no symptoms no fever pulse 85 RR 21 leukocyte 6.8 ALC 1.0 ALT 30 albumin 3.7 GFR 71 CRP 5.7 hemoglobin 12.9 ferritin 545 troponin not detectable D-dimer not >1; P0 day2 0.10 day4 0.13 day7 0.15; age<60 -0.61 age>=75 -0.71; NH <75 -0.24 >=75 -0.22; male <60 0.31 60-74 -0.47 >=75 0.10; BMI per 5 0.17; Non-White vs White 0.08 (caller-assigned); CCI per 1 <60 0.19 60-74 -0.23 >=75 0.14; respiratory 0.81 GI -0.14 constitutional -0.57 taste/smell -0.30 fever>38.0 0.56; pulse per 10 -0.02; RR linear spline knot 18: <18 per unit -0.25, >=18 per unit 0.13; ln leukocyte -0.06 ln ALC -0.29 ln ALT 0.02; hemoglobin per 1 g/dL decrease 0.04; albumin per 0.5 g/dL decrease below 4 0.23; GFR per 10 -0.03; ln CRP 0.20 ln ferritin 0.11; troponin detectable <60 0.19 60-74 1.36 >=75 0.35; D-dimer >1 0.24; natural log; not Appendix Table 2 death-only; discharge competing-risk coefficients were not printed
```

## Citation

[Patient Trajectories Among Persons Hospitalized for COVID-19: A Cohort Study](https://doi.org/10.7326/M20-3905)
Garibaldi BT, Fiksel J, Muschelli J, et al.
Ann Intern Med. 2021;174(1):33-41
DOI: [10.7326/M20-3905](https://doi.org/10.7326/M20-3905)

## Worked example

### Appendix Table 1 reference patient

Given: `age=65, albumin_g_dl=3.7, alt_u_l=30, bmi=30, cci=0, constitutional_symptoms=false, crp_mg_dl=5.7, d_dimer_gt_1=false, ferritin_ng_ml=545, fever=false, gastrointestinal_symptoms=false, gfr=71, hemoglobin_g_dl=12.9, leukocyte_k=6.8, loss_of_taste_smell=false, lymphocyte_k=1.0, nursing_home=false, pulse=85, race=white, respiratory_rate=21, respiratory_symptoms=false, sex=female, troponin_detectable=false`

1. White female, age 65 (60-74), not from a nursing home, BMI 30, CCI 0, no symptoms, no fever, pulse 85, RR 21, leukocyte 6.8, ALC 1.0, ALT 30, hemoglobin 12.9, albumin 3.7, GFR 71, CRP 5.7, ferritin 545, troponin not detectable, D-dimer not >1
2. delta = 0 versus the published reference linear predictor
3. day-2/4/7 percents equal the printed reference cumulative incidences 10%, 13%, and 15%


### Reference patient with fever >38.0 C

Given: `age=65, albumin_g_dl=3.7, alt_u_l=30, bmi=30, cci=0, constitutional_symptoms=false, crp_mg_dl=5.7, d_dimer_gt_1=false, ferritin_ng_ml=545, fever=true, gastrointestinal_symptoms=false, gfr=71, hemoglobin_g_dl=12.9, leukocyte_k=6.8, loss_of_taste_smell=false, lymphocyte_k=1.0, nursing_home=false, pulse=85, race=white, respiratory_rate=21, respiratory_symptoms=false, sex=female, troponin_detectable=false`

1. Same Appendix Table 1 reference profile except fever true adds 0.56
2. delta = 0.56; P(t) = 1-(1-P0(t))^exp(0.56)


## Also searched as

- CIRC
- Garibaldi 2020
- COVID-19 Inpatient Risk Calculator
- inpatient severe disease risk
- admission progression CIRC
- JH CIRC day 2 4 7

## Parameters

- `age` (integer, required): Age in years (integer 18-120). Appendix Table 1 bands: <60 (term -0.61), 60-74 (reference 0), >=75 (term -0.71). Derivation excluded ages under 18.
- `sex` (string, required): Sex as assigned by the caller. female is the Appendix Table 1 reference (0). male adds 0.31 if age<60, -0.47 if age 60-74, 0.10 if age>=75. magent does not assign sex.
- `race` (string, required): Caller-assigned Garibaldi 2020 paper term Non-White race vs White race. white is the reference (0). nonwhite adds 0.08. magent does not assign race.
- `nursing_home` (boolean, required): Admitted from a nursing home as assigned by the caller. false is the reference (0). true adds -0.24 if age<75, -0.22 if age>=75.
- `bmi` (number, required): Body mass index in kg/m2 (10-80). Appendix Table 1: 0.17 per increment of 5 kg/m2 versus the reference BMI of 30. obesity in the response is BMI >= 30.
- `cci` (integer, required): Caller-assigned Charlson comorbidity index (integer 0-37). Appendix Table 1 per 1-point: 0.19 if age<60, -0.23 if age 60-74, 0.14 if age>=75. Reference CCI 0. magent does not assign Charlson diagnoses.
- `respiratory_symptoms` (boolean, required): Respiratory symptoms present vs absent as assigned by the caller. false is the reference. true adds 0.81.
- `gastrointestinal_symptoms` (boolean, required): Gastrointestinal symptoms present vs absent as assigned by the caller. false is the reference. true adds -0.14.
- `constitutional_symptoms` (boolean, required): Constitutional symptoms present vs absent as assigned by the caller. false is the reference. true adds -0.57.
- `loss_of_taste_smell` (boolean, required): Loss of taste and smell present vs absent as assigned by the caller. false is the reference. true adds -0.30.
- `fever` (boolean, required): Temperature >38.0 C within 24 hours of admission as assigned by the caller. false is the reference. true adds 0.56.
- `pulse` (number, required): Pulse in beats/min (30-220). Appendix Table 1: -0.02 per increment of 10 versus the reference pulse of 85.
- `respiratory_rate` (number, required): Respiratory rate in breaths/min (6-60). Appendix Table 1 linear spline with knot at 18: -0.25 per unit below 18, 0.13 per unit at or above 18. Reference RR 21.
- `leukocyte_k` (number, required): Leukocyte count in K cells/mm3 (0.5-100). Appendix Table 1: -0.06 times the natural log. Reference 6.8.
- `lymphocyte_k` (number, required): Absolute lymphocyte count in K cells/mm3 (0.1-10). Appendix Table 1: -0.29 times the natural log. Reference 1.0.
- `alt_u_l` (number, required): Alanine aminotransferase in U/L (1-2000). Appendix Table 1: 0.02 times the natural log. Reference 30.0.
- `hemoglobin_g_dl` (number, required): Hemoglobin in g/dL (4-20). Appendix Table 1: 0.04 per 1-point decrease versus the reference 12.9 g/dL.
- `albumin_g_dl` (number, required): Albumin in g/dL (1-6). Appendix Table 1: 0.23 per 0.5 g/dL decrease below 4 g/dL (no term when albumin >= 4). Reference 3.7.
- `gfr` (number, required): GFR in mL/min per 1.73 m2 (5-150). Appendix Table 1: -0.03 per increase of 10 versus the reference 71.
- `crp_mg_dl` (number, required): C-reactive protein in mg/dL (0.1-50). Appendix Table 1: 0.20 times the natural log. Reference 5.7.
- `ferritin_ng_ml` (number, required): Ferritin in ng/mL (10-20000). Appendix Table 1: 0.11 times the natural log. Reference 545.
- `troponin_detectable` (boolean, required): Detectable troponin vs not as assigned by the caller. false is the reference. true adds 0.19 if age<60, 1.36 if age 60-74, 0.35 if age>=75.
- `d_dimer_gt_1` (boolean, required): D-dimer above the Appendix Table 1 threshold (>1 mg/dL FEU) as assigned by the caller. false is the reference. true adds 0.24.

## 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/circ`
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": "65",
      "albumin_g_dl": "3.7",
      "alt_u_l": "30",
      "bmi": "30",
      "cci": "0",
      "constitutional_symptoms": "false",
      "crp_mg_dl": "5.7",
      "d_dimer_gt_1": "false",
      "ferritin_ng_ml": "545",
      "fever": "false",
      "gastrointestinal_symptoms": "false",
      "gfr": "71",
      "hemoglobin_g_dl": "12.9",
      "leukocyte_k": "6.8",
      "loss_of_taste_smell": "false",
      "lymphocyte_k": "1.0",
      "nursing_home": "false",
      "pulse": "85",
      "race": "white",
      "respiratory_rate": "21",
      "respiratory_symptoms": "false",
      "sex": "female",
      "troponin_detectable": "false"
    },
    {
      "age": "65",
      "albumin_g_dl": "3.7",
      "alt_u_l": "30",
      "bmi": "30",
      "cci": "0",
      "constitutional_symptoms": "false",
      "crp_mg_dl": "5.7",
      "d_dimer_gt_1": "false",
      "ferritin_ng_ml": "545",
      "fever": "false",
      "gastrointestinal_symptoms": "false",
      "gfr": "71",
      "hemoglobin_g_dl": "12.9",
      "leukocyte_k": "6.8",
      "loss_of_taste_smell": "false",
      "lymphocyte_k": "1.0",
      "nursing_home": "false",
      "pulse": "85",
      "race": "white",
      "respiratory_rate": "21",
      "respiratory_symptoms": "false",
      "sex": "female",
      "troponin_detectable": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/circ",
  "items": [
    {
      "formula_expression": "delta = lp(x) - lp(x0); P(t) = 1-(1-P0(t))^exp(delta); Garibaldi 2020 Appendix Table 1 estimates; x0 White female age 60-74 not from a nursing home BMI 30 CCI 0 no symptoms no fever pulse 85 RR 21 leukocyte 6.8 ALC 1.0 ALT 30 albumin 3.7 GFR 71 CRP 5.7 hemoglobin 12.9 ferritin 545 troponin not detectable D-dimer not >1; P0 day2 0.10 day4 0.13 day7 0.15; age<60 -0.61 age>=75 -0.71; NH <75 -0.24 >=75 -0.22; male <60 0.31 60-74 -0.47 >=75 0.10; BMI per 5 0.17; Non-White vs White 0.08 (caller-assigned); CCI per 1 <60 0.19 60-74 -0.23 >=75 0.14; respiratory 0.81 GI -0.14 constitutional -0.57 taste/smell -0.30 fever>38.0 0.56; pulse per 10 -0.02; RR linear spline knot 18: <18 per unit -0.25, >=18 per unit 0.13; ln leukocyte -0.06 ln ALC -0.29 ln ALT 0.02; hemoglobin per 1 g/dL decrease 0.04; albumin per 0.5 g/dL decrease below 4 0.23; GFR per 10 -0.03; ln CRP 0.20 ln ferritin 0.11; troponin detectable <60 0.19 60-74 1.36 >=75 0.35; D-dimer >1 0.24; natural log; not Appendix Table 2 death-only; discharge competing-risk coefficients were not printed",
      "bmi": 30.0,
      "crp_mg_dl": 5.7,
      "constitutional_symptoms": false,
      "loss_of_taste_smell": false,
      "race": "white",
      "day_4_percent": 13.0,
      "nursing_home": false,
      "albumin_g_dl": 3.7,
      "respiratory_symptoms": false,
      "leukocyte_k": 6.8,
      "fever": 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.",
      "gfr": 71.0,
      "sex": "female",
      "citation": {
        "authors": "Garibaldi BT, Fiksel J, Muschelli J, et al.",
        "doi": "10.7326/M20-3905",
        "id": "garibaldi-2020-circ",
        "pmid": "32960645",
        "source": "Ann Intern Med. 2021;174(1):33-41",
        "title": "Patient Trajectories Among Persons Hospitalized for COVID-19: A Cohort Study"
      },
      "day_7_percent": 15.0,
      "lymphocyte_k": 1.0,
      "day_2_percent": 10.0,
      "alt_u_l": 30.0,
      "hemoglobin_g_dl": 12.9,
      "pulse": 85.0,
      "gastrointestinal_symptoms": false,
      "age": 65,
      "formula": "circ",
      "logit_delta": 0.0,
      "respiratory_rate": 21.0,
      "cci": 0,
      "obesity": true,
      "ferritin_ng_ml": 545.0,
      "troponin_detectable": false,
      "age_band": "60_74",
      "d_dimer_gt_1": false
    },
    {
      "formula_expression": "delta = lp(x) - lp(x0); P(t) = 1-(1-P0(t))^exp(delta); Garibaldi 2020 Appendix Table 1 estimates; x0 White female age 60-74 not from a nursing home BMI 30 CCI 0 no symptoms no fever pulse 85 RR 21 leukocyte 6.8 ALC 1.0 ALT 30 albumin 3.7 GFR 71 CRP 5.7 hemoglobin 12.9 ferritin 545 troponin not detectable D-dimer not >1; P0 day2 0.10 day4 0.13 day7 0.15; age<60 -0.61 age>=75 -0.71; NH <75 -0.24 >=75 -0.22; male <60 0.31 60-74 -0.47 >=75 0.10; BMI per 5 0.17; Non-White vs White 0.08 (caller-assigned); CCI per 1 <60 0.19 60-74 -0.23 >=75 0.14; respiratory 0.81 GI -0.14 constitutional -0.57 taste/smell -0.30 fever>38.0 0.56; pulse per 10 -0.02; RR linear spline knot 18: <18 per unit -0.25, >=18 per unit 0.13; ln leukocyte -0.06 ln ALC -0.29 ln ALT 0.02; hemoglobin per 1 g/dL decrease 0.04; albumin per 0.5 g/dL decrease below 4 0.23; GFR per 10 -0.03; ln CRP 0.20 ln ferritin 0.11; troponin detectable <60 0.19 60-74 1.36 >=75 0.35; D-dimer >1 0.24; natural log; not Appendix Table 2 death-only; discharge competing-risk coefficients were not printed",
      "bmi": 30.0,
      "crp_mg_dl": 5.7,
      "constitutional_symptoms": false,
      "loss_of_taste_smell": false,
      "race": "white",
      "day_4_percent": 13.0,
      "nursing_home": false,
      "albumin_g_dl": 3.7,
      "respiratory_symptoms": false,
      "leukocyte_k": 6.8,
      "fever": 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.",
      "gfr": 71.0,
      "sex": "female",
      "citation": {
        "authors": "Garibaldi BT, Fiksel J, Muschelli J, et al.",
        "doi": "10.7326/M20-3905",
        "id": "garibaldi-2020-circ",
        "pmid": "32960645",
        "source": "Ann Intern Med. 2021;174(1):33-41",
        "title": "Patient Trajectories Among Persons Hospitalized for COVID-19: A Cohort Study"
      },
      "day_7_percent": 15.0,
      "lymphocyte_k": 1.0,
      "day_2_percent": 10.0,
      "alt_u_l": 30.0,
      "hemoglobin_g_dl": 12.9,
      "pulse": 85.0,
      "gastrointestinal_symptoms": false,
      "age": 65,
      "formula": "circ",
      "logit_delta": 0.0,
      "respiratory_rate": 21.0,
      "cci": 0,
      "obesity": true,
      "ferritin_ng_ml": 545.0,
      "troponin_detectable": false,
      "age_band": "60_74",
      "d_dimer_gt_1": false
    }
  ]
}
```

## Response fields

- `formula` (string): circ
- `formula_expression` (string): Garibaldi 2020 Appendix Table 1 linear predictor and day-2/4/7 CIF
- `age` (integer): Input age in years
- `sex` (string): female or male
- `race` (string): white or nonwhite (caller-assigned)
- `nursing_home` (boolean): Caller-assigned nursing-home flag
- `bmi` (number): Input BMI in kg/m2
- `cci` (integer): Caller-assigned Charlson comorbidity index
- `respiratory_symptoms` (boolean): Caller-assigned respiratory-symptom flag
- `gastrointestinal_symptoms` (boolean): Caller-assigned gastrointestinal-symptom flag
- `constitutional_symptoms` (boolean): Caller-assigned constitutional-symptom flag
- `loss_of_taste_smell` (boolean): Caller-assigned loss-of-taste-and-smell flag
- `fever` (boolean): Caller-assigned fever >38.0 C flag
- `pulse` (number): Input pulse in beats/min
- `respiratory_rate` (number): Input respiratory rate in breaths/min
- `leukocyte_k` (number): Input leukocyte count in K cells/mm3
- `lymphocyte_k` (number): Input absolute lymphocyte count in K cells/mm3
- `alt_u_l` (number): Input ALT in U/L
- `hemoglobin_g_dl` (number): Input hemoglobin in g/dL
- `albumin_g_dl` (number): Input albumin in g/dL
- `gfr` (number): Input GFR in mL/min per 1.73 m2
- `crp_mg_dl` (number): Input CRP in mg/dL
- `ferritin_ng_ml` (number): Input ferritin in ng/mL
- `troponin_detectable` (boolean): Caller-assigned detectable-troponin flag
- `d_dimer_gt_1` (boolean): Caller-assigned D-dimer-above-threshold flag
- `age_band` (string): Appendix Table 1 age band used (lt_60, 60_74, ge_75)
- `obesity` (boolean): true when BMI is 30 kg/m2 or greater
- `logit_delta` (number): lp(x) minus lp of the published reference patient, 4 decimals
- `day_2_percent` (number): Severe disease or death percent by day 2, 1 decimal
- `day_4_percent` (number): Severe disease or death percent by day 4, 1 decimal
- `day_7_percent` (number): Severe disease or death percent by day 7, 1 decimal
- `citation` (object): Garibaldi 2020 CIRC citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "formula_expression": "delta = lp(x) - lp(x0); P(t) = 1-(1-P0(t))^exp(delta); Garibaldi 2020 Appendix Table 1 estimates; x0 White female age 60-74 not from a nursing home BMI 30 CCI 0 no symptoms no fever pulse 85 RR 21 leukocyte 6.8 ALC 1.0 ALT 30 albumin 3.7 GFR 71 CRP 5.7 hemoglobin 12.9 ferritin 545 troponin not detectable D-dimer not >1; P0 day2 0.10 day4 0.13 day7 0.15; age<60 -0.61 age>=75 -0.71; NH <75 -0.24 >=75 -0.22; male <60 0.31 60-74 -0.47 >=75 0.10; BMI per 5 0.17; Non-White vs White 0.08 (caller-assigned); CCI per 1 <60 0.19 60-74 -0.23 >=75 0.14; respiratory 0.81 GI -0.14 constitutional -0.57 taste/smell -0.30 fever>38.0 0.56; pulse per 10 -0.02; RR linear spline knot 18: <18 per unit -0.25, >=18 per unit 0.13; ln leukocyte -0.06 ln ALC -0.29 ln ALT 0.02; hemoglobin per 1 g/dL decrease 0.04; albumin per 0.5 g/dL decrease below 4 0.23; GFR per 10 -0.03; ln CRP 0.20 ln ferritin 0.11; troponin detectable <60 0.19 60-74 1.36 >=75 0.35; D-dimer >1 0.24; natural log; not Appendix Table 2 death-only; discharge competing-risk coefficients were not printed",
  "bmi": 30.0,
  "crp_mg_dl": 5.7,
  "constitutional_symptoms": false,
  "loss_of_taste_smell": false,
  "race": "white",
  "day_4_percent": 13.0,
  "nursing_home": false,
  "albumin_g_dl": 3.7,
  "respiratory_symptoms": false,
  "leukocyte_k": 6.8,
  "fever": 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.",
  "gfr": 71.0,
  "sex": "female",
  "citation": {
    "authors": "Garibaldi BT, Fiksel J, Muschelli J, et al.",
    "doi": "10.7326/M20-3905",
    "id": "garibaldi-2020-circ",
    "pmid": "32960645",
    "source": "Ann Intern Med. 2021;174(1):33-41",
    "title": "Patient Trajectories Among Persons Hospitalized for COVID-19: A Cohort Study"
  },
  "day_7_percent": 15.0,
  "lymphocyte_k": 1.0,
  "day_2_percent": 10.0,
  "alt_u_l": 30.0,
  "hemoglobin_g_dl": 12.9,
  "pulse": 85.0,
  "gastrointestinal_symptoms": false,
  "age": 65,
  "formula": "circ",
  "logit_delta": 0.0,
  "respiratory_rate": 21.0,
  "cci": 0,
  "obesity": true,
  "ferritin_ng_ml": 545.0,
  "troponin_detectable": false,
  "age_band": "60_74",
  "d_dimer_gt_1": false
}
```

## Errors

- HTTP 400 `invalid_circ`: CIRC inputs must match Garibaldi 2020 admission age, nursing-home residence, comorbidities, obesity, respiratory findings, and listed laboratory bands. 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

- [VACO Index](https://magentlab.com/docs/vaco) — Compute the King 2020 VACO Index 30-day all-cause mortality probability from age, sex, a caller-assigned unadjusted Charlson comorbidity index, and history of myocardial infarction or peripheral vascular disease using Supplement S3 coefficients.
- [4C](https://magentlab.com/docs/4c) — Sum the Knight 2020 ISARIC 4C Mortality Score items and return the published Table 5 band (low, intermediate, high, or very high).

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