70trust / 100

Calc Preset

by magent in Weather & location

x402 APIPassing, checked 4 h ago

Hilder 2017 PRESET-Score: five Table 4 items (MAP mm Hg, lactate mmol/L, arterial pH, platelets k/uL, hospital days pre-ECMO) summed 0-15. Returns class I (0-5, 26% ICU mortality), II (6-9, 68%), or III (10-15, 93%) from the derivation cohort. Deterministic published arithmetic with citation; not a cannulation order; magent does not assay labs. Not RESP or SAVE.

POST
https://api.magentlab.com/api/calc/preset
Price
$0.007
per call in USDC
Uptime
100%
last 30 days
Response time
176 ms
1.3 s slowest 5%
Last check
Passed
4 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

POST https://api.magentlab.com/api/calc/preset

Each call costs $0.007 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.

POST https://api.magentlab.com/api/calc/preset
content-type: application/json

{
  "items": [
    {
      "arterial_ph": 7.4,
      "hospital_days_pre_ecmo": 1,
      "lactate_mmol_l": 1,
      "mean_arterial_pressure_mm_hg": 110,
      "platelets_k_ul": 250
    },
    {
      "arterial_ph": 7.4,
      "hospital_days_pre_ecmo": 1,
      "lactate_mmol_l": 1,
      "mean_arterial_pressure_mm_hg": 110,
      "platelets_k_ul": 250
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
itemsarray of objectYes

Example response

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

Example response, 114 lines
{
  "count": 2,
  "items": [
    {
      "arterial_ph": 7.4,
      "citation": {
        "authors": "Hilder M, Herbstreit F, Adamzik M, et al.",
        "doi": "10.1186/s13054-017-1888-6",
        "id": "hilder-2017",
        "pmid": "29233160",
        "source": "Crit Care. 2017;21(1):301",
        "title": "Comparison of mortality prediction models in acute respiratory distress syndrome undergoing extracorporeal membrane oxygenation and development of a novel prediction score: the PREdiction of Survival on ECMO Therapy-Score (PRESET-Score)"
      },
      "components": [
        {
          "factor": "mean_arterial_pressure_mm_hg",
          "points": 0,
          "present": false,
          "value": 110
        },
        {
          "factor": "lactate_mmol_l",
          "points": 0,
          "present": false,
          "value": 1
        },
        {
          "factor": "arterial_ph",
          "points": 0,
          "present": false,
          "value": 7.4
        },
        {
          "factor": "platelets_k_ul",
          "points": 0,
          "present": false,
          "value": 250
        },
        {
          "factor": "hospital_days_pre_ecmo",
          "points": 0,
          "present": false,
          "value": 1
        }
      ],
      "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": "preset",
      "formula_expression": "PRESET = map_points + lactate_points + ph_points + platelet_points + hospital_days_points; Hilder 2017 Table 4; MAP >100 → 0, 91-100 → 1, 81-90 → 2, 71-80 → 3, ≤70 → 4; lactate ≤1.50 → 0, 1.51-3.00 → 1, 3.01-6.00 → 2, 6.01-10.00 → 3, >10.00 → 4; arterial pH >7.300 → 0, 7.201-7.300 → 1, 7.101-7.200 → 2, ≤7.100 → 3; platelets >200 → 0, 101-200 → 1, ≤100 → 2; hospital days pre-ECMO ≤2 → 0, 3-7 → 1, >7 → 2; max 15; class I 0-5 (26%), II 6-9 (68%), III 10-15 (93%) derivation ICU mortality",
      "hospital_days_pre_ecmo": 1,
      "icu_mortality_percent": 26,
      "lactate_mmol_l": 1,
      "max_score": 15,
      "mean_arterial_pressure_mm_hg": 110,
      "platelets_k_ul": 250,
      "preset_class": "I",
      "score": 0
    },
    {
      "arterial_ph": 7.4,
      "citation": {
        "authors": "Hilder M, Herbstreit F, Adamzik M, et al.",
        "doi": "10.1186/s13054-017-1888-6",
        "id": "hilder-2017",
        "pmid": "29233160",
        "source": "Crit Care. 2017;21(1):301",
        "title": "Comparison of mortality prediction models in acute respiratory distress syndrome undergoing extracorporeal membrane oxygenation and development of a novel prediction score: the PREdiction of Survival on ECMO Therapy-Score (PRESET-Score)"
      },
      "components": [
        {
          "factor": "mean_arterial_pressure_mm_hg",
          "points": 0,
          "present": false,
          "value": 110
        },
        {
          "factor": "lactate_mmol_l",
          "points": 0,
          "present": false,
          "value": 1
        },
        {
          "factor": "arterial_ph",
          "points": 0,
          "present": false,
          "value": 7.4
        },
        {
          "factor": "platelets_k_ul",
          "points": 0,
          "present": false,
          "value": 250
        },
        {
          "factor": "hospital_days_pre_ecmo",
          "points": 0,
          "present": false,
          "value": 1
        }
      ],
      "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": "preset",
      "formula_expression": "PRESET = map_points + lactate_points + ph_points + platelet_points + hospital_days_points; Hilder 2017 Table 4; MAP >100 → 0, 91-100 → 1, 81-90 → 2, 71-80 → 3, ≤70 → 4; lactate ≤1.50 → 0, 1.51-3.00 → 1, 3.01-6.00 → 2, 6.01-10.00 → 3, >10.00 → 4; arterial pH >7.300 → 0, 7.201-7.300 → 1, 7.101-7.200 → 2, ≤7.100 → 3; platelets >200 → 0, 101-200 → 1, ≤100 → 2; hospital days pre-ECMO ≤2 → 0, 3-7 → 1, >7 → 2; max 15; class I 0-5 (26%), II 6-9 (68%), III 10-15 (93%) derivation ICU mortality",
      "hospital_days_pre_ecmo": 1,
      "icu_mortality_percent": 26,
      "lactate_mmol_l": 1,
      "max_score": 15,
      "mean_arterial_pressure_mm_hg": 110,
      "platelets_k_ul": 250,
      "preset_class": "I",
      "score": 0
    }
  ],
  "path": "/api/calc/preset"
}

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.007.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://api.magentlab.com/api/calc/preset' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"arterial_ph":7.4,"hospital_days_pre_ecmo":1,"lactate_mmol_l":1,"mean_arterial_pressure_mm_hg":110,"platelets_k_ul":250},{"arterial_ph":7.4,"hospital_days_pre_ecmo":1,"lactate_mmol_l":1,"mean_arterial_pressure_mm_hg":110,"platelets_k_ul":250}]}'

# 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 - -X POST 'https://api.magentlab.com/api/calc/preset' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"arterial_ph":7.4,"hospital_days_pre_ecmo":1,"lactate_mmol_l":1,"mean_arterial_pressure_mm_hg":110,"platelets_k_ul":250},{"arterial_ph":7.4,"hospital_days_pre_ecmo":1,"lactate_mmol_l":1,"mean_arterial_pressure_mm_hg":110,"platelets_k_ul":250}]}' \
  | 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.007 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.007" });
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.007 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.magentlab.com%2Fapi%2Fcalc%2Fpreset&method=POST
const res = await pay("https://api.magentlab.com/api/calc/preset", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "items": [
      {
        "arterial_ph": 7.4,
        "hospital_days_pre_ecmo": 1,
        "lactate_mmol_l": 1,
        "mean_arterial_pressure_mm_hg": 110,
        "platelets_k_ul": 250
      },
      {
        "arterial_ph": 7.4,
        "hospital_days_pre_ecmo": 1,
        "lactate_mmol_l": 1,
        "mean_arterial_pressure_mm_hg": 110,
        "platelets_k_ul": 250
      }
    ]
  }),
});
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.007 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.007"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://api.magentlab.com/api/calc/preset",
        json={
            "items": [
                {
                    "arterial_ph": 7.4,
                    "hospital_days_pre_ecmo": 1,
                    "lactate_mmol_l": 1,
                    "mean_arterial_pressure_mm_hg": 110,
                    "platelets_k_ul": 250,
                },
                {
                    "arterial_ph": 7.4,
                    "hospital_days_pre_ecmo": 1,
                    "lactate_mmol_l": 1,
                    "mean_arterial_pressure_mm_hg": 110,
                    "platelets_k_ul": 250,
                },
            ],
        },
    )
    print(res.status_code, res.text)

Security scan

1 finding

  • Charges more than its listed price in payment
    Listed at $0.005, charges $0.007

Recent checks

WhenResultHTTPTimePrice
4 h agoPassed402397 ms$0.007
9 h agoPassed402257 ms$0.007
14 h agoPassed402345 ms$0.007
18 h agoPassed402153 ms$0.007
23 h agoPassed402257 ms$0.007
Show 10 older checks
27 h agoPassed402860 ms$0.007
32 h agoPassed402176 ms$0.007
36 h agoPassed402239 ms$0.007
40 h agoPassed402281 ms$0.007
44 h agoPassed402158 ms$0.007
2 days agoPassed402150 ms$0.007
2 days agoPassed402289 ms$0.007
2 days agoPassed402278 ms$0.007
3 days agoPassed402170 ms$0.007
3 days agoPassed402246 ms$0.007

History

11 Oct 2026Price changed from $0.005 to $0.007