# PESI Calculator (Pulmonary Embolism Severity Index)

> PESI Calculator (Pulmonary Embolism Severity Index) is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-12).

Computes the Pulmonary Embolism Severity Index (PESI) score and risk class (I–V) for a patient with confirmed PE, based on Aujesky 2005 criteria.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/pesi?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pesi-calculator-pulmonary-embolism-severity-index-e8fb0c42
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wvv6Ri2Vq50UmvftOAOkN

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability pesi-calculator-pulmonary-embolism-severity-index-e8fb0c42
```

Example prompt: Calculate the PESI score for a 68-year-old male with confirmed PE — he has cancer and heart failure, heart rate is 115 bpm, blood pressure is 95 mm Hg systolic, respiratory rate is 28, temperature is 36.8°C, SpO2 is 92%, no altered mental status, and no chronic lung disease.

## When to prefer this

Use this endpoint when you need to compute the classic Aujesky 2005 PESI score (11 variables, no labs) for a patient with an already-confirmed pulmonary embolism diagnosis. Prefer this over sPESI when full PESI granularity is required or when institutional protocols specify Aujesky 2005 criteria. Do not use for PE diagnosis, outpatient disposition protocols, or when the simplified 6-variable sPESI is required.

## Known failure modes

- Missing required parameters (age, sex, vitals, comorbidities) returns a validation error
- Out-of-range values (e.g. age <18 or >120, SpO2 <50 or >100) are rejected
- Using this for PE diagnosis rather than post-diagnosis stratification is a clinical misuse — the API computes only; clinical judgment is required
- Confusing this with sPESI (simplified PESI) or the 17-variable laboratory model will yield different risk classes
- Payment failure (402) if x402 micropayment is not completed

## How this service works

Deterministic published-formula arithmetic plus ICD-10-CM, RxNorm, and LOINC. Pay in USDC on Base via x402.

## Output

Returns the total PESI integer score and corresponding risk class (Class I ≤65 through Class V >125), reflecting 30-day mortality risk for patients with confirmed pulmonary embolism.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "age",
      "sex",
      "cancer",
      "heart_failure",
      "chronic_lung_disease",
      "heart_rate_bpm",
      "systolic_mm_hg",
      "respiratory_rate",
      "temperature_c",
      "altered_mentation",
      "spo2_percent"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). Adds 1 point per year (the age integer itself)."
      },
      "sex": {
       "type": "string",
       "description": "Sex (female or male). Male scores +10."
      },
      "cancer": {
       "type": "boolean",
       "description": "Cancer as assigned by the caller. true or false. +30 if true."
      },
      "spo2_percent": {
       "type": "number",
       "description": "Arterial oxygen saturation percent (50-100). Scores +20 when <90; 90 does not score."
      },
      "heart_failure": {
       "type": "boolean",
       "description": "Heart failure as assigned by the caller (separate from chronic lung disease). true or false. +10 if true."
      },
      "temperature_c": {
       "type": "number",
       "description": "Temperature in °C (30-45). Scores +20 when <36; 36.0 does not score."
      },
      "heart_rate_bpm": {
       "type": "integer",
       "description": "Heart rate in beats per minute (integer 30-220). Scores +20 when ≥110; 109 does not score."
      },
      "systolic_mm_hg": {
       "type": "number",
       "description": "Systolic blood pressure in mm Hg (50-250). Scores +30 when <100; 100 does not score."
      },
      "respiratory_rate": {
       "type": "integer",
       "description": "Respiratory rate in breaths/min (integer 4-80). Scores +20 when ≥30; 29 does not score."
      },
      "altered_mentation": {
       "type": "boolean",
       "description": "Altered mental status as assigned by the caller. true or false. +60 if true."
      },
      "chronic_lung_disease": {
       "type": "boolean",
       "d
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/pesi",
  "count": 2,
  "items": [
   {
    "score": 50,
    "formula": "pesi",
    "citation": {
     "id": "aujesky-2005",
     "doi": "10.1164/rccm.200506-862OC",
     "title": "Derivation and validation of a prognostic model for pulmonary embolism",
     "source": "Am J Respir Crit Care Med. 2005;172(8):1041-1046",
     "authors": "Aujesky D, Obrosky DS, Stone RA, et al."
    },
    "age_years": 50,
    "components": [
     {
      "value": 50,
      "factor": "age",
      "points": 50,
      "present": true
     },
     {
      "value": "female",
      "factor": "male_sex",
      "points": 0,
      "present": false
     },
     {
      "factor": "cancer",
      "points": 0,
      "present": false
     },
     {
      "factor": "heart_failure",
      "points": 0,
      "present": false
     },
     {
      "factor": "chronic_lung_disease",
      "points": 0,
      "present": false
     },
     {
      "value": 80,
      "factor": "heart_rate_ge_110",
      "points": 0,
      "present": false
     },
     {
      "value": 120,
      "factor": "systolic_mm_hg_lt_100",
      "points": 0,
      "present": false
     },
     {
      "value": 16,
      "factor": "respiratory_rate_ge_30",
      "points": 0,
      "present": false
     },
     {
      "value": 37,
      "factor": "temperature_lt_36",
      "points": 0,
      "present": false
     },
     {
      "factor": "altered_mentation",
      "points": 0,
      "present": false
     },
     {
      "value": 96,
      "factor": "spo2_lt_90",
      "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.",
    "pesi_class": "I",
    "formula_expression": "PESI = age_in_years + 10*male + 30*cancer + 10*heart_failure + 10*chronic_lung_disease + 20*(HR>=110) + 30*(SBP<100) + 20*(RR>=30) + 20*(temp<36) + 60*altered_mentation + 20*(SpO2<90); classes I <=65, II 66-85, III 86-105, IV 106-125, V >125"
   },
   {
    "score": 50,
    "formula": "pesi",
    "citation": {
     "id": "aujesky-2005",
     "doi": "10.1164/rccm.200506-862OC",
     "title": "Derivation and validation of a prognostic model for pulmonary embolism",
     "source": "Am J Respir Crit Care Med. 2005;172(8):1041-1046",
     "authors": "Aujesky D, Obrosky DS, Stone RA, et al."
    },
    "age_years": 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pesi-calculator-pulmonary-embolism-severity-index-e8fb0c42/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
