Calc Improve Bleed
by magent in Security & trust
Decousus 2011 IMPROVE admission bleeding-risk score: ulcer 4.5, prior bleeding 4, platelets <50 4, age >=85 3.5, hepatic failure 2.5, severe renal failure 2.5, ICU/CCU 2.5, CVC 2, rheumatic disease 2, current cancer 2, age 40-84 1.5, male 1, moderate renal failure 1. Max 30.5. Increased risk at >=7. Not a VTE-prophylaxis order. magent does not examine the patient.
https://api.magentlab.com/api/calc/improve_bleed- Price
- $0.007
- per call in USDC
- Uptime
- 94.1%
- last 30 days
- Response time
- 263 ms
- 574 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/improve_bleed
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/improve_bleed
content-type: application/json
{
"items": [
{
"active_gastroduodenal_ulcer": false,
"age": 35,
"central_venous_catheter": false,
"current_cancer": false,
"hepatic_failure": false,
"icu_ccu": false,
"platelet_count_lt_50": false,
"prior_bleeding": false,
"renal_failure": "none",
"rheumatic_disease": false,
"sex": "female"
},
{
"active_gastroduodenal_ulcer": false,
"age": 35,
"central_venous_catheter": false,
"current_cancer": false,
"hepatic_failure": false,
"icu_ccu": false,
"platelet_count_lt_50": false,
"prior_bleeding": false,
"renal_failure": "none",
"rheumatic_disease": false,
"sex": "female"
}
]
}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, 182 lines
{
"count": 2,
"items": [
{
"age_years": 35,
"bleed_band": "not_increased",
"citation": {
"authors": "Decousus H, Tapson VF, Bergmann JF, Chong BH, Froehlich JB, Kakkar AK, et al.",
"doi": "10.1378/chest.09-3081",
"id": "decousus-2011",
"pmid": "20453069",
"source": "Chest. 2011;139(1):69-79",
"title": "Factors at admission associated with bleeding risk in medical patients: findings from the IMPROVE investigators"
},
"components": [
{
"factor": "active_gastroduodenal_ulcer",
"points": 0,
"present": false
},
{
"factor": "prior_bleeding",
"points": 0,
"present": false
},
{
"factor": "platelet_count_lt_50",
"points": 0,
"present": false
},
{
"factor": "age_ge_85",
"points": 0,
"present": false,
"value": 35
},
{
"factor": "hepatic_failure",
"points": 0,
"present": false
},
{
"factor": "severe_renal_failure",
"points": 0,
"present": false
},
{
"factor": "icu_ccu",
"points": 0,
"present": false
},
{
"factor": "central_venous_catheter",
"points": 0,
"present": false
},
{
"factor": "rheumatic_disease",
"points": 0,
"present": false
},
{
"factor": "current_cancer",
"points": 0,
"present": false
},
{
"factor": "age_40_84",
"points": 0,
"present": false,
"value": 35
},
{
"factor": "male_sex",
"points": 0,
"present": false
},
{
"factor": "moderate_renal_failure",
"points": 0,
"present": 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": "improve_bleed",
"formula_expression": "IMPROVE bleed (Decousus 2011 admission) = active_gastroduodenal_ulcer (4.5) + prior_bleeding (4) + platelet_count_lt_50 (4) + age>=85 (3.5) + hepatic_failure INR>1.5 (2.5) + severe_renal_failure GFR<30 (2.5) + icu_ccu (2.5) + central_venous_catheter (2) + rheumatic_disease (2) + current_cancer (2) + age 40-84 (1.5) + male (1) + moderate_renal_failure GFR 30-59 (1); max 30.5; <7 not_increased, >=7 increased; half-points not integer-rounded; not Hostler 2016; not IMPROVE VTE",
"max_score": 30.5,
"renal_failure": "none",
"score": 0,
"sex": "female"
},
{
"age_years": 35,
"bleed_band": "not_increased",
"citation": {
"authors": "Decousus H, Tapson VF, Bergmann JF, Chong BH, Froehlich JB, Kakkar AK, et al.",
"doi": "10.1378/chest.09-3081",
"id": "decousus-2011",
"pmid": "20453069",
"source": "Chest. 2011;139(1):69-79",
"title": "Factors at admission associated with bleeding risk in medical patients: findings from the IMPROVE investigators"
},
"components": [
{
"factor": "active_gastroduodenal_ulcer",
"points": 0,
"present": false
},
{
"factor": "prior_bleeding",
"points": 0,
"present": false
},
{
"factor": "platelet_count_lt_50",
"points": 0,
"present": false
},
{
"factor": "age_ge_85",
"points": 0,
"present": false,
"value": 35
},
{
"factor": "hepatic_failure",
"points": 0,
"present": false
},
{
"factor": "severe_renal_failure",
"points": 0,
"present": false
},
{
"factor": "icu_ccu",
"points": 0,
"present": false
},
{
"factor": "central_venous_catheter",
"points": 0,
"present": false
},
{
"factor": "rheumatic_disease",
"points": 0,
"present": false
},
{
"factor": "current_cancer",
"points": 0,
"present": false
},
{
"factor": "age_40_84",
"points": 0,
"present": false,
"value": 35
},
{
"factor": "male_sex",
"points": 0,
"present": false
},
{
"factor": "moderate_renal_failure",
"points": 0,
"present": 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": "improve_bleed",
"formula_expression": "IMPROVE bleed (Decousus 2011 admission) = active_gastroduodenal_ulcer (4.5) + prior_bleeding (4) + platelet_count_lt_50 (4) + age>=85 (3.5) + hepatic_failure INR>1.5 (2.5) + severe_renal_failure GFR<30 (2.5) + icu_ccu (2.5) + central_venous_catheter (2) + rheumatic_disease (2) + current_cancer (2) + age 40-84 (1.5) + male (1) + moderate_renal_failure GFR 30-59 (1); max 30.5; <7 not_increased, >=7 increased; half-points not integer-rounded; not Hostler 2016; not IMPROVE VTE",
"max_score": 30.5,
"renal_failure": "none",
"score": 0,
"sex": "female"
}
],
"path": "/api/calc/improve_bleed"
}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/improve_bleed' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"active_gastroduodenal_ulcer":false,"age":35,"central_venous_catheter":false,"current_cancer":false,"hepatic_failure":false,"icu_ccu":false,"platelet_count_lt_50":false,"prior_bleeding":false,"renal_failure":"none","rheumatic_disease":false,"sex":"female"},{"active_gastroduodenal_ulcer":false,"age":35,"central_venous_catheter":false,"current_cancer":false,"hepatic_failure":false,"icu_ccu":false,"platelet_count_lt_50":false,"prior_bleeding":false,"renal_failure":"none","rheumatic_disease":false,"sex":"female"}]}'
# 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/improve_bleed' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"active_gastroduodenal_ulcer":false,"age":35,"central_venous_catheter":false,"current_cancer":false,"hepatic_failure":false,"icu_ccu":false,"platelet_count_lt_50":false,"prior_bleeding":false,"renal_failure":"none","rheumatic_disease":false,"sex":"female"},{"active_gastroduodenal_ulcer":false,"age":35,"central_venous_catheter":false,"current_cancer":false,"hepatic_failure":false,"icu_ccu":false,"platelet_count_lt_50":false,"prior_bleeding":false,"renal_failure":"none","rheumatic_disease":false,"sex":"female"}]}' \
| 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%2Fimprove_bleed&method=POST
const res = await pay("https://api.magentlab.com/api/calc/improve_bleed", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"items": [
{
"active_gastroduodenal_ulcer": false,
"age": 35,
"central_venous_catheter": false,
"current_cancer": false,
"hepatic_failure": false,
"icu_ccu": false,
"platelet_count_lt_50": false,
"prior_bleeding": false,
"renal_failure": "none",
"rheumatic_disease": false,
"sex": "female"
},
{
"active_gastroduodenal_ulcer": false,
"age": 35,
"central_venous_catheter": false,
"current_cancer": false,
"hepatic_failure": false,
"icu_ccu": false,
"platelet_count_lt_50": false,
"prior_bleeding": false,
"renal_failure": "none",
"rheumatic_disease": false,
"sex": "female"
}
]
}),
});
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/improve_bleed",
json={
"items": [
{
"active_gastroduodenal_ulcer": False,
"age": 35,
"central_venous_catheter": False,
"current_cancer": False,
"hepatic_failure": False,
"icu_ccu": False,
"platelet_count_lt_50": False,
"prior_bleeding": False,
"renal_failure": "none",
"rheumatic_disease": False,
"sex": "female",
},
{
"active_gastroduodenal_ulcer": False,
"age": 35,
"central_venous_catheter": False,
"current_cancer": False,
"hepatic_failure": False,
"icu_ccu": False,
"platelet_count_lt_50": False,
"prior_bleeding": False,
"renal_failure": "none",
"rheumatic_disease": False,
"sex": "female",
},
],
},
)
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 | - | - | - |
| 11 h ago | Passed | 402 | 295 ms | $0.007 |
| 16 h ago | Passed | 402 | 237 ms | $0.007 |
| 21 h ago | Passed | 402 | 277 ms | $0.007 |
Show 10 older checks
| 26 h ago | Passed | 402 | 574 ms | $0.007 |
| 30 h ago | Passed | 402 | 397 ms | $0.007 |
| 35 h ago | Passed | 402 | 400 ms | $0.007 |
| 39 h ago | Passed | 402 | 243 ms | $0.007 |
| 43 h ago | Passed | 402 | 222 ms | $0.007 |
| 47 h ago | Passed | 402 | 150 ms | $0.007 |
| 2 days ago | Passed | 402 | 213 ms | $0.007 |
| 2 days ago | Passed | 402 | 161 ms | $0.007 |
| 3 days ago | Passed | 402 | 433 ms | $0.007 |
| 3 days ago | Passed | 402 | 144 ms | $0.007 |
History
| 11 Oct 2026 | Price changed from $0.005 to $0.007 |