75trust / 100

Calc Impact

by magent in AI models & inference

x402 APIPassing, checked 7 h ago

Steyerberg 2008 IMPACT prognostic score for 6-month mortality and unfavorable outcome after traumatic brain injury. model=core (age, motor, pupils), extended (plus hypoxia, hypotension, Marshall CT, tSAH, EDH), or lab (plus glucose mmol/L and Hb g/dL). Points and printed logistic LPs from that paper. Not a diagnosis, not MRC CRASH (Perel 2008), and not magent chemotherapy CRASH.

GET
https://api.magentlab.com/api/calc/impact
Price
$0.005
per call in USDC
Uptime
100%
last 30 days
Response time
276 ms
577 ms slowest 5%
Last check
Passed
7 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed · Watch with other listings

How to call it

GET https://api.magentlab.com/api/calc/impact

Each call costs $0.005 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

GET https://api.magentlab.com/api/calc/impact?age=35&edh=false&glucose_mmol_l=10&hemoglobin_g_dl=11&hypotension=false&hypoxia=false&marshall_ct=II&model=core&motor_score=3&pupillary_reactivity=both&tsah=false

Parameters

ParameterTypeRequiredDescription
ageintegerYesAge in years (integer 14-90). Steyerberg 2008 Figure 1: ≤30 → 0; 31–39 → 1; 40–49 → 2; 50–59 → 3; 60–69 → 4; ≥70 → 5. Chart label 30–39 is the decade after ≤30 (age 30 scores 0).
edhbooleanNoEpidural hematoma (Steyerberg 2008). Required when model is extended or lab. true adds −2; false adds 0. Ignored on model=core.
glucose_mmol_lnumberNoAdmission glucose in mmol/L (2.8-55.5). Required when model is lab. Steyerberg 2008: <6 → 0; 6–8.9 → 1; 9–11.9 → 2; 12–14.9 → 3; ≥15 → 4. Ignored on core and extended. magent does not assay glucose.
hemoglobin_g_dlnumberNoAdmission hemoglobin in g/dL (3-22). Required when model is lab. Steyerberg 2008: <9 → 3; 9–11.9 → 2; 12–14.9 → 1; ≥15 → 0. Ignored on core and extended. magent does not assay hemoglobin.
hypotensionbooleanNoHypotension yes or suspected (Steyerberg 2008). Required when model is extended or lab. true adds 2; false adds 0. Ignored on model=core.
hypoxiabooleanNoHypoxia yes or suspected (Steyerberg 2008). Required when model is extended or lab. true adds 1; false adds 0. Ignored on model=core.
marshall_ctstringNoMarshall CT class I–VI (Steyerberg 2008). Required when model is extended or lab. I → −2; II → 0; III, IV, V, or VI → 2. Ignored on model=core. magent does not read the scan. One of: I, II, III, IV, V, VI.
modelstringYesSteyerberg 2008 IMPACT model. core uses age, motor, and pupils. extended adds hypoxia, hypotension, Marshall CT, tSAH, and EDH. lab adds glucose mmol/L and hemoglobin g/dL. Required; magent does not pick a model. One of: core, extended, lab.
motor_scoreintegerYesGCS motor integer 1-6 or 9 (untestable/missing) as in Steyerberg 2008. 1 or 2 (none/extension) → 6; 3 (abnormal flexion) → 4; 4 (normal flexion) → 2; 5 or 6 (localizes/obeys) → 0; 9 → 3.
pupillary_reactivitystringYesPupillary reactivity (Steyerberg 2008). both → 0; one → 2; none → 4. Caller-assigned. magent does not examine pupils. One of: both, one, none.
tsahbooleanNoTraumatic subarachnoid hemorrhage (Steyerberg 2008). Required when model is extended or lab. true adds 2; false adds 0. Ignored on model=core.

Example response

The provider's example. We can't check it without paying.

