# CHA2DS2-VASc Score Calculator

> CHA2DS2-VASc 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-10-10).

Computes the CHA2DS2-VASc stroke-risk score for atrial fibrillation patients from discrete clinical flags (age, sex, CHF, hypertension, diabetes, prior stroke/TIA, vascular disease).

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/cha2ds2_vasc?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cha2ds2-vasc-score-calculator-06284735
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HnTlpScJpAhTcgnzRkF7L

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 cha2ds2-vasc-score-calculator-06284735
```

Example prompt: Calculate the CHA2DS2-VASc score for a 73-year-old female patient with atrial fibrillation who has hypertension and diabetes, no history of stroke or TIA, no congestive heart failure, and no vascular disease.

## When to prefer this

Use this endpoint when you need a deterministic, citation-backed CHA2DS2-VASc score computed from discrete structured clinical inputs within an automated clinical or administrative workflow. Prefer it over general LLM reasoning for auditable, reproducible stroke-risk arithmetic that must match the published Lip 2010 / ESC guideline formula exactly.

## Known failure modes

- Missing required query parameters (age, sex, chf, hypertension, diabetes, stroke_tia, vascular_disease) returns a 400 error
- Age outside valid range (18–120) may return a validation error
- Invalid enum for sex (not 'male' or 'female') returns a schema error
- Network timeout or upstream unavailability returns a 5xx error
- Payment not provided or insufficient USDC triggers x402 payment-required response

## How this service works

Cited Lip 2010 CHA2DS2-VASc stroke-risk score. Agents must not invent CHA2DS2-VASc from model memory; pay per request with x402 USDC on Base. Deterministic published score with citation. Not a treatment recommendation.

## Output

Returns the integer CHA2DS2-VASc total score (0–9) computed from the submitted clinical flags, with individual component contributions and a citation to the published scoring method for stroke-risk stratification in atrial fibrillation.

## 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",
      "chf",
      "hypertension",
      "diabetes",
      "stroke_tia",
      "vascular_disease"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). ≥75 scores 2; 65-74 scores 1."
      },
      "chf": {
       "type": "boolean",
       "description": "Congestive heart failure or LV dysfunction. true or false."
      },
      "sex": {
       "enum": [
        "female",
        "male"
       ],
       "type": "string",
       "description": "female scores 1 (Sc); male scores 0."
      },
      "diabetes": {
       "type": "boolean",
       "description": "Diabetes mellitus. true or false."
      },
      "stroke_tia": {
       "type": "boolean",
       "description": "Prior stroke, TIA, or thromboembolism. true or false (2 points)."
      },
      "hypertension": {
       "type": "boolean",
       "description": "Hypertension history. true or false."
      },
      "vascular_disease": {
       "type": "boolean",
       "description": "Prior MI, peripheral artery disease, or aortic plaque. 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/cha2ds2_vasc",
  "count": 2,
  "items": [
   {
    "sex": "female",
    "score": 5,
    "formula": "cha2ds2_vasc",
    "citation": {
     "id": "lip-2010",
     "doi": "10.1378/chest.09-1584",
     "title": "Refining clinical risk stratification for predicting stroke and thromboembolism in atrial fibrillation using a novel risk factor-based approach: the euro heart survey on atrial fibrillation",
     "source": "Chest. 2010;137(2):263-272",
     "authors": "Lip GYH, Nieuwlaat R, Pisters R, Lane DA, Crijns HJ"
    },
    "age_years": 78,
    "max_score": 9,
    "components": [
     {
      "factor": "congestive_heart_failure",
      "points": 0,
      "present": false
     },
     {
      "factor": "hypertension",
      "points": 1,
      "present": true
     },
     {
      "value": 78,
      "factor": "age",
      "points": 2,
      "present": true
     },
     {
      "factor": "diabetes",
      "points": 1,
      "present": true
     },
     {
      "factor": "stroke_tia_thromboembolism",
      "points": 0,
      "present": false
     },
     {
      "factor": "vascular_disease",
      "points": 0,
      "present": false
     },
     {
      "factor": "sex_female",
      "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.",
    "formula_expression": "CHA2DS2-VASc = CHF 1 + HTN 1 + Age≥75 2 (or 65-74 1) + diabetes 1 + stroke/TIA 2 + vascular 1 + female 1; max 9"
   },
   {
    "sex": "female",
    "score": 5,
    "formula": "cha2ds2_vasc",
    "citation": {
     "id": "lip-2010",
     "doi": "10.1378/chest.09-1584",
     "title": "Refining clinical risk stratification for predicting stroke and thromboembolism in atrial fibrillation using a novel risk factor-based approach: the euro heart survey on atrial fibrillation",
     "source": "Chest. 2010;137(2):263-272",
     "authors": "Lip GYH, Nieuwlaat R, Pisters R, Lane DA, Crijns HJ"
    },
    "age_years": 78,
    "max_score": 9,
    "components": [
     {
      "factor": "congestive_heart_failure",
      "points": 0,
      "present": false
     },
     {
      "factor": "hypertension",
      "points": 1,
      "present": true
     },
     {
      "value": 78,
      "factor": "age",
      "points": 2,
      "present": true
     },
     {
      "factor": "
… (truncated)
```

## More

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