Calc 4c
by magent in Other
Knight 2020 ISARIC 4C Mortality Score: age (<50→0, 50–59→2, 60–69→4, 70–79→6, ≥80→7) + male 1 + comorbidity_count (0/1/≥2 → 0/1/2; caller-assigned Charlson-plus-obesity count) + RR (<20→0, 20–29→1, ≥30→2) + room-air SpO2 (<92→2) + GCS (<15→2) + urea (<7→0, 7–14→1, >14→3 mmol/L; or BUN/2.8) + CRP (<50→0, 50–99→1, ≥100→2). Max 21. Table 5: low 0–3, intermediate 4–8, high 9–14, very high ≥15. Not a COVID-19 diagnosis or treatment order.
https://api.magentlab.com/api/calc/4c- Price
- $0.005
- per call in USDC
- Uptime
- 100%
- last 30 days
- Response time
- 183 ms
- 419 ms slowest 5%
- Last check
- Passed
- 54 min ago, next any minute now
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
POST https://api.magentlab.com/api/calc/4c
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.
POST https://api.magentlab.com/api/calc/4c
content-type: application/json
{
"items": [
{
"age": 40,
"bun_mg_dl": 14,
"comorbidity_count": 0,
"crp_mg_l": 10,
"gcs": 15,
"respiratory_rate": 16,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5
},
{
"age": 40,
"bun_mg_dl": 14,
"comorbidity_count": 0,
"crp_mg_l": 10,
"gcs": 15,
"respiratory_rate": 16,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5
}
]
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array of object | Yes |
Example response
The provider's example. We can't check it without paying.
Example response, 154 lines
{
"count": 2,
"items": [
{
"age_years": 40,
"citation": {
"authors": "Knight SR, Ho A, Pius R, Buchan I, Carson G, Drake TM, Dunning J, Fairfield CJ, Gamble C, Green CA, Gupta R, Halpin S, Hardwick HE, Holden KA, Horby PW, Jackson C, Mclean KA, Merson L, Nguyen-Van-Tam JS, Norman L, Noursadeghi M, Olliaro PL, Pritchard MG, Russell CD, Shaw CA, Sheikh A, Solomon T, Sudlow C, Swann OV, Turtle LCW, Openshaw PJM, Baillie JK, Semple MG, Docherty AB, Harrison EM; ISARIC4C investigators",
"doi": "10.1136/bmj.m3339",
"id": "knight-2020",
"pmid": "32907855",
"source": "BMJ. 2020;370:m3339",
"title": "Risk stratification of patients admitted to hospital with covid-19 using the ISARIC WHO Clinical Characterisation Protocol: development and validation of the 4C Mortality Score"
},
"comorbidity_count": 0,
"components": [
{
"factor": "age",
"points": 0,
"present": false,
"value": 40
},
{
"factor": "sex",
"points": 0,
"present": false,
"value": "female"
},
{
"factor": "comorbidity_count",
"points": 0,
"present": false,
"value": 0
},
{
"factor": "respiratory_rate",
"points": 0,
"present": false,
"value": 16
},
{
"factor": "spo2_percent",
"points": 0,
"present": false,
"value": 98
},
{
"factor": "gcs",
"points": 0,
"present": false,
"value": 15
},
{
"factor": "urea",
"points": 0,
"present": false,
"value": 5
},
{
"factor": "crp_mg_l",
"points": 0,
"present": false,
"value": 10
}
],
"crp_mg_l": 10,
"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": "4c",
"formula_expression": "4C = age (<50 0, 50–59 2, 60–69 4, 70–79 6, ≥80 7) + sex (female 0, male 1) + comorbidity_count (0→0, 1→1, ≥2→2) + respiratory_rate (<20 0, 20–29 1, ≥30 2) + spo2_percent (≥92 0, <92 2) + gcs (15 0, <15 2) + urea_mmol_l (<7 0, 7–14 1, >14 3) + crp_mg_l (<50 0, 50–99 1, ≥100 2); Knight 2020 Table 2; max 21; Table 5 bands low 0–3, intermediate 4–8, high 9–14, very_high ≥15",
"four_c_band": "low",
"gcs": 15,
"max_score": 21,
"respiratory_rate": 16,
"score": 0,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5
},
{
"age_years": 40,
"citation": {
"authors": "Knight SR, Ho A, Pius R, Buchan I, Carson G, Drake TM, Dunning J, Fairfield CJ, Gamble C, Green CA, Gupta R, Halpin S, Hardwick HE, Holden KA, Horby PW, Jackson C, Mclean KA, Merson L, Nguyen-Van-Tam JS, Norman L, Noursadeghi M, Olliaro PL, Pritchard MG, Russell CD, Shaw CA, Sheikh A, Solomon T, Sudlow C, Swann OV, Turtle LCW, Openshaw PJM, Baillie JK, Semple MG, Docherty AB, Harrison EM; ISARIC4C investigators",
"doi": "10.1136/bmj.m3339",
"id": "knight-2020",
"pmid": "32907855",
"source": "BMJ. 2020;370:m3339",
"title": "Risk stratification of patients admitted to hospital with covid-19 using the ISARIC WHO Clinical Characterisation Protocol: development and validation of the 4C Mortality Score"
},
"comorbidity_count": 0,
"components": [
{
"factor": "age",
"points": 0,
"present": false,
"value": 40
},
{
"factor": "sex",
"points": 0,
"present": false,
"value": "female"
},
{
"factor": "comorbidity_count",
"points": 0,
"present": false,
"value": 0
},
{
"factor": "respiratory_rate",
"points": 0,
"present": false,
"value": 16
},
{
"factor": "spo2_percent",
"points": 0,
"present": false,
"value": 98
},
{
"factor": "gcs",
"points": 0,
"present": false,
"value": 15
},
{
"factor": "urea",
"points": 0,
"present": false,
"value": 5
},
{
"factor": "crp_mg_l",
"points": 0,
"present": false,
"value": 10
}
],
"crp_mg_l": 10,
"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": "4c",
"formula_expression": "4C = age (<50 0, 50–59 2, 60–69 4, 70–79 6, ≥80 7) + sex (female 0, male 1) + comorbidity_count (0→0, 1→1, ≥2→2) + respiratory_rate (<20 0, 20–29 1, ≥30 2) + spo2_percent (≥92 0, <92 2) + gcs (15 0, <15 2) + urea_mmol_l (<7 0, 7–14 1, >14 3) + crp_mg_l (<50 0, 50–99 1, ≥100 2); Knight 2020 Table 2; max 21; Table 5 bands low 0–3, intermediate 4–8, high 9–14, very_high ≥15",
"four_c_band": "low",
"gcs": 15,
"max_score": 21,
"respiratory_rate": 16,
"score": 0,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5
}
],
"path": "/api/calc/4c"
}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 -X POST 'https://api.magentlab.com/api/calc/4c' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":40,"bun_mg_dl":14,"comorbidity_count":0,"crp_mg_l":10,"gcs":15,"respiratory_rate":16,"sex":"female","spo2_percent":98,"urea_mmol_l":5},{"age":40,"bun_mg_dl":14,"comorbidity_count":0,"crp_mg_l":10,"gcs":15,"respiratory_rate":16,"sex":"female","spo2_percent":98,"urea_mmol_l":5}]}'
# 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/4c' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":40,"bun_mg_dl":14,"comorbidity_count":0,"crp_mg_l":10,"gcs":15,"respiratory_rate":16,"sex":"female","spo2_percent":98,"urea_mmol_l":5},{"age":40,"bun_mg_dl":14,"comorbidity_count":0,"crp_mg_l":10,"gcs":15,"respiratory_rate":16,"sex":"female","spo2_percent":98,"urea_mmol_l":5}]}' \
| 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.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%2F4c&method=POST
const res = await pay("https://api.magentlab.com/api/calc/4c", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"items": [
{
"age": 40,
"bun_mg_dl": 14,
"comorbidity_count": 0,
"crp_mg_l": 10,
"gcs": 15,
"respiratory_rate": 16,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5
},
{
"age": 40,
"bun_mg_dl": 14,
"comorbidity_count": 0,
"crp_mg_l": 10,
"gcs": 15,
"respiratory_rate": 16,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5
}
]
}),
});
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.post(
"https://api.magentlab.com/api/calc/4c",
json={
"items": [
{
"age": 40,
"bun_mg_dl": 14,
"comorbidity_count": 0,
"crp_mg_l": 10,
"gcs": 15,
"respiratory_rate": 16,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5,
},
{
"age": 40,
"bun_mg_dl": 14,
"comorbidity_count": 0,
"crp_mg_l": 10,
"gcs": 15,
"respiratory_rate": 16,
"sex": "female",
"spo2_percent": 98,
"urea_mmol_l": 5,
},
],
},
)
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
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 54 min ago | Passed | 402 | 144 ms | $0.005 |
| 6 h ago | Passed | 402 | 494 ms | $0.005 |
| 10 h ago | Passed | 402 | 177 ms | $0.005 |
| 15 h ago | Passed | 402 | 270 ms | $0.005 |
| 19 h ago | Passed | 402 | 340 ms | $0.005 |
Show 10 older checks
| 23 h ago | Passed | 402 | 146 ms | $0.005 |
| 27 h ago | Passed | 402 | 357 ms | $0.005 |
| 31 h ago | Passed | 402 | 162 ms | $0.005 |
| 36 h ago | Passed | 402 | 166 ms | $0.005 |
| 40 h ago | Passed | 402 | 335 ms | $0.005 |
| 44 h ago | Passed | 402 | 146 ms | $0.005 |
| 2 days ago | Passed | 402 | 143 ms | $0.005 |
| 2 days ago | Passed | 402 | 144 ms | $0.005 |
| 2 days ago | Passed | 402 | 139 ms | $0.005 |
| 3 days ago | Passed | 402 | 330 ms | $0.005 |