# ASTRAL score

ASTRAL

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/astral`
HTML: https://magentlab.com/docs/astral
Markdown: https://magentlab.com/docs/astral.md

Not a medical device. Not a diagnosis, dose, or listing recommendation.

## What it computes

Compute the Ntaios 2012 ASTRAL integer score (Age, Severity NIHSS, Time delay, Range of visual fields, Acute glucose, Level of consciousness) for 3-month mRS >2 after acute ischemic stroke.

## When to use

When an agent has caller-assigned NIHSS, onset-to-admission delay, visual fields, glucose, and consciousness and needs the published ASTRAL total and the score-31 50% unfavorable grouping, without inventing NIHSS or unofficial outcome percents.

## When not to use

- Not a medical device and not a tPA, thrombolysis, or endovascular treatment decision.
- Derived in previously independent acute ischemic stroke (ASTRAL registry, Ntaios 2012). It is not a recommendation for or against reperfusion.
- The caller assigns NIHSS (0-42), visual field defect, impaired consciousness (NIHSS item 1a >0), onset-to-admission >180 min, and glucose. magent does not examine the patient or compute NIHSS.
- Age is 1 point per 5 years (integer division), not age in years. Delay scores 2 only if onset-to-admission is greater than 180 min (180 does not). Glucose scores 1 if <3.7 or >7.3 mmol/L (3.7 and 7.3 do not).
- Score 31 indicates a 50% likelihood of 3-month mRS >2 in Ntaios 2012. magent does not return unofficial per-score percentages.
- This is the stroke ASTRAL score, not an astronomical catalog.

## Formula

```
ASTRAL = age (1 per 5 years) + NIHSS + 2 if onset-to-admission >180 min + 2 if visual field defect + 1 if glucose <3.7 or >7.3 mmol/L + 3 if impaired consciousness; Ntaios 2012; 3-month mRS >2 is 50% at score 31
```

## Citation

[An integer-based score to predict functional outcome in acute ischemic stroke: the ASTRAL score](https://doi.org/10.1212/WNL.0b013e318259e221)
Ntaios G, Faouzi M, Ferrari J, Lang W, Vemmos K, Michel P
Neurology. 2012;78(24):1916-1922
DOI: [10.1212/WNL.0b013e318259e221](https://doi.org/10.1212/WNL.0b013e318259e221)

## Worked example

### Age 40, NIHSS 0, no extras (lowest for that age)

Given: `age=40, delay_gt_180=false, glucose_mmol_l=6.0, loc_impaired=false, nihss=0, visual_field_defect=false`

1. Age 40 → 8 (1 per 5 years); NIHSS 0; delay 180 min does not score; visual field, glucose 6.0 mmol/L, consciousness 0
2. Score = 8 (practical max 74); unfavorable_ge_31 false


### Age 120, NIHSS 42, all extras

Given: `age=120, delay_gt_180=true, glucose_mmol_l=20.0, loc_impaired=true, nihss=42, visual_field_defect=true`

1. Age 120 → 24; NIHSS 42; delay +2; visual field +2; glucose 20.0 mmol/L +1; loc +3
2. Score = 74; unfavorable_ge_31 true


## Also searched as

- ASTRAL score
- Acute Stroke Registry and Analysis of Lausanne
- Ntaios ASTRAL
- ischemic stroke ASTRAL
- ASTRAL NIHSS glucose
- 3-month mRS ASTRAL
- Ntaios 2012 ASTRAL

## Parameters

- `age` (integer, required): Age in years (18-120). Ntaios 2012 integer weight is 1 point per 5 years (integer division). magent does not date the patient.
- `nihss` (integer, required): Caller-assigned NIH Stroke Scale total (integer 0-42). 1 point per NIHSS point. magent does not compute NIHSS or examine the patient.
- `delay_gt_180` (boolean, required): Onset-to-admission delay >180 minutes (Ntaios 2012 time item). true scores 2; false (including 180 min) scores 0. magent does not clock the delay.
- `visual_field_defect` (boolean, required): Any stroke-related visual field defect as assigned by the caller (Ntaios 2012 range of visual fields). true scores 2; false scores 0. magent does not examine the patient.
- `glucose_mmol_l` (number, optional): Admission glucose in mmol/L (2.8-55.5). Provide this or glucose_mg_dl, not both. 1 point if <3.7 or >7.3; 3.7 and 7.3 do not score.
- `glucose_mg_dl` (number, optional): Admission glucose in mg/dL (50-1000). Converted as mmol/L = mg/dL / 18. Provide this or glucose_mmol_l, not both.
- `loc_impaired` (boolean, required): Impaired consciousness as assigned by the caller (Ntaios 2012; NIHSS item 1a >0). true scores 3; false scores 0. magent does not compute NIHSS.

## Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

Method: `POST /api/calc/astral`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: PREVIEW

- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
- The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
- HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
- Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
- x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request:

```json
{
  "items": [
    {
      "age": "40",
      "delay_gt_180": "false",
      "glucose_mmol_l": "6.0",
      "loc_impaired": "false",
      "nihss": "0",
      "visual_field_defect": "false"
    },
    {
      "age": "40",
      "delay_gt_180": "false",
      "glucose_mmol_l": "6.0",
      "loc_impaired": "false",
      "nihss": "0",
      "visual_field_defect": "false"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/astral

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/astral",
  "items": [
    {
      "components": [
        {
          "value": 40,
          "factor": "age",
          "points": 8,
          "present": true
        },
        {
          "value": 0,
          "factor": "nihss",
          "points": 0,
          "present": false
        },
        {
          "factor": "delay_gt_180",
          "points": 0,
          "present": false
        },
        {
          "factor": "visual_field_defect",
          "points": 0,
          "present": false
        },
        {
          "value": 6.0,
          "factor": "glucose",
          "points": 0,
          "present": false
        },
        {
          "factor": "loc_impaired",
          "points": 0,
          "present": false
        }
      ],
      "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.",
      "citation": {
        "authors": "Ntaios G, Faouzi M, Ferrari J, Lang W, Vemmos K, Michel P",
        "doi": "10.1212/WNL.0b013e318259e221",
        "id": "ntaios-2012",
        "pmid": "22649218",
        "source": "Neurology. 2012;78(24):1916-1922",
        "title": "An integer-based score to predict functional outcome in acute ischemic stroke: the ASTRAL score"
      },
      "formula": "astral",
      "formula_expression": "ASTRAL = age (1 per 5 years) + NIHSS + 2 if onset-to-admission >180 min + 2 if visual field defect + 1 if glucose <3.7 or >7.3 mmol/L + 3 if impaired consciousness; Ntaios 2012; 3-month mRS >2 is 50% at score 31",
      "max_score": 74,
      "score": 8,
      "age_years": 40,
      "delay_gt_180": false,
      "glucose_abnormal": false,
      "glucose_mmol_l": 6.0,
      "loc_impaired": false,
      "nihss": 0,
      "unfavorable_ge_31": false,
      "visual_field_defect": false
    },
    {
      "components": [
        {
          "value": 40,
          "factor": "age",
          "points": 8,
          "present": true
        },
        {
          "value": 0,
          "factor": "nihss",
          "points": 0,
          "present": false
        },
        {
          "factor": "delay_gt_180",
          "points": 0,
          "present": false
        },
        {
          "factor": "visual_field_defect",
          "points": 0,
          "present": false
        },
        {
          "value": 6.0,
          "factor": "glucose",
          "points": 0,
          "present": false
        },
        {
          "factor": "loc_impaired",
          "points": 0,
          "present": false
        }
      ],
      "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.",
      "citation": {
        "authors": "Ntaios G, Faouzi M, Ferrari J, Lang W, Vemmos K, Michel P",
        "doi": "10.1212/WNL.0b013e318259e221",
        "id": "ntaios-2012",
        "pmid": "22649218",
        "source": "Neurology. 2012;78(24):1916-1922",
        "title": "An integer-based score to predict functional outcome in acute ischemic stroke: the ASTRAL score"
      },
      "formula": "astral",
      "formula_expression": "ASTRAL = age (1 per 5 years) + NIHSS + 2 if onset-to-admission >180 min + 2 if visual field defect + 1 if glucose <3.7 or >7.3 mmol/L + 3 if impaired consciousness; Ntaios 2012; 3-month mRS >2 is 50% at score 31",
      "max_score": 74,
      "score": 8,
      "age_years": 40,
      "delay_gt_180": false,
      "glucose_abnormal": false,
      "glucose_mmol_l": 6.0,
      "loc_impaired": false,
      "nihss": 0,
      "unfavorable_ge_31": false,
      "visual_field_defect": false
    }
  ]
}
```

## Response fields

- `formula` (string): astral
- `formula_expression` (string): Exact expression used
- `score` (integer): ASTRAL points (no published upper bound)
- `max_score` (integer): 74 with age 18-120 and NIHSS 0-42
- `unfavorable_ge_31` (boolean): true iff score ≥ 31. Ntaios 2012: score 31 indicates 50% likelihood of 3-month mRS >2. No unofficial per-score percent is returned.
- `age_years` (integer): Age used for 1-per-5-years points
- `nihss` (integer): Caller-assigned NIHSS used for points
- `delay_gt_180` (boolean): Whether onset-to-admission was scored as >180 min
- `visual_field_defect` (boolean): Whether visual field defect was scored
- `glucose_mmol_l` (number): Admission glucose in mmol/L (mg/dL inputs converted /18)
- `glucose_abnormal` (boolean): true iff glucose <3.7 or >7.3 mmol/L
- `loc_impaired` (boolean): Whether impaired consciousness was scored
- `components` (array): Per-item Ntaios 2012 points
- `citation` (object): Ntaios 2012 Neurology citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 40,
      "factor": "age",
      "points": 8,
      "present": true
    },
    {
      "value": 0,
      "factor": "nihss",
      "points": 0,
      "present": false
    },
    {
      "factor": "delay_gt_180",
      "points": 0,
      "present": false
    },
    {
      "factor": "visual_field_defect",
      "points": 0,
      "present": false
    },
    {
      "value": 6.0,
      "factor": "glucose",
      "points": 0,
      "present": false
    },
    {
      "factor": "loc_impaired",
      "points": 0,
      "present": false
    }
  ],
  "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.",
  "citation": {
    "authors": "Ntaios G, Faouzi M, Ferrari J, Lang W, Vemmos K, Michel P",
    "doi": "10.1212/WNL.0b013e318259e221",
    "id": "ntaios-2012",
    "pmid": "22649218",
    "source": "Neurology. 2012;78(24):1916-1922",
    "title": "An integer-based score to predict functional outcome in acute ischemic stroke: the ASTRAL score"
  },
  "formula": "astral",
  "formula_expression": "ASTRAL = age (1 per 5 years) + NIHSS + 2 if onset-to-admission >180 min + 2 if visual field defect + 1 if glucose <3.7 or >7.3 mmol/L + 3 if impaired consciousness; Ntaios 2012; 3-month mRS >2 is 50% at score 31",
  "max_score": 74,
  "score": 8,
  "age_years": 40,
  "delay_gt_180": false,
  "glucose_abnormal": false,
  "glucose_mmol_l": 6.0,
  "loc_impaired": false,
  "nihss": 0,
  "unfavorable_ge_31": false,
  "visual_field_defect": false
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_nihss`: nihss must be an integer from 0 to 42. Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_glucose`: glucose_mg_dl (50-1000) or glucose_mmol_l (2.8-55.5) is required Returned before settlement; you are not charged.
- HTTP 400 `invalid_astral`: each ASTRAL 2012 item must be a published value for that field. Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [THRIVE](https://magentlab.com/docs/thrive) — Compute the Flint 2010 THRIVE (Totaled Health Risks in Vascular Events) score from trichotomized age, trichotomized NIHSS, and the chronic disease scale (hypertension, diabetes mellitus, atrial fibrillation).
- [PLAN](https://magentlab.com/docs/plan) — Compute the O'Donnell 2012 PLAN score (preadmission comorbidities, level of consciousness, age, and neurologic deficit) for death and severe disability after acute ischemic stroke from the published Table 4 items.

## Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/docs/mcp

## Guarantees

- HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
- exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
- HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.
