Calc Capra
by magent in Other
Cooperberg 2005 UCSF CAPRA preoperative score (Table 1). Caller-assigned PSA (>=2.1-6 0, >6-10 1, >10-20 2, >20-30 3, >30 4), Gleason 1-3/1-3 0, 1-3/4-5 1, primary 4-5 3, clinical T t1/t2 0 or t3a 1, percent positive biopsies <34 0 or >=34 1, age <50 0 or >=50 1. Score 0-10. Table 4 bands 0_1, 2, 3, 4, 5, 6, ge_7 with 5-year RFS 85/81/66/59/60/34/8. Not Kattan. Not D'Amico. Not CAPRA-S. magent does not assay PSA or read biopsies. Not a diagnosis. Not a medical device.
https://api.magentlab.com/api/calc/capra- Price
- $0.007
- per call in USDC
- Uptime
- 100%
- last 30 days
- Response time
- 158 ms
- 448 ms slowest 5%
- Last check
- Passed
- 3 h 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/capra
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/capra
content-type: application/json
{
"items": [
{
"age": 62,
"gleason_primary": 3,
"gleason_secondary": 3,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"t_stage": "t1"
},
{
"age": 62,
"gleason_primary": 3,
"gleason_secondary": 3,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"t_stage": "t1"
}
]
}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, 116 lines
{
"count": 2,
"items": [
{
"age_years": 62,
"band": "0_1",
"citation": {
"authors": "Cooperberg MR, Pasta DJ, Elkin EP, Litwin MS, Latini DM, Du Chane J, Carroll PR",
"doi": "10.1097/01.ju.0000158155.33890.e7",
"id": "cooperberg-2005",
"pmid": "15879786",
"source": "J Urol. 2005;173(6):1938-1942",
"title": "The University of California, San Francisco Cancer of the Prostate Risk Assessment score: a straightforward and reliable preoperative predictor of disease recurrence after radical prostatectomy"
},
"components": [
{
"factor": "psa_ng_ml",
"points": 0,
"present": true,
"value": 5
},
{
"factor": "gleason",
"points": 0,
"present": true,
"value": "3+3"
},
{
"factor": "t_stage",
"points": 0,
"present": true,
"value": "t1"
},
{
"factor": "percent_positive_biopsies",
"points": 0,
"present": true,
"value": 20
},
{
"factor": "age",
"points": 1,
"present": true,
"value": 62
}
],
"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": "capra",
"formula_expression": "CAPRA (Cooperberg 2005 Table 1) = psa_ng_ml (>=2.1 and <=6.0 0, >6.0 and <=10.0 1, >10.0 and <=20.0 2, >20.0 and <=30.0 3, >30 4; PSA <2.1 excluded) + gleason (primary/secondary 1-3/1-3 0, 1-3/4-5 1, primary 4-5 3) + t_stage (t1 or t2 0, t3a 1) + percent_positive_biopsies (<34 0, >=34 1) + age (<50 0, >=50 1); score 0-10; Table 4 Kaplan-Meier bands 0_1 / 2 / 3 / 4 / 5 / 6 / ge_7 with 5-year RFS 85 / 81 / 66 / 59 / 60 / 34 / 8. Not Kattan nomogram. Not D'Amico groups. Not CAPRA-S",
"gleason_primary": 3,
"gleason_secondary": 3,
"max_score": 10,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"rfs_5y_percent": 85,
"score": 1,
"t_stage": "t1"
},
{
"age_years": 62,
"band": "0_1",
"citation": {
"authors": "Cooperberg MR, Pasta DJ, Elkin EP, Litwin MS, Latini DM, Du Chane J, Carroll PR",
"doi": "10.1097/01.ju.0000158155.33890.e7",
"id": "cooperberg-2005",
"pmid": "15879786",
"source": "J Urol. 2005;173(6):1938-1942",
"title": "The University of California, San Francisco Cancer of the Prostate Risk Assessment score: a straightforward and reliable preoperative predictor of disease recurrence after radical prostatectomy"
},
"components": [
{
"factor": "psa_ng_ml",
"points": 0,
"present": true,
"value": 5
},
{
"factor": "gleason",
"points": 0,
"present": true,
"value": "3+3"
},
{
"factor": "t_stage",
"points": 0,
"present": true,
"value": "t1"
},
{
"factor": "percent_positive_biopsies",
"points": 0,
"present": true,
"value": 20
},
{
"factor": "age",
"points": 1,
"present": true,
"value": 62
}
],
"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": "capra",
"formula_expression": "CAPRA (Cooperberg 2005 Table 1) = psa_ng_ml (>=2.1 and <=6.0 0, >6.0 and <=10.0 1, >10.0 and <=20.0 2, >20.0 and <=30.0 3, >30 4; PSA <2.1 excluded) + gleason (primary/secondary 1-3/1-3 0, 1-3/4-5 1, primary 4-5 3) + t_stage (t1 or t2 0, t3a 1) + percent_positive_biopsies (<34 0, >=34 1) + age (<50 0, >=50 1); score 0-10; Table 4 Kaplan-Meier bands 0_1 / 2 / 3 / 4 / 5 / 6 / ge_7 with 5-year RFS 85 / 81 / 66 / 59 / 60 / 34 / 8. Not Kattan nomogram. Not D'Amico groups. Not CAPRA-S",
"gleason_primary": 3,
"gleason_secondary": 3,
"max_score": 10,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"rfs_5y_percent": 85,
"score": 1,
"t_stage": "t1"
}
],
"path": "/api/calc/capra"
}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/capra' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":62,"gleason_primary":3,"gleason_secondary":3,"percent_positive_biopsies":20,"psa_ng_ml":5,"t_stage":"t1"},{"age":62,"gleason_primary":3,"gleason_secondary":3,"percent_positive_biopsies":20,"psa_ng_ml":5,"t_stage":"t1"}]}'
# 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/capra' \
-H 'content-type: application/json' \
--data-raw '{"items":[{"age":62,"gleason_primary":3,"gleason_secondary":3,"percent_positive_biopsies":20,"psa_ng_ml":5,"t_stage":"t1"},{"age":62,"gleason_primary":3,"gleason_secondary":3,"percent_positive_biopsies":20,"psa_ng_ml":5,"t_stage":"t1"}]}' \
| 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%2Fcapra&method=POST
const res = await pay("https://api.magentlab.com/api/calc/capra", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"items": [
{
"age": 62,
"gleason_primary": 3,
"gleason_secondary": 3,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"t_stage": "t1"
},
{
"age": 62,
"gleason_primary": 3,
"gleason_secondary": 3,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"t_stage": "t1"
}
]
}),
});
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/capra",
json={
"items": [
{
"age": 62,
"gleason_primary": 3,
"gleason_secondary": 3,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"t_stage": "t1",
},
{
"age": 62,
"gleason_primary": 3,
"gleason_secondary": 3,
"percent_positive_biopsies": 20,
"psa_ng_ml": 5,
"t_stage": "t1",
},
],
},
)
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 |
|---|---|---|---|---|
| 3 h ago | Passed | 402 | 152 ms | $0.007 |
| 8 h ago | Passed | 402 | 152 ms | $0.007 |
| 12 h ago | Passed | 402 | 149 ms | $0.007 |
| 17 h ago | Passed | 402 | 148 ms | $0.007 |
| 22 h ago | Passed | 402 | 246 ms | $0.007 |
Show 10 older checks
| 26 h ago | Passed | 402 | 292 ms | $0.007 |
| 30 h ago | Passed | 402 | 244 ms | $0.007 |
| 34 h ago | Passed | 402 | 184 ms | $0.007 |
| 39 h ago | Passed | 402 | 198 ms | $0.007 |
| 43 h ago | Passed | 402 | 147 ms | $0.007 |
| 47 h ago | Passed | 402 | 448 ms | $0.007 |
| 2 days ago | Passed | 402 | 156 ms | $0.007 |
| 2 days ago | Passed | 402 | 236 ms | $0.007 |
| 3 days ago | Passed | 402 | 137 ms | $0.007 |
| 3 days ago | Passed | 402 | 280 ms | $0.007 |
History
| 11 Oct 2026 | Price changed from $0.005 to $0.007 |