Calc Berlin Ards
by magent in Other
Berlin Definition of ARDS (Ranieri 2012). berlin_ards iff clinical box (onset within 1 week, bilateral opacities not fully explained, origin not fully HF or fluid) and severity mild, moderate, or severe. Severe: PF<=100 with PEEP>=5. Moderate: 100<PF<=200 with PEEP>=5. Mild: 200<PF<=300 with PEEP or CPAP>=5. Caller assigns flags and pf_ratio. magent does not read radiographs or echo, diagnose ARDS, or set ventilator mode. Not AECC 1994, not Kigali, not the oxygenation index.
https://api.magentlab.com/api/calc/berlin_ards- Price
- $0.007
- per call in USDC
- Uptime
- 91.4%
- last 30 days
- Response time
- 163 ms
- 532 ms slowest 5%
- Last check
- Failed
- 5 h ago, next any minute now
Reliability
Latest check failed 5 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/berlin_ards
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/berlin_ards
content-type: application/json
{
"items": [
{
"bilateral_opacities_not_fully_explained": true,
"cpap_ge_5": false,
"onset_within_1_week": true,
"origin_not_fully_hf_or_fluid": true,
"peep_ge_5": true,
"pf_ratio": 90
},
{
"bilateral_opacities_not_fully_explained": true,
"cpap_ge_5": false,
"onset_within_1_week": true,
"origin_not_fully_hf_or_fluid": true,
"peep_ge_5": true,
"pf_ratio": 90
}
]
}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, 122 lines
{
"count": 2,
"items": [
{
"berlin_ards": true,
"citation": {
"authors": "The ARDS Definition Task Force; Ranieri VM, Rubenfeld GD, Thompson BT, Ferguson ND, Caldwell E, Fan E, Camporota L, Slutsky AS",
"doi": "10.1001/jama.2012.5669",
"id": "ranieri-2012",
"pmid": "22797452",
"source": "JAMA. 2012;307(23):2526-2533",
"title": "Acute respiratory distress syndrome: the Berlin Definition"
},
"clinical_box": true,
"criteria": [
{
"factor": "onset_within_1_week",
"met": true
},
{
"factor": "bilateral_opacities_not_fully_explained",
"met": true
},
{
"factor": "origin_not_fully_hf_or_fluid",
"met": true
},
{
"factor": "clinical_box",
"met": true
},
{
"factor": "peep_ge_5",
"met": true
},
{
"factor": "cpap_ge_5",
"met": false
},
{
"factor": "severe",
"met": true,
"value": 90
},
{
"factor": "moderate",
"met": false,
"value": 90
},
{
"factor": "mild",
"met": false,
"value": 90
}
],
"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": "berlin_ards",
"formula_expression": "clinical_box iff onset_within_1_week and bilateral_opacities_not_fully_explained and origin_not_fully_hf_or_fluid; severe iff clinical_box and pf_ratio <= 100 and peep_ge_5; moderate iff clinical_box and 100 < pf_ratio <= 200 and peep_ge_5; mild iff clinical_box and 200 < pf_ratio <= 300 and (peep_ge_5 or cpap_ge_5); berlin_ards iff severity is mild, moderate, or severe; else none (Ranieri 2012 Berlin Definition)",
"pf_ratio": 90,
"severity": "severe"
},
{
"berlin_ards": true,
"citation": {
"authors": "The ARDS Definition Task Force; Ranieri VM, Rubenfeld GD, Thompson BT, Ferguson ND, Caldwell E, Fan E, Camporota L, Slutsky AS",
"doi": "10.1001/jama.2012.5669",
"id": "ranieri-2012",
"pmid": "22797452",
"source": "JAMA. 2012;307(23):2526-2533",
"title": "Acute respiratory distress syndrome: the Berlin Definition"
},
"clinical_box": true,
"criteria": [
{
"factor": "onset_within_1_week",
"met": true
},
{
"factor": "bilateral_opacities_not_fully_explained",
"met": true
},
{
"factor": "origin_not_fully_hf_or_fluid",
"met": true
},
{
"factor": "clinical_box",
"met": true
},
{
"factor": "peep_ge_5",
"met": true
},
{
"factor": "cpap_ge_5",
"met": false
},
{
"factor": "severe",
"met": true,
"value": 90
},
{
"factor": "moderate",
"met": false,
"value": 90
},
{
"factor": "mild",
"met": false,
"value": 90
}
],
"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": "berlin_ards",
"formula_expression": "clinical_box iff onset_within_1_week and bilateral_opacities_not_fully_explained and origin_not_fully_hf_or_fluid; severe iff clinical_box and pf_ratio <= 100 and peep_ge_5; moderate iff clinical_box and 100 < pf_ratio <= 200 and peep_ge_5; mild iff clinical_box and 200 < pf_ratio <= 300 and (peep_ge_5 or cpap_ge_5); berlin_ards iff severity is mild, moderate, or severe; else none (Ranieri 2012 Berlin Definition)",
"pf_ratio": 90,
"severity": "severe"
}
],
"path": "/api/calc/berlin_ards"
}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/berlin_ards' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"bilateral_opacities_not_fully_explained":true,"cpap_ge_5":false,"onset_within_1_week":true,"origin_not_fully_hf_or_fluid":true,"peep_ge_5":true,"pf_ratio":90},{"bilateral_opacities_not_fully_explained":true,"cpap_ge_5":false,"onset_within_1_week":true,"origin_not_fully_hf_or_fluid":true,"peep_ge_5":true,"pf_ratio":90}]}'
# 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/berlin_ards' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"bilateral_opacities_not_fully_explained":true,"cpap_ge_5":false,"onset_within_1_week":true,"origin_not_fully_hf_or_fluid":true,"peep_ge_5":true,"pf_ratio":90},{"bilateral_opacities_not_fully_explained":true,"cpap_ge_5":false,"onset_within_1_week":true,"origin_not_fully_hf_or_fluid":true,"peep_ge_5":true,"pf_ratio":90}]}' \
| 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%2Fberlin_ards&method=POST
const res = await pay("https://api.magentlab.com/api/calc/berlin_ards", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"items": [
{
"bilateral_opacities_not_fully_explained": true,
"cpap_ge_5": false,
"onset_within_1_week": true,
"origin_not_fully_hf_or_fluid": true,
"peep_ge_5": true,
"pf_ratio": 90
},
{
"bilateral_opacities_not_fully_explained": true,
"cpap_ge_5": false,
"onset_within_1_week": true,
"origin_not_fully_hf_or_fluid": true,
"peep_ge_5": true,
"pf_ratio": 90
}
]
}),
});
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/berlin_ards",
json={
"items": [
{
"bilateral_opacities_not_fully_explained": True,
"cpap_ge_5": False,
"onset_within_1_week": True,
"origin_not_fully_hf_or_fluid": True,
"peep_ge_5": True,
"pf_ratio": 90,
},
{
"bilateral_opacities_not_fully_explained": True,
"cpap_ge_5": False,
"onset_within_1_week": True,
"origin_not_fully_hf_or_fluid": True,
"peep_ge_5": True,
"pf_ratio": 90,
},
],
},
)
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 |
|---|---|---|---|---|
| 5 h ago | Timed out | - | - | - |
| 10 h ago | Timed out | - | - | - |
| 15 h ago | Timed out | - | - | - |
| 20 h ago | Passed | 402 | 142 ms | $0.007 |
| 25 h ago | Passed | 402 | 378 ms | $0.007 |
Show 10 older checks
| 29 h ago | Passed | 402 | 146 ms | $0.007 |
| 34 h ago | Passed | 402 | 146 ms | $0.007 |
| 39 h ago | Passed | 402 | 163 ms | $0.007 |
| 43 h ago | Passed | 402 | 272 ms | $0.007 |
| 47 h ago | Passed | 402 | 141 ms | $0.007 |
| 2 days ago | Passed | 402 | 271 ms | $0.007 |
| 2 days ago | Passed | 402 | 532 ms | $0.007 |
| 3 days ago | Passed | 402 | 241 ms | $0.007 |
| 3 days ago | Passed | 402 | 164 ms | $0.007 |
| 3 days ago | Passed | 402 | 206 ms | $0.007 |
History
| 11 Oct 2026 | Price changed from $0.005 to $0.007 |