MAGENT

Kidney · LIVE

UCSF CAPRA score (Cooperberg 2005)

CAPRA

Apply Cooperberg 2005 Table 1 CAPRA points from caller-assigned preoperative PSA, Gleason primary/secondary, clinical T (t1/t2/t3a), percent positive biopsies, and age, and return the 0-10 score, Table 4 Kaplan-Meier band, and Table 4 5-year recurrence-free survival point estimate. Not a diagnosis.

LIVE $0.005 USDC GET /api/calc/capra

Markdown: /docs/capra.md · Canonical: https://magentlab.com/docs/capra

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Apply Cooperberg 2005 Table 1 CAPRA points from caller-assigned preoperative PSA, Gleason primary/secondary, clinical T (t1/t2/t3a), percent positive biopsies, and age, and return the 0-10 score, Table 4 Kaplan-Meier band, and Table 4 5-year recurrence-free survival point estimate. Not a diagnosis.

When to use

When an agent already has caller-assigned preoperative PSA, Gleason patterns, clinical T (t1, t2, or t3a), percent positive biopsies, and age, and needs the published UCSF CAPRA score. magent does not assay PSA or read biopsies. Not the Kattan nomogram, not D'Amico groups, and not CAPRA-S.

When not to use

  • Not a medical device and not a diagnosis of prostate cancer. magent does not assay PSA or read biopsies.
  • Cooperberg 2005 Table 1 preoperative CAPRA only (score 0-10). Not the Kattan nomogram. Not D'Amico risk groups. Not CAPRA-S (postoperative).
  • PSA <2.1 ng/mL is invalid (the derivation excluded PSA <2). Upper bound 500. magent does not assay PSA.
  • Gleason primary and secondary are caller-assigned integers 1-5. magent does not read biopsies or assign Gleason grade.
  • t_stage is caller-assigned clinical T: t1 or t2 (0 points) or t3a (1 point). Other stages are out of scope. magent does not assign TNM.
  • Bands are Cooperberg 2005 Table 4 Kaplan-Meier groups only (0_1, 2, 3, 4, 5, 6, ge_7). rfs_5y_percent is that table's point estimate, not a computed survival curve.

Formula

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

Citation

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
Authors
Cooperberg MR, Pasta DJ, Elkin EP, Litwin MS, Latini DM, Du Chane J, Carroll PR
Source
J Urol. 2005;173(6):1938-1942
DOI
10.1097/01.ju.0000158155.33890.e7

Worked example

Age 62, PSA 5.0, Gleason 3+3, T1, 20% positive cores

Given: age=62gleason_primary=3gleason_secondary=3percent_positive_biopsies=20psa_ng_ml=5.0t_stage=t1

  1. age 62 >=50 → 1; psa 5.0 in >=2.1-6.0 → 0; Gleason 3+3 (1-3/1-3) → 0; t1 → 0; percent 20 <34 → 0
  2. score = 1; band 0_1; rfs_5y_percent 85

High-risk Table 1 inputs score 10

Given: age=62gleason_primary=4gleason_secondary=4percent_positive_biopsies=50psa_ng_ml=35t_stage=t3a

  1. age 62 → 1; psa 35 >30 → 4; Gleason 4+4 primary 4-5 → 3; t3a → 1; percent 50 >=34 → 1
  2. score = 10; band ge_7; rfs_5y_percent 8

Also searched as

  • CAPRA
  • UCSF CAPRA
  • Cooperberg CAPRA
  • Cancer of the Prostate Risk Assessment
  • preoperative CAPRA
  • CAPRA score
  • Cooperberg 2005
  • prostate CAPRA
  • not CAPRA-S

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/capra?age=62&psa_ng_ml=5.0&gleason_primary=3&gleason_secondary=3&t_stage=t1&percent_positive_biopsies=20

Full URL: https://api.magentlab.com/api/calc/capra?age=62&psa_ng_ml=5.0&gleason_primary=3&gleason_secondary=3&t_stage=t1&percent_positive_biopsies=20

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/capra?age=62&psa_ng_ml=5.0&gleason_primary=3&gleason_secondary=3&t_stage=t1&percent_positive_biopsies=20"

Parameters

