# Westley Croup Score Calculator

> Westley Croup Score Calculator 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 Westley 1978 croup severity score (0–17) from five caller-assigned clinical signs: consciousness, cyanosis, stridor, air entry, and retractions.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/westley_croup
- 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/westley-croup-score-calculator-bb9fd8ed
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VElua4R3Q2nBUYE_vI9m1

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 westley-croup-score-calculator-bb9fd8ed
```

Example prompt: Calculate the Westley croup score for a child with normal consciousness (0), no cyanosis (0), stridor at rest (2), markedly decreased air entry (2), and moderate retractions (2).

## When to prefer this

Use this endpoint when you need a deterministic, published Westley 1978 croup score computed from five discrete clinical signs. Prefer it over general LLM-based clinical reasoning when you need a reproducible, citable numeric score for documentation, triage, or decision support pipelines in pediatric respiratory assessment.

## Known failure modes

- Missing required query parameters (consciousness, cyanosis, stridor, air_entry, retractions) returns a validation error
- Out-of-range integer values (e.g. cyanosis=3 or stridor=5) may return an error or undefined behavior
- Payment failure via x402 protocol results in a 402 response before computation
- Network timeout returns no score

## How this service works

Westley 1978 croup score from five caller-assigned signs (consciousness 0/5, cyanosis 0/4/5, stridor 0-2, air entry 0-2, retractions 0-3; max 17). Deterministic published score with citation. Not a diagnosis; magent does not invent total-score severity bands.

## Output

Returns the computed Westley croup total score (integer 0–17) derived from the five caller-assigned component values, along with the original Westley 1978 citation. Does not provide diagnosis or severity-band labels beyond the published score.

## 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": [
      "consciousness",
      "cyanosis",
      "stridor",
      "air_entry",
      "retractions"
     ],
     "properties": {
      "stridor": {
       "type": "integer",
       "description": "Stridor: 0 none, 1 with agitation, 2 at rest. Caller-assigned."
      },
      "cyanosis": {
       "type": "integer",
       "description": "Cyanosis: 0 none, 4 with agitation, 5 at rest. Caller-assigned."
      },
      "air_entry": {
       "type": "integer",
       "description": "Air entry: 0 normal, 1 decreased, 2 markedly decreased. Caller-assigned."
      },
      "retractions": {
       "type": "integer",
       "description": "Chest-wall retractions: 0 none, 1 mild, 2 moderate, 3 severe. Caller-assigned."
      },
      "consciousness": {
       "type": "integer",
       "description": "Westley 1978 level of consciousness: 0 normal, 5 disoriented. Caller-assigned."
      }
     }
    }
   },
   "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/westley_croup",
  "count": 2,
  "items": [
   {
    "score": 2,
    "formula": "westley_croup",
    "stridor": 1,
    "citation": {
     "id": "westley-1978",
     "doi": "10.1001/archpedi.1978.02120300044006",
     "title": "Nebulized racemic epinephrine by IPPB for the treatment of croup: a double-blind study",
     "source": "Am J Dis Child. 1978;132(5):484-487",
     "authors": "Westley CR, Cotton EK, Brooks JG"
    },
    "cyanosis": 0,
    "air_entry": 0,
    "max_score": 17,
    "components": [
     {
      "factor": "consciousness",
      "points": 0,
      "present": false
     },
     {
      "factor": "cyanosis",
      "points": 0,
      "present": false
     },
     {
      "factor": "stridor",
      "points": 1,
      "present": true
     },
     {
      "factor": "air_entry",
      "points": 0,
      "present": false
     },
     {
      "factor": "retractions",
      "points": 1,
      "present": true
     }
    ],
    "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.",
    "retractions": 1,
    "consciousness": 0,
    "formula_expression": "Westley = consciousness + cyanosis + stridor + air_entry + retractions; max 17"
   },
   {
    "score": 2,
    "formula": "westley_croup",
    "stridor": 1,
    "citation": {
     "id": "westley-1978",
     "doi": "10.1001/archpedi.1978.02120300044006",
     "title": "Nebulized racemic epinephrine by IPPB for the treatment of croup: a double-blind study",
     "source": "Am J Dis Child. 1978;132(5):484-487",
     "authors": "Westley CR, Cotton EK, Brooks JG"
    },
    "cyanosis": 0,
    "air_entry": 0,
    "max_score": 17,
    "components": [
     {
      "factor": "consciousness",
      "points": 0,
      "present": false
     },
     {
      "factor": "cyanosis",
      "points": 0,
      "present": false
     },
     {
      "factor": "stridor",
      "points": 1,
      "present": true
     },
     {
      "factor": "air_entry",
      "points": 0,
      "present": false
     },
     {
      "factor": "retractions",
      "points": 1,
      "present": true
     }
    ],
    "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.",
    "retractions": 1,
    "con
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/westley-croup-score-calculator-bb9fd8ed/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)
