64trust / 100

Calc Shfm

by magent in AI models & inference

x402 APIFailing, checked 4 h ago

Levy 2006 Seattle Heart Failure Model 1-, 2-, and 3-year survival from Table 2 multivariate HRs. Score = sum of ln(HR)*x; S(t)=exp(-0.0405*t)**exp(score). Age, sex, NYHA, EF, ischemic etiology, SBP, furosemide-eq diuretic, labs, and already-on ACEI, beta-blocker, ARB, K-sparing diuretic, statin, BiV, ICD, or BiV-ICD. Caller assigns class, etiology, and therapy. magent does not measure labs or blood pressure. Not a diagnosis, prescription, or device order.

POST
https://api.magentlab.com/api/calc/shfm
Price
$0.007
per call in USDC
Uptime
86.1%
last 30 days
Response time
304 ms
1.0 s slowest 5%
Last check
Failed
4 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Latest check failed 4 h ago: Timed out

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

How to call it

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

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/shfm
content-type: application/json

{
  "items": [
    {
      "ace_inhibitor": true,
      "age": 60,
      "allopurinol": false,
      "arb": false,
      "beta_blocker": true,
      "biv_icd": false,
      "biv_pacemaker": false,
      "ef_percent": 30,
      "hemoglobin_g_dl": 14,
      "icd": false,
      "ischemic": false,
      "k_sparing_diuretic": false,
      "loop_diuretic_furosemide_eq_mg_day": 0,
      "lymphocyte_percent": 25,
      "nyha": 2,
      "sbp_mm_hg": 120,
      "sex": "male",
      "sodium_meq_l": 140,
      "statin": false,
      "total_cholesterol_mg_dl": 180,
      "uric_acid_mg_dl": 6,
      "weight_kg": 80
    },
    {
      "ace_inhibitor": true,
      "age": 60,
      "allopurinol": false,
      "arb": false,
      "beta_blocker": true,
      "biv_icd": false,
      "biv_pacemaker": false,
      "ef_percent": 30,
      "hemoglobin_g_dl": 14,
      "icd": false,
      "ischemic": false,
      "k_sparing_diuretic": false,
      "loop_diuretic_furosemide_eq_mg_day": 0,
      "lymphocyte_percent": 25,
      "nyha": 2,
      "sbp_mm_hg": 120,
      "sex": "male",
      "sodium_meq_l": 140,
      "statin": false,
      "total_cholesterol_mg_dl": 180,
      "uric_acid_mg_dl": 6,
      "weight_kg": 80
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
itemsarray of objectYes

Example response

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

Example response, 86 lines
{
  "count": 2,
  "items": [
    {
      "ace_inhibitor": true,
      "age": 60,
      "allopurinol": false,
      "arb": false,
      "beta_blocker": true,
      "biv_icd": false,
      "biv_pacemaker": false,
      "citation": {
        "authors": "Levy WC, Mozaffarian D, Linker DT, Sutradhar SC, Anker SD, Cropp AB, et al.",
        "doi": "10.1161/CIRCULATIONAHA.105.584102",
        "id": "levy-2006-shfm",
        "pmid": "16534009",
        "source": "Circulation. 2006;113(11):1424-1433",
        "title": "The Seattle Heart Failure Model: Prediction of Survival in Heart Failure"
      },
      "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.",
      "diuretic_furosemide_eq_mg_kg_day": 0,
      "ef_percent": 30,
      "formula": "shfm",
      "formula_expression": "score = sum(ln(HR)*x); S(t)=exp(-0.0405*t)**exp(score) for t years 0-5; Levy 2006 Table 2 multivariate HRs (italic β=ln(HR); medication/device = patient-already-on column); 1/2/3-year survival % round 1 decimal; age/10 * ln(1.090); male ln(1.089) (forced); NYHA * ln(1.600); (100/EF)*ln(1.030); ischemic ln(1.354); min(SBP,160)/10 * ln(0.877); furosemide-eq mg/kg/day * ln(1.178) (furosemide 80 = torsemide 40 = bumetanide 3); allopurinol ln(1.571); if Na<138: (138-Na)*ln(1.050); (100/cholesterol)*ln(2.206); if Hb<16: (16-Hb)*ln(1.124); if Hb>16: (Hb-16)*ln(1.336); min(%lymphocytes,47)/5 * ln(0.897); max(uric_acid,3.4)*ln(1.064); ACEI ln(0.77); beta-blocker ln(0.66); ARB ln(0.85); K-sparing diuretic ln(0.74); statin ln(0.63); BiV pacemaker ln(1.00); ICD ln(0.73); BiV-ICD ln(0.79); devices mutually exclusive; not a diagnosis or treatment/device order",
      "hemoglobin_g_dl": 14,
      "icd": false,
      "ischemic": false,
      "k_sparing_diuretic": false,
      "loop_diuretic_furosemide_eq_mg_day": 0,
      "lymphocyte_percent": 25,
      "nyha": 2,
      "sbp_mm_hg": 120,
      "score": -0.1089,
      "sex": "male",
      "sodium_meq_l": 140,
      "statin": false,
      "survival_1y_percent": 96.4,
      "survival_2y_percent": 93,
      "survival_3y_percent": 89.7,
      "total_cholesterol_mg_dl": 180,
      "uric_acid_mg_dl": 6,
      "weight_kg": 80
    },
    {
      "ace_inhibitor": true,
      "age": 60,
      "allopurinol": false,
      "arb": false,
      "beta_blocker": true,
      "biv_icd": false,
      "biv_pacemaker": false,
      "citation": {
        "authors": "Levy WC, Mozaffarian D, Linker DT, Sutradhar SC, Anker SD, Cropp AB, et al.",
        "doi": "10.1161/CIRCULATIONAHA.105.584102",
        "id": "levy-2006-shfm",
        "pmid": "16534009",
        "source": "Circulation. 2006;113(11):1424-1433",
        "title": "The Seattle Heart Failure Model: Prediction of Survival in Heart Failure"
      },
      "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.",
      "diuretic_furosemide_eq_mg_kg_day": 0,
      "ef_percent": 30,
      "formula": "shfm",
      "formula_expression": "score = sum(ln(HR)*x); S(t)=exp(-0.0405*t)**exp(score) for t years 0-5; Levy 2006 Table 2 multivariate HRs (italic β=ln(HR); medication/device = patient-already-on column); 1/2/3-year survival % round 1 decimal; age/10 * ln(1.090); male ln(1.089) (forced); NYHA * ln(1.600); (100/EF)*ln(1.030); ischemic ln(1.354); min(SBP,160)/10 * ln(0.877); furosemide-eq mg/kg/day * ln(1.178) (furosemide 80 = torsemide 40 = bumetanide 3); allopurinol ln(1.571); if Na<138: (138-Na)*ln(1.050); (100/cholesterol)*ln(2.206); if Hb<16: (16-Hb)*ln(1.124); if Hb>16: (Hb-16)*ln(1.336); min(%lymphocytes,47)/5 * ln(0.897); max(uric_acid,3.4)*ln(1.064); ACEI ln(0.77); beta-blocker ln(0.66); ARB ln(0.85); K-sparing diuretic ln(0.74); statin ln(0.63); BiV pacemaker ln(1.00); ICD ln(0.73); BiV-ICD ln(0.79); devices mutually exclusive; not a diagnosis or treatment/device order",
      "hemoglobin_g_dl": 14,
      "icd": false,
      "ischemic": false,
      "k_sparing_diuretic": false,
      "loop_diuretic_furosemide_eq_mg_day": 0,
      "lymphocyte_percent": 25,
      "nyha": 2,
      "sbp_mm_hg": 120,
      "score": -0.1089,
      "sex": "male",
      "sodium_meq_l": 140,
      "statin": false,
      "survival_1y_percent": 96.4,
      "survival_2y_percent": 93,
      "survival_3y_percent": 89.7,
      "total_cholesterol_mg_dl": 180,
      "uric_acid_mg_dl": 6,
      "weight_kg": 80
    }
  ],
  "path": "/api/calc/shfm"
}

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/shfm' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"ace_inhibitor":true,"age":60,"allopurinol":false,"arb":false,"beta_blocker":true,"biv_icd":false,"biv_pacemaker":false,"ef_percent":30,"hemoglobin_g_dl":14,"icd":false,"ischemic":false,"k_sparing_diuretic":false,"loop_diuretic_furosemide_eq_mg_day":0,"lymphocyte_percent":25,"nyha":2,"sbp_mm_hg":120,"sex":"male","sodium_meq_l":140,"statin":false,"total_cholesterol_mg_dl":180,"uric_acid_mg_dl":6,"weight_kg":80},{"ace_inhibitor":true,"age":60,"allopurinol":false,"arb":false,"beta_blocker":true,"biv_icd":false,"biv_pacemaker":false,"ef_percent":30,"hemoglobin_g_dl":14,"icd":false,"ischemic":false,"k_sparing_diuretic":false,"loop_diuretic_furosemide_eq_mg_day":0,"lymphocyte_percent":25,"nyha":2,"sbp_mm_hg":120,"sex":"male","sodium_meq_l":140,"statin":false,"total_cholesterol_mg_dl":180,"uric_acid_mg_dl":6,"weight_kg":80}]}'

# 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/shfm' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"ace_inhibitor":true,"age":60,"allopurinol":false,"arb":false,"beta_blocker":true,"biv_icd":false,"biv_pacemaker":false,"ef_percent":30,"hemoglobin_g_dl":14,"icd":false,"ischemic":false,"k_sparing_diuretic":false,"loop_diuretic_furosemide_eq_mg_day":0,"lymphocyte_percent":25,"nyha":2,"sbp_mm_hg":120,"sex":"male","sodium_meq_l":140,"statin":false,"total_cholesterol_mg_dl":180,"uric_acid_mg_dl":6,"weight_kg":80},{"ace_inhibitor":true,"age":60,"allopurinol":false,"arb":false,"beta_blocker":true,"biv_icd":false,"biv_pacemaker":false,"ef_percent":30,"hemoglobin_g_dl":14,"icd":false,"ischemic":false,"k_sparing_diuretic":false,"loop_diuretic_furosemide_eq_mg_day":0,"lymphocyte_percent":25,"nyha":2,"sbp_mm_hg":120,"sex":"male","sodium_meq_l":140,"statin":false,"total_cholesterol_mg_dl":180,"uric_acid_mg_dl":6,"weight_kg":80}]}' \
  | 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%2Fshfm&method=POST
const res = await pay("https://api.magentlab.com/api/calc/shfm", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "items": [
      {
        "ace_inhibitor": true,
        "age": 60,
        "allopurinol": false,
        "arb": false,
        "beta_blocker": true,
        "biv_icd": false,
        "biv_pacemaker": false,
        "ef_percent": 30,
        "hemoglobin_g_dl": 14,
        "icd": false,
        "ischemic": false,
        "k_sparing_diuretic": false,
        "loop_diuretic_furosemide_eq_mg_day": 0,
        "lymphocyte_percent": 25,
        "nyha": 2,
        "sbp_mm_hg": 120,
        "sex": "male",
        "sodium_meq_l": 140,
        "statin": false,
        "total_cholesterol_mg_dl": 180,
        "uric_acid_mg_dl": 6,
        "weight_kg": 80
      },
      {
        "ace_inhibitor": true,
        "age": 60,
        "allopurinol": false,
        "arb": false,
        "beta_blocker": true,
        "biv_icd": false,
        "biv_pacemaker": false,
        "ef_percent": 30,
        "hemoglobin_g_dl": 14,
        "icd": false,
        "ischemic": false,
        "k_sparing_diuretic": false,
        "loop_diuretic_furosemide_eq_mg_day": 0,
        "lymphocyte_percent": 25,
        "nyha": 2,
        "sbp_mm_hg": 120,
        "sex": "male",
        "sodium_meq_l": 140,
        "statin": false,
        "total_cholesterol_mg_dl": 180,
        "uric_acid_mg_dl": 6,
        "weight_kg": 80
      }
    ]
  }),
});
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/shfm",
        json={
            "items": [
                {
                    "ace_inhibitor": True,
                    "age": 60,
                    "allopurinol": False,
                    "arb": False,
                    "beta_blocker": True,
                    "biv_icd": False,
                    "biv_pacemaker": False,
                    "ef_percent": 30,
                    "hemoglobin_g_dl": 14,
                    "icd": False,
                    "ischemic": False,
                    "k_sparing_diuretic": False,
                    "loop_diuretic_furosemide_eq_mg_day": 0,
                    "lymphocyte_percent": 25,
                    "nyha": 2,
                    "sbp_mm_hg": 120,
                    "sex": "male",
                    "sodium_meq_l": 140,
                    "statin": False,
                    "total_cholesterol_mg_dl": 180,
                    "uric_acid_mg_dl": 6,
                    "weight_kg": 80,
                },
                {
                    "ace_inhibitor": True,
                    "age": 60,
                    "allopurinol": False,
                    "arb": False,
                    "beta_blocker": True,
                    "biv_icd": False,
                    "biv_pacemaker": False,
                    "ef_percent": 30,
                    "hemoglobin_g_dl": 14,
                    "icd": False,
                    "ischemic": False,
                    "k_sparing_diuretic": False,
                    "loop_diuretic_furosemide_eq_mg_day": 0,
                    "lymphocyte_percent": 25,
                    "nyha": 2,
                    "sbp_mm_hg": 120,
                    "sex": "male",
                    "sodium_meq_l": 140,
                    "statin": False,
                    "total_cholesterol_mg_dl": 180,
                    "uric_acid_mg_dl": 6,
                    "weight_kg": 80,
                },
            ],
        },
    )
    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 agoTimed out---
10 h agoTimed out---
14 h agoTimed out---
19 h agoTimed out---
24 h agoPassed402409 ms$0.007
Show 10 older checks
29 h agoPassed402311 ms$0.007
33 h agoPassed402423 ms$0.007
38 h agoPassed402160 ms$0.007
42 h agoPassed402460 ms$0.007
47 h agoPassed4021.1 s$0.007
2 days agoPassed402252 ms$0.007
2 days agoPassed402305 ms$0.007
2 days agoPassed402461 ms$0.007
3 days agoPassed4021.0 s$0.007
3 days agoPassed402304 ms$0.007

History

11 Oct 2026Price changed from $0.005 to $0.007