# sPESI Calculator (Simplified Pulmonary Embolism Severity Index)

> sPESI Calculator (Simplified 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-09-15).

Computes the sPESI score (0–6) for a patient with confirmed acute pulmonary embolism, classifying them as low risk (score 0) or high risk (score ≥1) per Jiménez 2010.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/spesi
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spesi-calculator-simplified-pulmonary-embolism-severity-index-d47f84d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OjtTLY4tSA4r2raWx12ji

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 spesi-calculator-simplified-pulmonary-embolism-severity-index-d47f84d2
```

Example prompt: Calculate the sPESI score for a patient with confirmed acute PE: age 83, active cancer, no chronic cardiopulmonary disease, heart rate 115 bpm, systolic BP 105 mmHg, and SpO2 88%.

## When to prefer this

Use this endpoint when you need a deterministic, published sPESI calculation per Jiménez 2010 for a patient with already-confirmed acute PE. Prefer it over manual rule application when building clinical decision-support pipelines, EHR integrations, or audit tools that require reproducible, citable risk stratification. Do not use it for PE diagnosis, outpatient treatment decisions, or when the original multi-class PESI score is required.

## Known failure modes

- Missing required query parameters (age, cancer, chronic_cardiopulmonary_disease, heart_rate_bpm, systolic_mm_hg, spo2_percent) returns a 400 error
- Age outside 18–120 range or heart rate outside 30–220 range returns a validation error
- SpO2 outside 50–100 or systolic BP outside 50–250 returns a validation error
- Non-integer age or heart_rate_bpm values may fail schema validation
- Payment not provided or invalid x402 payment header returns 402 Payment Required

## How this service works

sPESI (simplified Pulmonary Embolism Severity Index) from Jiménez 2010: 1 point each for age >80, cancer, chronic cardiopulmonary disease (one combined item), heart rate ≥110, systolic BP <100 mm Hg, and SpO2 <90%; max 6. Score 0 is low risk; ≥1 is high risk. Only for already diagnosed acute PE as in the paper. Not a diagnosis, not an outpatient-treatment protocol, and not original PESI classes.

## Output

Returns an integer sPESI score from 0 to 6 reflecting the sum of applicable risk points, a binary risk classification (low risk if score is 0, high risk if score is ≥1), and the individual point contributions for each of the six criteria (age >80, cancer, chronic cardiopulmonary disease, HR ≥110, systolic BP <100, SpO2 <90%).

## 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",
      "cancer",
      "chronic_cardiopulmonary_disease",
      "heart_rate_bpm",
      "systolic_mm_hg",
      "spo2_percent"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). Scores 1 when age >80; 80 does not score."
      },
      "cancer": {
       "type": "boolean",
       "description": "Active cancer as assigned by the caller. true or false. 1 point if true."
      },
      "spo2_percent": {
       "type": "number",
       "description": "Oxygen saturation percent (50-100). Scores 1 when <90; 90 does not score."
      },
      "heart_rate_bpm": {
       "type": "integer",
       "description": "Heart rate in beats per minute (integer 30-220). Scores 1 when ≥110; 109 does not score."
      },
      "systolic_mm_hg": {
       "type": "number",
       "description": "Systolic blood pressure in mm Hg (50-250). Scores 1 when <100; 100 does not score."
      },
      "chronic_cardiopulmonary_disease": {
       "type": "boolean",
       "description": "Chronic cardiopulmonary disease as one combined flag (heart failure and chronic lung disease were combined in Jiménez 2010). true or false. 1 point if true."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/spesi",
  "count": 2,
  "items": [
   {
    "score": 0,
    "formula": "spesi",
    "citation": {
     "id": "jimenez-2010",
     "doi": "10.1001/archinternmed.2010.199",
     "title": "Simplification of the pulmonary embolism severity index for prognostication in patients with acute symptomatic pulmonary embolism",
     "source": "Arch Intern Med. 2010;170(15):1383-1389",
     "authors": "Jiménez D, Aujesky D, Moores L, et al."
    },
    "age_years": 70,
    "max_score": 6,
    "components": [
     {
      "value": 70,
      "factor": "age_gt_80",
      "points": 0,
      "present": false
     },
     {
      "factor": "cancer",
      "points": 0,
      "present": false
     },
     {
      "factor": "chronic_cardiopulmonary_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": 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.",
    "spesi_risk": "low",
    "formula_expression": "sPESI = age_gt_80 + cancer + chronic_cardiopulmonary_disease + heart_rate_ge_110 + systolic_mm_hg_lt_100 + spo2_lt_90; each 1 if present; max 6; 0 low, >=1 high"
   },
   {
    "score": 0,
    "formula": "spesi",
    "citation": {
     "id": "jimenez-2010",
     "doi": "10.1001/archinternmed.2010.199",
     "title": "Simplification of the pulmonary embolism severity index for prognostication in patients with acute symptomatic pulmonary embolism",
     "source": "Arch Intern Med. 2010;170(15):1383-1389",
     "authors": "Jiménez D, Aujesky D, Moores L, et al."
    },
    "age_years": 70,
    "max_score": 6,
    "components": [
     {
      "value": 70,
      "factor": "age_gt_80",
      "points": 0,
      "present": false
     },
     {
      "factor": "cancer",
      "points": 0,
      "present": false
     },
     {
      "factor": "chronic_cardiopulmonary_disease",
      "points": 0,
      "present": false
     },
     {
      "value": 80,
      "factor": "heart_rate_ge_110",
      "points": 0,
      "present": false
     },
     
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spesi-calculator-simplified-pulmonary-embolism-severity-index-d47f84d2/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)
