# Ottawa SAH Rule Calculator (Perry 2013)

> Ottawa SAH Rule Calculator (Perry 2013) 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).

Applies the Ottawa Subarachnoid Hemorrhage rule to determine whether further investigation for SAH is warranted in adult patients presenting with acute headache

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/ottawa_sah
- 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/ottawa-sah-rule-calculator-perry-2013-42a6ae30
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bGS72AahyS9BbY-a33sBY

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 ottawa-sah-rule-calculator-perry-2013-42a6ae30
```

Example prompt: Run the Ottawa SAH rule for a 45-year-old patient who has neck stiffness, no witnessed loss of consciousness, no onset during exertion, no thunderclap headache, and no limited neck flexion on exam.

## When to prefer this

Use this endpoint when you need to apply the validated Ottawa SAH Rule (Perry 2013, JAMA) to alert, neurologically intact adults with nontraumatic headache peaking within one hour. Prefer this over general clinical reasoning when you need a reproducible, evidence-based binary screening result. Not suitable for Hunt-Hess grading, Fisher grade, traumatic headache, or altered mental status patients.

## Known failure modes

- Missing any required query parameter (age, neck_pain_or_stiffness, witnessed_loc, onset_during_exertion, thunderclap_headache, limited_neck_flexion) returns a validation error
- Age outside valid range (below 18 or above 120) may return an error
- Incorrect type for boolean fields (e.g. string instead of boolean) causes schema validation failure
- Payment not included or insufficient USDC balance returns 402 payment required

## How this service works

Ottawa SAH Rule (Perry 2013 JAMA). Investigate when any of six findings is present: age 40 or older, neck pain or stiffness, witnessed loss of consciousness, onset during exertion, thunderclap headache (instantly peaking pain), or limited neck flexion on examination. Not a diagnosis of SAH, not Hunt-Hess, and not Fisher grade. For alert, neurologically intact adults with nontraumatic headache peaking within 1 hour as published. magent does not examine the neck.

## Output

Returns whether the Ottawa SAH rule criteria are met and whether further investigation for subarachnoid hemorrhage is indicated, based on the six clinical findings (age ≥40, neck pain/stiffness, witnessed LOC, exertional onset, thunderclap headache, limited neck flexion). Not a diagnosis and does not replace clinical judgment.

## 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",
      "neck_pain_or_stiffness",
      "witnessed_loc",
      "onset_during_exertion",
      "thunderclap_headache",
      "limited_neck_flexion"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). Age ≥40 meets this criterion; 39 does not."
      },
      "witnessed_loc": {
       "type": "boolean",
       "description": "Witnessed loss of consciousness. true or false as assigned by the caller."
      },
      "limited_neck_flexion": {
       "type": "boolean",
       "description": "Limited neck flexion on examination as assigned by the caller. true or false. magent does not examine the neck."
      },
      "thunderclap_headache": {
       "type": "boolean",
       "description": "Thunderclap headache (instantly peaking pain as published). true or false as assigned by the caller."
      },
      "onset_during_exertion": {
       "type": "boolean",
       "description": "Onset during exertion. true or false as assigned by the caller."
      },
      "neck_pain_or_stiffness": {
       "type": "boolean",
       "description": "Neck pain or stiffness as assigned by the caller. true or false."
      }
     }
    }
   },
   "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/ottawa_sah",
  "count": 2,
  "items": [
   {
    "formula": "ottawa_sah",
    "citation": {
     "id": "perry-2013",
     "doi": "10.1001/jama.2013.278018",
     "title": "Clinical decision rules to rule out subarachnoid hemorrhage for acute headache",
     "source": "JAMA. 2013;310(12):1248-1255",
     "authors": "Perry JJ, Stiell IG, Sivilotti MLA, et al."
    },
    "criteria": [
     {
      "met": false,
      "value": 30,
      "factor": "age_ge_40"
     },
     {
      "met": false,
      "factor": "neck_pain_or_stiffness"
     },
     {
      "met": false,
      "factor": "witnessed_loc"
     },
     {
      "met": false,
      "factor": "onset_during_exertion"
     },
     {
      "met": false,
      "factor": "thunderclap_headache"
     },
     {
      "met": false,
      "factor": "limited_neck_flexion"
     }
    ],
    "age_years": 30,
    "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.",
    "formula_expression": "Investigation indicated iff age >= 40 or neck_pain_or_stiffness or witnessed_loc or onset_during_exertion or thunderclap_headache or limited_neck_flexion",
    "investigation_indicated": false
   },
   {
    "formula": "ottawa_sah",
    "citation": {
     "id": "perry-2013",
     "doi": "10.1001/jama.2013.278018",
     "title": "Clinical decision rules to rule out subarachnoid hemorrhage for acute headache",
     "source": "JAMA. 2013;310(12):1248-1255",
     "authors": "Perry JJ, Stiell IG, Sivilotti MLA, et al."
    },
    "criteria": [
     {
      "met": false,
      "value": 30,
      "factor": "age_ge_40"
     },
     {
      "met": false,
      "factor": "neck_pain_or_stiffness"
     },
     {
      "met": false,
      "factor": "witnessed_loc"
     },
     {
      "met": false,
      "factor": "onset_during_exertion"
     },
     {
      "met": false,
      "factor": "thunderclap_headache"
     },
     {
      "met": false,
      "factor": "limited_neck_flexion"
     }
    ],
    "age_years": 30,
    "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.",
    "formula_expression": "Investigation indicated iff age >= 40 or neck_pain_or_stiffness or witnessed_loc or onset_during_ex
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ottawa-sah-rule-calculator-perry-2013-42a6ae30/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)
