Calc 4peps
by magent in Other
Roy 2021 4PEPS Table 3: age <50 −2, 50–64 −1, ≥65 0; chronic respiratory disease −1; HR <80 −1; chest pain and acute dyspnea +1; male +2; estrogen treatment +2; prior VTE +2; syncope +2; 4-week immobility +2; SpO2 <95% +3; calf pain or unilateral edema +3; PE most likely +5. Max 22. Bands: very_low <0, low 0–5, moderate 6–12, high ≥13. Not imaging or D-dimer. magent does not examine the patient or decide PE most likely.
https://api.magentlab.com/api/calc/4peps- Price
- $0.007
- per call in USDC
- Uptime
- 88.9%
- last 30 days
- Response time
- 161 ms
- 575 ms slowest 5%
- Last check
- Failed
- 2 h ago, next any minute now
Reliability
Latest check failed 2 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/4peps
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/4peps
content-type: application/json
{
"items": [
{
"age": 40,
"calf_pain_or_unilateral_edema": false,
"chest_pain_and_acute_dyspnea": false,
"chronic_respiratory_disease": false,
"heart_rate_bpm": 90,
"hormonal_estrogenic_treatment": false,
"immobility_4w": false,
"pe_most_likely": false,
"personal_history_vte": false,
"sex": "female",
"spo2_percent": 98,
"syncope": false
},
{
"age": 40,
"calf_pain_or_unilateral_edema": false,
"chest_pain_and_acute_dyspnea": false,
"chronic_respiratory_disease": false,
"heart_rate_bpm": 90,
"hormonal_estrogenic_treatment": false,
"immobility_4w": false,
"pe_most_likely": false,
"personal_history_vte": false,
"sex": "female",
"spo2_percent": 98,
"syncope": false
}
]
}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, 170 lines
{
"count": 2,
"items": [
{
"citation": {
"authors": "Roy PM, Friou E, Germeau B, et al.",
"doi": "10.1001/jamacardio.2021.0064",
"id": "roy-2021",
"pmid": "33656522",
"source": "JAMA Cardiol. 2021;6(6):669-677",
"title": "Derivation and Validation of a 4-Level Clinical Pretest Probability Score for Suspected Pulmonary Embolism to Safely Decrease Imaging Testing"
},
"components": [
{
"factor": "age",
"points": -2,
"present": true,
"value": 40
},
{
"factor": "chronic_respiratory_disease",
"points": 0,
"present": false
},
{
"factor": "heart_rate_bpm",
"points": 0,
"present": false,
"value": 90
},
{
"factor": "chest_pain_and_acute_dyspnea",
"points": 0,
"present": false
},
{
"factor": "sex",
"points": 0,
"present": false,
"value": "female"
},
{
"factor": "hormonal_estrogenic_treatment",
"points": 0,
"present": false
},
{
"factor": "personal_history_vte",
"points": 0,
"present": false
},
{
"factor": "syncope",
"points": 0,
"present": false
},
{
"factor": "immobility_4w",
"points": 0,
"present": false
},
{
"factor": "spo2_percent",
"points": 0,
"present": false,
"value": 98
},
{
"factor": "calf_pain_or_unilateral_edema",
"points": 0,
"present": false
},
{
"factor": "pe_most_likely",
"points": 0,
"present": false
}
],
"cpp": "very_low",
"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": "4peps",
"formula_expression": "4PEPS = age (<50 -2, 50-64 -1, ≥65 0) + chronic_respiratory_disease (-1) + heart_rate_bpm (<80 -1) + chest_pain_and_acute_dyspnea (1) + male (2) + hormonal_estrogenic_treatment (2) + personal_history_vte (2) + syncope (2) + immobility_4w (2) + spo2_percent (<95 3) + calf_pain_or_unilateral_edema (3) + pe_most_likely (5); Roy 2021 Table 3; cpp very_low <0, low 0-5, moderate 6-12, high ≥13; max 22 (age ≥65 plus all positive items; score may be negative)",
"max_score": 22,
"score": -2
},
{
"citation": {
"authors": "Roy PM, Friou E, Germeau B, et al.",
"doi": "10.1001/jamacardio.2021.0064",
"id": "roy-2021",
"pmid": "33656522",
"source": "JAMA Cardiol. 2021;6(6):669-677",
"title": "Derivation and Validation of a 4-Level Clinical Pretest Probability Score for Suspected Pulmonary Embolism to Safely Decrease Imaging Testing"
},
"components": [
{
"factor": "age",
"points": -2,
"present": true,
"value": 40
},
{
"factor": "chronic_respiratory_disease",
"points": 0,
"present": false
},
{
"factor": "heart_rate_bpm",
"points": 0,
"present": false,
"value": 90
},
{
"factor": "chest_pain_and_acute_dyspnea",
"points": 0,
"present": false
},
{
"factor": "sex",
"points": 0,
"present": false,
"value": "female"
},
{
"factor": "hormonal_estrogenic_treatment",
"points": 0,
"present": false
},
{
"factor": "personal_history_vte",
"points": 0,
"present": false
},
{
"factor": "syncope",
"points": 0,
"present": false
},
{
"factor": "immobility_4w",
"points": 0,
"present": false
},
{
"factor": "spo2_percent",
"points": 0,
"present": false,
"value": 98
},
{
"factor": "calf_pain_or_unilateral_edema",
"points": 0,
"present": false
},
{
"factor": "pe_most_likely",
"points": 0,
"present": false
}
],
"cpp": "very_low",
"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": "4peps",
"formula_expression": "4PEPS = age (<50 -2, 50-64 -1, ≥65 0) + chronic_respiratory_disease (-1) + heart_rate_bpm (<80 -1) + chest_pain_and_acute_dyspnea (1) + male (2) + hormonal_estrogenic_treatment (2) + personal_history_vte (2) + syncope (2) + immobility_4w (2) + spo2_percent (<95 3) + calf_pain_or_unilateral_edema (3) + pe_most_likely (5); Roy 2021 Table 3; cpp very_low <0, low 0-5, moderate 6-12, high ≥13; max 22 (age ≥65 plus all positive items; score may be negative)",
"max_score": 22,
"score": -2
}
],
"path": "/api/calc/4peps"
}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/4peps' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":40,"calf_pain_or_unilateral_edema":false,"chest_pain_and_acute_dyspnea":false,"chronic_respiratory_disease":false,"heart_rate_bpm":90,"hormonal_estrogenic_treatment":false,"immobility_4w":false,"pe_most_likely":false,"personal_history_vte":false,"sex":"female","spo2_percent":98,"syncope":false},{"age":40,"calf_pain_or_unilateral_edema":false,"chest_pain_and_acute_dyspnea":false,"chronic_respiratory_disease":false,"heart_rate_bpm":90,"hormonal_estrogenic_treatment":false,"immobility_4w":false,"pe_most_likely":false,"personal_history_vte":false,"sex":"female","spo2_percent":98,"syncope":false}]}'
# 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/4peps' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":40,"calf_pain_or_unilateral_edema":false,"chest_pain_and_acute_dyspnea":false,"chronic_respiratory_disease":false,"heart_rate_bpm":90,"hormonal_estrogenic_treatment":false,"immobility_4w":false,"pe_most_likely":false,"personal_history_vte":false,"sex":"female","spo2_percent":98,"syncope":false},{"age":40,"calf_pain_or_unilateral_edema":false,"chest_pain_and_acute_dyspnea":false,"chronic_respiratory_disease":false,"heart_rate_bpm":90,"hormonal_estrogenic_treatment":false,"immobility_4w":false,"pe_most_likely":false,"personal_history_vte":false,"sex":"female","spo2_percent":98,"syncope":false}]}' \
| 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%2F4peps&method=POST
const res = await pay("https://api.magentlab.com/api/calc/4peps", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"items": [
{
"age": 40,
"calf_pain_or_unilateral_edema": false,
"chest_pain_and_acute_dyspnea": false,
"chronic_respiratory_disease": false,
"heart_rate_bpm": 90,
"hormonal_estrogenic_treatment": false,
"immobility_4w": false,
"pe_most_likely": false,
"personal_history_vte": false,
"sex": "female",
"spo2_percent": 98,
"syncope": false
},
{
"age": 40,
"calf_pain_or_unilateral_edema": false,
"chest_pain_and_acute_dyspnea": false,
"chronic_respiratory_disease": false,
"heart_rate_bpm": 90,
"hormonal_estrogenic_treatment": false,
"immobility_4w": false,
"pe_most_likely": false,
"personal_history_vte": false,
"sex": "female",
"spo2_percent": 98,
"syncope": false
}
]
}),
});
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/4peps",
json={
"items": [
{
"age": 40,
"calf_pain_or_unilateral_edema": False,
"chest_pain_and_acute_dyspnea": False,
"chronic_respiratory_disease": False,
"heart_rate_bpm": 90,
"hormonal_estrogenic_treatment": False,
"immobility_4w": False,
"pe_most_likely": False,
"personal_history_vte": False,
"sex": "female",
"spo2_percent": 98,
"syncope": False,
},
{
"age": 40,
"calf_pain_or_unilateral_edema": False,
"chest_pain_and_acute_dyspnea": False,
"chronic_respiratory_disease": False,
"heart_rate_bpm": 90,
"hormonal_estrogenic_treatment": False,
"immobility_4w": False,
"pe_most_likely": False,
"personal_history_vte": False,
"sex": "female",
"spo2_percent": 98,
"syncope": False,
},
],
},
)
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 |
|---|---|---|---|---|
| 2 h ago | Timed out | - | - | - |
| 7 h ago | Timed out | - | - | - |
| 12 h ago | Timed out | - | - | - |
| 17 h ago | Timed out | - | - | - |
| 22 h ago | Passed | 402 | 161 ms | $0.007 |
Show 10 older checks
| 26 h ago | Passed | 402 | 162 ms | $0.007 |
| 31 h ago | Passed | 402 | 139 ms | $0.007 |
| 36 h ago | Passed | 402 | 168 ms | $0.007 |
| 40 h ago | Passed | 402 | 264 ms | $0.007 |
| 45 h ago | Passed | 402 | 146 ms | $0.007 |
| 2 days ago | Passed | 402 | 180 ms | $0.007 |
| 2 days ago | Passed | 402 | 139 ms | $0.007 |
| 2 days ago | Passed | 402 | 382 ms | $0.007 |
| 3 days ago | Passed | 402 | 299 ms | $0.007 |
| 3 days ago | Passed | 402 | 173 ms | $0.007 |
History
| 11 Oct 2026 | Price changed from $0.005 to $0.007 |