# BAP-65 COPD Exacerbation Risk Classifier

> BAP-65 COPD Exacerbation Risk Classifier 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 BAP-65 class (I–V) for acute exacerbation of COPD using three binary clinical flags and age

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/bap_65
- 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/bap-65-copd-exacerbation-risk-classifier-16d66eb2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-TIHDuD3kUZiobLmgVqY3

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 bap-65-copd-exacerbation-risk-classifier-16d66eb2
```

Example prompt: Calculate the BAP-65 class for my COPD patient: BUN is not above 25, no altered mental status, pulse is not above 109, and the patient is 68 years old.

## When to prefer this

Use this endpoint when you need a fast, stateless BAP-65 risk class for an acute COPD exacerbation and have already determined the three main clinical flags and patient age. Prefer it over manual lookup when automating triage workflows or embedding clinical scoring in agent pipelines. Not a substitute for physician judgment or a ventilation/ICU-admission order.

## Known failure modes

- Missing required boolean query parameters returns a validation error
- Passing numeric values instead of booleans for flags causes schema rejection
- Misinterpreting the age flag as an additive fourth factor (it is not) leads to incorrect class assignment by the caller
- Expecting the API to compute GCS, BUN, or pulse values — it only accepts caller-supplied boolean flags

## How this service works

BAP-65 (Tabak 2009) class I–V for acute exacerbation of COPD. Three caller-assigned main factors: BUN >25 mg/dL, altered mental status (GCS <14 or disoriented/stupor/coma), and pulse >109/min. Age >65 splits class I from II only when zero main factors are present; age is not a fourth additive point. magent does not compute GCS, BUN, or pulse. Not a medical device and not a ventilation or ICU-admission order.

## Output

Returns the BAP-65 class (I through V) based on the three main factors (BUN >25, altered mental status, pulse >109) and age >65. Class I is lowest risk; class V is highest. Age >65 is used only to differentiate class I from II when all three main factors are absent.

## 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": [
      "bun_gt_25",
      "altered_mental_status",
      "pulse_gt_109",
      "age_gt_65"
     ],
     "properties": {
      "age_gt_65": {
       "type": "boolean",
       "description": "Age >65 years (strict greater than). Used only when zero of the three main factors are present, to split class I from II. true or false as assigned by the caller. magent does not compute age."
      },
      "bun_gt_25": {
       "type": "boolean",
       "description": "BUN >25 mg/dL (strict greater than; 25 does not meet). true or false as assigned by the caller. magent does not compute BUN."
      },
      "pulse_gt_109": {
       "type": "boolean",
       "description": "Pulse >109/min (strict greater than; 109 does not meet). true or false as assigned by the caller. magent does not compute pulse."
      },
      "altered_mental_status": {
       "type": "boolean",
       "description": "GCS <14 or physician designation of disoriented, stupor, or coma (Tabak 2009). true or false as assigned by the caller. magent does not compute GCS."
      }
     }
    }
   },
   "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/bap_65",
  "count": 2,
  "items": [
   {
    "formula": "bap_65",
    "citation": {
     "id": "tabak-2009",
     "doi": "10.1001/archinternmed.2009.270",
     "pmid": "19786679",
     "title": "Mortality and need for mechanical ventilation in acute exacerbations of chronic obstructive pulmonary disease: development and validation of a simple risk score",
     "source": "Arch Intern Med. 2009;169(17):1595-1602",
     "authors": "Tabak YP, Sun X, Johannes RS, Gupta V, Shorr AF"
    },
    "criteria": [
     {
      "met": false,
      "factor": "bun_gt_25"
     },
     {
      "met": false,
      "factor": "altered_mental_status"
     },
     {
      "met": false,
      "factor": "pulse_gt_109"
     },
     {
      "met": false,
      "factor": "age_gt_65"
     }
    ],
    "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.",
    "bap65_class": "I",
    "main_factor_count": 0,
    "formula_expression": "class I = 0 main factors and age ≤65; II = 0 main factors and age >65; III = 1 main factor; IV = 2 main factors; V = 3 main factors (BUN >25 mg/dL, GCS <14 or disoriented/stupor/coma, pulse >109/min); age is not a 4th additive point"
   },
   {
    "formula": "bap_65",
    "citation": {
     "id": "tabak-2009",
     "doi": "10.1001/archinternmed.2009.270",
     "pmid": "19786679",
     "title": "Mortality and need for mechanical ventilation in acute exacerbations of chronic obstructive pulmonary disease: development and validation of a simple risk score",
     "source": "Arch Intern Med. 2009;169(17):1595-1602",
     "authors": "Tabak YP, Sun X, Johannes RS, Gupta V, Shorr AF"
    },
    "criteria": [
     {
      "met": false,
      "factor": "bun_gt_25"
     },
     {
      "met": false,
      "factor": "altered_mental_status"
     },
     {
      "met": false,
      "factor": "pulse_gt_109"
     },
     {
      "met": false,
      "factor": "age_gt_65"
     }
    ],
    "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.",
    "bap65_class": "I",
    "main_factor_count": 0,
    "formula_expression": "class I = 0 main factors and age ≤65; II = 0 main factors and age >65; III = 1 main factor; IV = 2 main factors;
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bap-65-copd-exacerbation-risk-classifier-16d66eb2/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)