Name Type Required Description
age integer required Age in years (18-120, Params.age). Cooperberg 2005 Table 1: <50 scores 0; >=50 scores 1.
psa_ng_ml number required Preoperative PSA in ng/mL as assigned by the caller (2.1-500). Cooperberg 2005 Table 1: >=2.1 and <=6.0 scores 0; >6.0 and <=10.0 scores 1; >10.0 and <=20.0 scores 2; >20.0 and <=30.0 scores 3; >30 scores 4. PSA <2.1 is invalid (paper excluded PSA <2). magent does not assay PSA.
gleason_primary integer required Primary Gleason pattern 1-5 as assigned by the caller (Cooperberg 2005 Table 1). Integer 1-5 only. Combined with gleason_secondary: 1-3/1-3 scores 0; 1-3/4-5 scores 1; primary 4-5 scores 3. magent does not read biopsies.
gleason_secondary integer required Secondary Gleason pattern 1-5 as assigned by the caller (Cooperberg 2005 Table 1). Integer 1-5 only. Combined with gleason_primary as above. magent does not read biopsies.
t_stage string required · t1, t2, t3a Clinical T as assigned by the caller (Cooperberg 2005 Table 1). t1 or t2 scores 0; t3a scores 1. Other stages are invalid. Not CAPRA-S pathologic T. magent does not assign TNM.
percent_positive_biopsies number required Percent of biopsy cores positive (0-100) as assigned by the caller (Cooperberg 2005 Table 1). <34 scores 0; >=34 scores 1. magent does not read biopsies.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/capra Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "age": "62",
      "gleason_primary": "3",
      "gleason_secondary": "3",
      "percent_positive_biopsies": "20",
      "psa_ng_ml": "5.0",
      "t_stage": "t1"
    },
    {
      "age": "62",
      "gleason_primary": "3",
      "gleason_secondary": "3",
      "percent_positive_biopsies": "20",
      "psa_ng_ml": "5.0",
      "t_stage": "t1"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/capra",
  "items": [
    {
      "band": "0_1",
      "components": [
        {
          "value": 5.0,
          "factor": "psa_ng_ml",
          "points": 0,
          "present": true
        },
        {
          "value": "3+3",
          "factor": "gleason",
          "points": 0,
          "present": true
        },
        {
          "value": "t1",
          "factor": "t_stage",
          "points": 0,
          "present": true
        },
        {
          "value": 20.0,
          "factor": "percent_positive_biopsies",
          "points": 0,
          "present": true
        },
        {
          "value": 62,
          "factor": "age",
          "points": 1,
          "present": true
        }
      ],
      "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.",
      "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"
      },
      "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",
      "age_years": 62,
      "max_score": 10,
      "score": 1,
      "gleason_primary": 3,
      "gleason_secondary": 3,
      "percent_positive_biopsies": 20.0,
      "psa_ng_ml": 5.0,
      "rfs_5y_percent": 85,
      "t_stage": "t1"
    },
    {
      "band": "0_1",
      "components": [
        {
          "value": 5.0,
          "factor": "psa_ng_ml",
          "points": 0,
          "present": true
        },
        {
          "value": "3+3",
          "factor": "gleason",
          "points": 0,
          "present": true
        },
        {
          "value": "t1",
          "factor": "t_stage",
          "points": 0,
          "present": true
        },
        {
          "value": 20.0,
          "factor": "percent_positive_biopsies",
          "points": 0,
          "present": true
        },
        {
          "value": 62,
          "factor": "age",
          "points": 1,
          "present": true
        }
      ],
      "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.",
      "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"
      },
      "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",
      "age_years": 62,
      "max_score": 10,
      "score": 1,
      "gleason_primary": 3,
      "gleason_secondary": 3,
      "percent_positive_biopsies": 20.0,
      "psa_ng_ml": 5.0,
      "rfs_5y_percent": 85,
      "t_stage": "t1"
    }
  ]
}

Response

Field Type Description
formula string capra
formula_expression string Cooperberg 2005 Table 1 CAPRA expression
score integer CAPRA points 0-10 (Cooperberg 2005 Table 1)
max_score integer 10
band string Cooperberg 2005 Table 4 Kaplan-Meier group: 0_1 (score 0-1), 2, 3, 4, 5, 6, or ge_7 (score >=7). Not Kattan. Not D'Amico. Not CAPRA-S.
rfs_5y_percent integer Cooperberg 2005 Table 4 5-year recurrence-free survival point estimate: 0-1 → 85; 2 → 81; 3 → 66; 4 → 59; 5 → 60; 6 → 34; >=7 → 8. A published cohort percent, not a computed Kaplan-Meier.
age_years integer Age used for Table 1 age points
psa_ng_ml number Caller-assigned preoperative PSA used for Table 1 PSA points
gleason_primary integer Caller-assigned primary Gleason pattern 1-5
gleason_secondary integer Caller-assigned secondary Gleason pattern 1-5
t_stage string Caller-assigned clinical T used (t1, t2, or t3a)
percent_positive_biopsies number Caller-assigned percent of biopsy cores positive (0-100)
components array Per-factor Cooperberg 2005 Table 1 points
citation object Cooperberg 2005 J Urol citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "band": "0_1",
  "components": [
    {
      "value": 5.0,
      "factor": "psa_ng_ml",
      "points": 0,
      "present": true
    },
    {
      "value": "3+3",
      "factor": "gleason",
      "points": 0,
      "present": true
    },
    {
      "value": "t1",
      "factor": "t_stage",
      "points": 0,
      "present": true
    },
    {
      "value": 20.0,
      "factor": "percent_positive_biopsies",
      "points": 0,
      "present": true
    },
    {
      "value": 62,
      "factor": "age",
      "points": 1,
      "present": true
    }
  ],
  "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.",
  "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"
  },
  "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",
  "age_years": 62,
  "max_score": 10,
  "score": 1,
  "gleason_primary": 3,
  "gleason_secondary": 3,
  "percent_positive_biopsies": 20.0,
  "psa_ng_ml": 5.0,
  "rfs_5y_percent": 85,
  "t_stage": "t1"
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_capra psa_ng_ml must be ≥2.1; gleason_primary and gleason_secondary integers 1–5; t_stage t1, t2, or t3a; percent_positive_biopsies 0–100 (Cooperberg 2005 CAPRA Table 1). Returned before settlement; you are not charged.
400 invalid_age age must be an integer from 18 to 120 Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • UISS — Apply the Zisman 2002 localized N0M0 three-group UISS algorithm to caller-assigned 1997 pathological T, Fuhrman grade, and ECOG PS and return low_risk, intermediate_risk, or high_risk. Does not compute a predicted 5-year disease-specific survival.
  • Fuhrman — Echo the caller-assigned Fuhrman 1982 nuclear grade (1-4) with the published nuclear-feature description. magent does not read slides. Not WHO/ISUP 2016.
  • R.E.N.A.L. nephrometry — Sum the Kutikov 2009 R.E.N.A.L. nephrometry score for a renal mass from four caller-assigned published item points (radius, exophytic/endophytic, nearness, location) and return the integer total (4–12) plus anterior and hilar descriptors. Does not return complexity bands.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /docs/mcp.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.