LIVE
CHA2DS2-VASc
Deterministic stroke-risk score from discrete flags. Chest 2010 citation.
When to use
CHA2DS2-VASc score from discrete clinical flags. Use for stroke-risk stratification arithmetic in atrial fibrillation. Deterministic published score with citation.
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/cha2ds2_vasc?age=78&sex=female&chf=false&hypertension=true&diabetes=true&stroke_tia=false&vascular_disease=false
Request
GET
/api/calc/cha2ds2_vasc · x402 V2 · USDC on Base · $0.005 USDC
x402 V2 curl
Expect HTTP 402 and a PAYMENT-REQUIRED
header until you retry with PAYMENT-SIGNATURE.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/cha2ds2_vasc?age=78&sex=female&chf=false&hypertension=true&diabetes=true&stroke_tia=false&vascular_disease=false"
Cursor mcp.json
Intended config for @magent/mcp. This is not npm @x402/fetch
(a payment fetch wrapper).
{
"mcpServers": {
"magent": {
"args": [
"-y",
"@magent/mcp"
],
"command": "npx",
"env": {
"X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY"
}
}
}
}
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (18-120). ≥75 scores 2; 65-74 scores 1. |
sex |
string | required · female, male | female scores 1 (Sc); male scores 0. |
chf |
boolean | required | Congestive heart failure or LV dysfunction. true or false. |
hypertension |
boolean | required | Hypertension history. true or false. |
diabetes |
boolean | required | Diabetes mellitus. true or false. |
stroke_tia |
boolean | required | Prior stroke, TIA, or thromboembolism. true or false (2 points). |
vascular_disease |
boolean | required | Prior MI, peripheral artery disease, or aortic plaque. true or false. |
Success fields
| Field | Type | Description |
|---|---|---|
formula |
string | cha2ds2_vasc |
score |
integer | Total points 0-9 |
max_score |
integer | Always 9 |
sex |
string | female or male |
age_years |
integer | Age used for A2/A scoring |
components |
array | Per-factor points |
citation |
object | Chest 2010 citation |
disclaimer |
string | Not-a-device notice |
Example
Frozen fixture. Not a live lookup.
{
"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 coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"age_years": 78,
"citation": {
"authors": "Lip GYH, Nieuwlaat R, Pisters R, Lane DA, Crijns HJ",
"doi": "10.1378/chest.09-1584",
"id": "lip-2010",
"source": "Chest. 2010;137(2):263-272",
"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"
},
"formula": "cha2ds2_vasc",
"sex": "female",
"max_score": 9,
"score": 5
}
Payment
Unpaid requests return HTTP 402 with a base64 PAYMENT-REQUIRED
header. Retry the same URL with PAYMENT-SIGNATURE. Settlement completes before the
tool runs. Full handshake and shared payment errors: Payments.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_age |
age must be an integer from 18 to 120 |
| 400 | invalid_sex |
sex must be female or male |
| 400 | invalid_flag |
boolean clinical flags must be true or false |
| 402 | payment_required |
Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header |
| 409 | payment_in_progress |
The same authorization nonce is already being settled; retry shortly |
| 429 | rate_limited |
Too many requests from this client |
| 503 | settlement_uncertain |
Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE |
| 503 | facilitator_unavailable |
Payment facilitator unavailable |
| 503 | facilitator_misconfigured |
Payment facilitator is not configured |
| 503 | facilitator_unauthorized |
Payment facilitator rejected credentials |
| 503 | ledger_unavailable |
Payment ledger unavailable |
| 503 | payment_unavailable |
Payment processing unavailable |
Guarantees
- Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
- Lookups run on our nodes — no third-party data API wrappers.
- Localhost, IP literals, and metadata hostnames are rejected.
- Execution is timeout-bounded and concurrency-capped.