Example response, 44 lines
{
  "age": 35,
  "citation": {
    "authors": "Steyerberg EW, Mushkudiani N, Perel P, Butcher I, Lu J, McHugh GS, Murray GD, Marmarou A, Roberts I, Habbema JDF, Maas AIR",
    "doi": "10.1371/journal.pmed.0050165",
    "id": "steyerberg-2008-impact",
    "pmid": "18640954",
    "source": "PLoS Med. 2008;5(8):e165",
    "title": "Predicting outcome after traumatic brain injury: development and international validation of prognostic scores based on admission characteristics"
  },
  "components": [
    {
      "factor": "age",
      "points": 1,
      "present": true,
      "value": 35
    },
    {
      "factor": "motor_score",
      "points": 4,
      "present": true,
      "value": 3
    },
    {
      "factor": "pupillary_reactivity",
      "points": 0,
      "present": false,
      "value": "both"
    }
  ],
  "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": "impact",
  "formula_expression": "IMPACT (Steyerberg 2008 Fig 1): core = age(<=30:0, 31-39:1, 40-49:2, 50-59:3, 60-69:4, >=70:5) + motor(1-2:6, 3:4, 4:2, 5-6:0, 9:3) + pupils(both:0, one:2, none:4); extended = core + hypoxia(yes/suspected:1) + hypotension(yes/suspected:2) + marshall(I:-2, II:0, III-VI:2) + tSAH(yes:2) + EDH(yes:-2); lab = extended + glucose_mmol_l(<6:0, 6-8.9:1, 9-11.9:2, 12-14.9:3, >=15:4) + hb_g_dl(<9:3, 9-11.9:2, 12-14.9:1, >=15:0); p = 1/(1+e^(-LP)); LPcore mort=-2.55+0.275*sum; LPcore unfav=-1.62+0.299*sum; LPext mort=-2.98+0.256*sum; LPext unfav=-2.10+0.276*sum; LPlab mort=-3.42+0.216*sum; LPlab unfav=-2.82+0.257*sum; 6-month percent 1 decimal; not MRC CRASH",
  "linear_predictor_mortality": -1.175,
  "linear_predictor_unfavorable": -0.125,
  "max_score": 15,
  "model": "core",
  "mortality_6_month_percent": 23.6,
  "motor_score": 3,
  "pupillary_reactivity": "both",
  "score": 5,
  "sum_core": 5,
  "unfavorable_6_month_percent": 46.9
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.005.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i 'https://api.magentlab.com/api/calc/impact?age=35&edh=false&glucose_mmol_l=10&hemoglobin_g_dl=11&hypotension=false&hypoxia=false&marshall_ct=II&model=core&motor_score=3&pupillary_reactivity=both&tsah=false'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - 'https://api.magentlab.com/api/calc/impact?age=35&edh=false&glucose_mmol_l=10&hemoglobin_g_dl=11&hypotension=false&hypoxia=false&marshall_ct=II&model=core&motor_score=3&pupillary_reactivity=both&tsah=false' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.005 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.005" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.005 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.magentlab.com%2Fapi%2Fcalc%2Fimpact
const res = await pay("https://api.magentlab.com/api/calc/impact?age=35&edh=false&glucose_mmol_l=10&hemoglobin_g_dl=11&hypotension=false&hypoxia=false&marshall_ct=II&model=core&motor_score=3&pupillary_reactivity=both&tsah=false");
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.005 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.005"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.get("https://api.magentlab.com/api/calc/impact?age=35&edh=false&glucose_mmol_l=10&hemoglobin_g_dl=11&hypotension=false&hypoxia=false&marshall_ct=II&model=core&motor_score=3&pupillary_reactivity=both&tsah=false")
    print(res.status_code, res.text)

Security scan

No findings

We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
7 h agoPassed402144 ms$0.005
17 h agoPassed402250 ms$0.005
27 h agoPassed402207 ms$0.005
37 h agoPassed402298 ms$0.005
47 h agoPassed402215 ms$0.005
Show 6 older checks
2 days agoPassed402397 ms$0.005
3 days agoPassed402577 ms$0.005
3 days agoPassed402301 ms$0.005
4 days agoPassed402276 ms$0.005
4 days agoPassed402490 ms$0.005
4 days agoPassed402136 ms$0.005