71trust / 100

Calc Vacs 2

by magent in Other

x402 APIPassing, checked 3 h ago

Tate 2019 VACS Index 2.0 (not 1.0): age, CD4, HIV-1 RNA, hemoglobin, caller-assigned FIB-4 and eGFR, hepatitis C, albumin, WBC, and BMI. Appendix Table 1 polynomials. Score scaled so the median profile is 44. Not a 5-year percent (no published S0). magent does not compute FIB-4 or eGFR and does not assign HIV status.

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

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

{
  "items": [
    {
      "age": 40,
      "albumin_g_dl": 4.2,
      "bmi_kg_m2": 26,
      "cd4_cells_mm3": 600,
      "egfr_ml_min_1_73m2": 100,
      "fib4": 1,
      "hemoglobin_g_dl": 15,
      "hepatitis_c": false,
      "hiv_rna_copies_ml": 50,
      "wbc_10e9_l": 6
    },
    {
      "age": 40,
      "albumin_g_dl": 4.2,
      "bmi_kg_m2": 26,
      "cd4_cells_mm3": 600,
      "egfr_ml_min_1_73m2": 100,
      "fib4": 1,
      "hemoglobin_g_dl": 15,
      "hepatitis_c": false,
      "hiv_rna_copies_ml": 50,
      "wbc_10e9_l": 6
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
itemsarray of objectYes

Example response

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

Example response, 56 lines
{
  "count": 2,
  "items": [
    {
      "age": 40,
      "albumin_g_dl": 4.2,
      "bmi_kg_m2": 26,
      "cd4_cells_mm3": 600,
      "citation": {
        "authors": "Tate JP, Sterne JAC, Justice AC; Veterans Aging Cohort Study (VACS) and the Antiretroviral Therapy Cohort Collaboration (ART-CC)",
        "doi": "10.1097/QAD.0000000000002140",
        "id": "tate-2019-vacs-2",
        "pmid": "30649088",
        "source": "AIDS. 2019;33(5):903-912",
        "title": "Albumin, white blood cell count, and body mass index improve discrimination of mortality in HIV-positive individuals"
      },
      "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.",
      "egfr_ml_min_1_73m2": 100,
      "fib4": 1,
      "formula": "vacs_2",
      "formula_expression": "lp = age_poly + cd4_poly + rna_poly + hb_poly + fib4_poly + egfr_spline + hcv + alb_poly + wbc_poly + bmi_poly; score = round(44 + 20*(lp - lp_median)); lp_median is Appendix Table 2 median profile (age 52, CD4 435, log10 HIV-1 RNA 1.7, Hb 14, FIB-4 1.34, eGFR 90, HCV no, albumin 4, WBC 5.5, BMI 25.3); age censored 30-75, X=(age-50)/5, PE 0.056/-0.004/0.005; CD4 censored 0-1000 as ln(max(1000-CD4, 1)), PE -0.056/-0.153/0.024; HIV-1 RNA log10 copies censored 1.3-5.0, centered (logVL-2), PE 0.513/-0.422/0.098; hemoglobin censored 9-16, centered (hemoglobin-14), PE -0.134/0.026/0.005; FIB-4 censored 0.5-7.5, PE 0.220/-0.009; eGFR censored 0-180, X1=eGFR/10, X2=max(eGFR-35,0)/10, X3=max(eGFR-65,0)/10, X4=max(eGFR-115,0)/10, PE -0.031/-0.077/0.106/0.133; HCV yes 0.342; albumin censored 2-5, centered (albumin-4), PE -0.443/0.104/0.028; WBC 10^9/L censored 2.5-11, centered (WBC-5.5), PE 0.126/0.020/-0.004; BMI censored 15-35, centered (BMI-25), PE -0.055/0.004; Tate 2019 Appendix Table 1 mai…",
      "hemoglobin_g_dl": 15,
      "hepatitis_c": false,
      "hiv_rna_copies_ml": 50,
      "linear_predictor": -1.428513,
      "score": 30,
      "wbc_10e9_l": 6
    },
    {
      "age": 40,
      "albumin_g_dl": 4.2,
      "bmi_kg_m2": 26,
      "cd4_cells_mm3": 600,
      "citation": {
        "authors": "Tate JP, Sterne JAC, Justice AC; Veterans Aging Cohort Study (VACS) and the Antiretroviral Therapy Cohort Collaboration (ART-CC)",
        "doi": "10.1097/QAD.0000000000002140",
        "id": "tate-2019-vacs-2",
        "pmid": "30649088",
        "source": "AIDS. 2019;33(5):903-912",
        "title": "Albumin, white blood cell count, and body mass index improve discrimination of mortality in HIV-positive individuals"
      },
      "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.",
      "egfr_ml_min_1_73m2": 100,
      "fib4": 1,
      "formula": "vacs_2",
      "formula_expression": "lp = age_poly + cd4_poly + rna_poly + hb_poly + fib4_poly + egfr_spline + hcv + alb_poly + wbc_poly + bmi_poly; score = round(44 + 20*(lp - lp_median)); lp_median is Appendix Table 2 median profile (age 52, CD4 435, log10 HIV-1 RNA 1.7, Hb 14, FIB-4 1.34, eGFR 90, HCV no, albumin 4, WBC 5.5, BMI 25.3); age censored 30-75, X=(age-50)/5, PE 0.056/-0.004/0.005; CD4 censored 0-1000 as ln(max(1000-CD4, 1)), PE -0.056/-0.153/0.024; HIV-1 RNA log10 copies censored 1.3-5.0, centered (logVL-2), PE 0.513/-0.422/0.098; hemoglobin censored 9-16, centered (hemoglobin-14), PE -0.134/0.026/0.005; FIB-4 censored 0.5-7.5, PE 0.220/-0.009; eGFR censored 0-180, X1=eGFR/10, X2=max(eGFR-35,0)/10, X3=max(eGFR-65,0)/10, X4=max(eGFR-115,0)/10, PE -0.031/-0.077/0.106/0.133; HCV yes 0.342; albumin censored 2-5, centered (albumin-4), PE -0.443/0.104/0.028; WBC 10^9/L censored 2.5-11, centered (WBC-5.5), PE 0.126/0.020/-0.004; BMI censored 15-35, centered (BMI-25), PE -0.055/0.004; Tate 2019 Appendix Table 1 mai…",
      "hemoglobin_g_dl": 15,
      "hepatitis_c": false,
      "hiv_rna_copies_ml": 50,
      "linear_predictor": -1.428513,
      "score": 30,
      "wbc_10e9_l": 6
    }
  ],
  "path": "/api/calc/vacs_2"
}

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/vacs_2' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"age":40,"albumin_g_dl":4.2,"bmi_kg_m2":26,"cd4_cells_mm3":600,"egfr_ml_min_1_73m2":100,"fib4":1,"hemoglobin_g_dl":15,"hepatitis_c":false,"hiv_rna_copies_ml":50,"wbc_10e9_l":6},{"age":40,"albumin_g_dl":4.2,"bmi_kg_m2":26,"cd4_cells_mm3":600,"egfr_ml_min_1_73m2":100,"fib4":1,"hemoglobin_g_dl":15,"hepatitis_c":false,"hiv_rna_copies_ml":50,"wbc_10e9_l":6}]}'

# 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/vacs_2' \
  -H 'content-type: application/json' \
  --data-raw '{"items":[{"age":40,"albumin_g_dl":4.2,"bmi_kg_m2":26,"cd4_cells_mm3":600,"egfr_ml_min_1_73m2":100,"fib4":1,"hemoglobin_g_dl":15,"hepatitis_c":false,"hiv_rna_copies_ml":50,"wbc_10e9_l":6},{"age":40,"albumin_g_dl":4.2,"bmi_kg_m2":26,"cd4_cells_mm3":600,"egfr_ml_min_1_73m2":100,"fib4":1,"hemoglobin_g_dl":15,"hepatitis_c":false,"hiv_rna_copies_ml":50,"wbc_10e9_l":6}]}' \
  | 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%2Fvacs_2&method=POST
const res = await pay("https://api.magentlab.com/api/calc/vacs_2", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "items": [
      {
        "age": 40,
        "albumin_g_dl": 4.2,
        "bmi_kg_m2": 26,
        "cd4_cells_mm3": 600,
        "egfr_ml_min_1_73m2": 100,
        "fib4": 1,
        "hemoglobin_g_dl": 15,
        "hepatitis_c": false,
        "hiv_rna_copies_ml": 50,
        "wbc_10e9_l": 6
      },
      {
        "age": 40,
        "albumin_g_dl": 4.2,
        "bmi_kg_m2": 26,
        "cd4_cells_mm3": 600,
        "egfr_ml_min_1_73m2": 100,
        "fib4": 1,
        "hemoglobin_g_dl": 15,
        "hepatitis_c": false,
        "hiv_rna_copies_ml": 50,
        "wbc_10e9_l": 6
      }
    ]
  }),
});
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/vacs_2",
        json={
            "items": [
                {
                    "age": 40,
                    "albumin_g_dl": 4.2,
                    "bmi_kg_m2": 26,
                    "cd4_cells_mm3": 600,
                    "egfr_ml_min_1_73m2": 100,
                    "fib4": 1,
                    "hemoglobin_g_dl": 15,
                    "hepatitis_c": False,
                    "hiv_rna_copies_ml": 50,
                    "wbc_10e9_l": 6,
                },
                {
                    "age": 40,
                    "albumin_g_dl": 4.2,
                    "bmi_kg_m2": 26,
                    "cd4_cells_mm3": 600,
                    "egfr_ml_min_1_73m2": 100,
                    "fib4": 1,
                    "hemoglobin_g_dl": 15,
                    "hepatitis_c": False,
                    "hiv_rna_copies_ml": 50,
                    "wbc_10e9_l": 6,
                },
            ],
        },
    )
    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
3 h agoPassed402282 ms$0.007
8 h agoPassed402531 ms$0.007
13 h agoPassed402304 ms$0.007
17 h agoPassed402320 ms$0.007
22 h agoPassed402154 ms$0.007
Show 10 older checks
26 h agoPassed402438 ms$0.007
31 h agoPassed402237 ms$0.007
34 h agoPassed402381 ms$0.007
39 h agoPassed402371 ms$0.007
43 h agoPassed402138 ms$0.007
47 h agoPassed402289 ms$0.007
2 days agoPassed402384 ms$0.007
2 days agoPassed402143 ms$0.007
3 days agoPassed402234 ms$0.007
3 days agoPassed402399 ms$0.007

History

11 Oct 2026Price changed from $0.005 to $0.007