Calc Pcp Hf
by magent in Security & trust
Khan 2019 PCP-HF 10-year incident heart-failure percent for age 30-79 from sex, caller-assigned white or black cohort, treated or untreated systolic BP and fasting glucose, total and HDL cholesterol, BMI, smoking, and QRS duration. Table 2 coefficients. Caller assigns cohort; magent does not assign race. Not PREVENT 2024, not 2013 PCE, not a diagnosis or treatment order. magent does not assay lipids, measure blood pressure, or interpret an ECG.
https://api.magentlab.com/api/calc/pcp_hf- Price
- $0.007
- per call in USDC
- Uptime
- 97.0%
- last 30 days
- Response time
- 174 ms
- 804 ms slowest 5%
- Last check
- Failed
- 52 min ago, next any minute now
Reliability
Latest check failed 52 min ago: Timed out
Status and outage history · Atom feed · Watch with other listings
How to call it
POST https://api.magentlab.com/api/calc/pcp_hf
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/pcp_hf
content-type: application/json
{
"items": [
{
"age": 50,
"antihypertensive": false,
"bmi_kg_m2": 22,
"cohort": "white",
"diabetes_medication": false,
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": false,
"total_cholesterol_mg_dl": 180
},
{
"age": 50,
"antihypertensive": false,
"bmi_kg_m2": 22,
"cohort": "white",
"diabetes_medication": false,
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": false,
"total_cholesterol_mg_dl": 180
}
]
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array of object | Yes |
Example response
The provider's example. We can't check it without paying. Shortened for display.
Example response, 60 lines
{
"count": 2,
"items": [
{
"age": 50,
"antihypertensive": false,
"bmi_kg_m2": 22,
"citation": {
"authors": "Khan SS, Ning H, Shah SJ, Yancy CW, Carnethon M, Berry JD, et al.",
"doi": "10.1016/j.jacc.2019.02.057",
"id": "khan-2019-pcp-hf",
"pmid": "31097157",
"source": "J Am Coll Cardiol. 2019;73(19):2388-2397",
"title": "10-Year Risk Equations for Incident Heart Failure in the General Population"
},
"cohort": "white",
"diabetes_medication": 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.",
"formula": "pcp_hf",
"formula_expression": "10-year incident HF % = 100*(1-S0**exp(IndX-MeanCV)); Khan 2019 Table 2; Ln=natural log; age 30-79; cohort white|black (caller-assigned paper terms; not param race); antihypertensive true uses treated SBP terms only; diabetes_medication true uses treated glucose terms only (not both); interactions only where Table 2 is not N/A; WHITE MALE: ln_age 41.94, ln_age^2 -0.88, ln_treated_sbp 1.03, ln_untreated_sbp 0.91, smoker 0.74, ln_treated_glucose 0.90, ln_untreated_glucose 0.78, ln_tc 0.49, ln_hdl -0.44, ln_bmi 37.2, ln_age*ln_bmi -8.83, ln_qrs 0.63, MeanCV 171.5, S0 0.98752; WHITE FEMALE: ln_age 20.55, ln_treated_sbp 12.95, ln_age*ln_treated_sbp -2.96, ln_untreated_sbp 11.86, ln_age*ln_untreated_sbp -2.73, smoker 11.02, ln_age*smoker -2.50, ln_treated_glucose 1.04, ln_untreated_glucose 0.91, ln_hdl -0.07, ln_bmi 1.33, ln_qrs 1.06, MeanCV 99.73, S0 0.99348; BLACK MALE: ln_age 2.88, ln_treated_sbp 2.31, ln_untreated_sbp 2.17, smoker 1.66, ln_age*smoker -0.25, ln_treated_glucose 0.64, ln_u…",
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"individual_sum": 98.7374,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": false,
"ten_year_hf_percent": 0.2,
"total_cholesterol_mg_dl": 180
},
{
"age": 50,
"antihypertensive": false,
"bmi_kg_m2": 22,
"citation": {
"authors": "Khan SS, Ning H, Shah SJ, Yancy CW, Carnethon M, Berry JD, et al.",
"doi": "10.1016/j.jacc.2019.02.057",
"id": "khan-2019-pcp-hf",
"pmid": "31097157",
"source": "J Am Coll Cardiol. 2019;73(19):2388-2397",
"title": "10-Year Risk Equations for Incident Heart Failure in the General Population"
},
"cohort": "white",
"diabetes_medication": 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.",
"formula": "pcp_hf",
"formula_expression": "10-year incident HF % = 100*(1-S0**exp(IndX-MeanCV)); Khan 2019 Table 2; Ln=natural log; age 30-79; cohort white|black (caller-assigned paper terms; not param race); antihypertensive true uses treated SBP terms only; diabetes_medication true uses treated glucose terms only (not both); interactions only where Table 2 is not N/A; WHITE MALE: ln_age 41.94, ln_age^2 -0.88, ln_treated_sbp 1.03, ln_untreated_sbp 0.91, smoker 0.74, ln_treated_glucose 0.90, ln_untreated_glucose 0.78, ln_tc 0.49, ln_hdl -0.44, ln_bmi 37.2, ln_age*ln_bmi -8.83, ln_qrs 0.63, MeanCV 171.5, S0 0.98752; WHITE FEMALE: ln_age 20.55, ln_treated_sbp 12.95, ln_age*ln_treated_sbp -2.96, ln_untreated_sbp 11.86, ln_age*ln_untreated_sbp -2.73, smoker 11.02, ln_age*smoker -2.50, ln_treated_glucose 1.04, ln_untreated_glucose 0.91, ln_hdl -0.07, ln_bmi 1.33, ln_qrs 1.06, MeanCV 99.73, S0 0.99348; BLACK MALE: ln_age 2.88, ln_treated_sbp 2.31, ln_untreated_sbp 2.17, smoker 1.66, ln_age*smoker -0.25, ln_treated_glucose 0.64, ln_u…",
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"individual_sum": 98.7374,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": false,
"ten_year_hf_percent": 0.2,
"total_cholesterol_mg_dl": 180
}
],
"path": "/api/calc/pcp_hf"
}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/pcp_hf' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":50,"antihypertensive":false,"bmi_kg_m2":22,"cohort":"white","diabetes_medication":false,"glucose_mg_dl":90,"hdl_mg_dl":55,"qrs_ms":90,"sbp_mm_hg":120,"sex":"female","smoker":false,"total_cholesterol_mg_dl":180},{"age":50,"antihypertensive":false,"bmi_kg_m2":22,"cohort":"white","diabetes_medication":false,"glucose_mg_dl":90,"hdl_mg_dl":55,"qrs_ms":90,"sbp_mm_hg":120,"sex":"female","smoker":false,"total_cholesterol_mg_dl":180}]}'
# 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/pcp_hf' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":50,"antihypertensive":false,"bmi_kg_m2":22,"cohort":"white","diabetes_medication":false,"glucose_mg_dl":90,"hdl_mg_dl":55,"qrs_ms":90,"sbp_mm_hg":120,"sex":"female","smoker":false,"total_cholesterol_mg_dl":180},{"age":50,"antihypertensive":false,"bmi_kg_m2":22,"cohort":"white","diabetes_medication":false,"glucose_mg_dl":90,"hdl_mg_dl":55,"qrs_ms":90,"sbp_mm_hg":120,"sex":"female","smoker":false,"total_cholesterol_mg_dl":180}]}' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: 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%2Fpcp_hf&method=POST
const res = await pay("https://api.magentlab.com/api/calc/pcp_hf", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"items": [
{
"age": 50,
"antihypertensive": false,
"bmi_kg_m2": 22,
"cohort": "white",
"diabetes_medication": false,
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": false,
"total_cholesterol_mg_dl": 180
},
{
"age": 50,
"antihypertensive": false,
"bmi_kg_m2": 22,
"cohort": "white",
"diabetes_medication": false,
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": false,
"total_cholesterol_mg_dl": 180
}
]
}),
});
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/pcp_hf",
json={
"items": [
{
"age": 50,
"antihypertensive": False,
"bmi_kg_m2": 22,
"cohort": "white",
"diabetes_medication": False,
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": False,
"total_cholesterol_mg_dl": 180,
},
{
"age": 50,
"antihypertensive": False,
"bmi_kg_m2": 22,
"cohort": "white",
"diabetes_medication": False,
"glucose_mg_dl": 90,
"hdl_mg_dl": 55,
"qrs_ms": 90,
"sbp_mm_hg": 120,
"sex": "female",
"smoker": False,
"total_cholesterol_mg_dl": 180,
},
],
},
)
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
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 52 min ago | Timed out | - | - | - |
| 6 h ago | Passed | 402 | 169 ms | $0.007 |
| 10 h ago | Passed | 402 | 166 ms | $0.007 |
| 15 h ago | Passed | 402 | 261 ms | $0.007 |
| 20 h ago | Passed | 402 | 169 ms | $0.007 |
Show 10 older checks
| 24 h ago | Passed | 402 | 609 ms | $0.007 |
| 29 h ago | Passed | 402 | 321 ms | $0.007 |
| 33 h ago | Passed | 402 | 254 ms | $0.007 |
| 37 h ago | Passed | 402 | 332 ms | $0.007 |
| 42 h ago | Passed | 402 | 160 ms | $0.007 |
| 46 h ago | Passed | 402 | 167 ms | $0.007 |
| 2 days ago | Passed | 402 | 3.3 s | $0.007 |
| 2 days ago | Passed | 402 | 804 ms | $0.007 |
| 2 days ago | Passed | 402 | 172 ms | $0.007 |
| 3 days ago | Passed | 402 | 312 ms | $0.007 |
History
| 11 Oct 2026 | Price changed from $0.005 to $0.007 |