# Khan 2019 PCP-HF 10-Year Incident Heart Failure Risk Calculator

> Khan 2019 PCP-HF 10-Year Incident Heart Failure Risk Calculator is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Computes 10-year incident heart failure risk percent (ages 30-79) using Khan 2019 Table 2 PCP-HF coefficients, stratified by sex and caller-assigned white or black cohort.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/pcp_hf
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/khan-2019-pcp-hf-10-year-incident-heart-failure-risk-calculator-9a89b7ce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rz9b2rHyyymvqInHvOm6a

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability khan-2019-pcp-hf-10-year-incident-heart-failure-risk-calculator-9a89b7ce
```

Example prompt: Using the Khan 2019 PCP-HF model, calculate the 10-year heart failure risk for a 58-year-old male in the white cohort with a systolic BP of 148 mmHg (on antihypertensive medication), fasting glucose of 105 mg/dL (no diabetes medication), BMI of 29.4 kg/m2, total cholesterol 210 mg/dL, HDL 42 mg/dL, non-smoker, and QRS duration of 94 ms.

## When to prefer this

Choose this endpoint when you need to implement the specific Khan 2019 PCP-HF Table 2 model for 10-year heart failure risk in a primary care context for adults aged 30-79, and you have all 12 required clinical inputs including QRS duration. Do not use for PREVENT 2024, PCE 2013, diagnosis, or treatment orders. Prefer this over generic cardiovascular calculators when HF-specific risk (not ASCVD) is the clinical question.

## Known failure modes

- Age outside 30-79 range is rejected
- Cohort value other than 'white' or 'black' is rejected
- SBP outside 50-250 mmHg range causes validation error
- QRS outside 40-300 ms range causes validation error
- Missing any required query parameter returns an error
- BMI outside 10-80 kg/m2 range is rejected
- HDL or cholesterol outside valid bounds causes error
- Payment not provided or insufficient USDC results in 402 response

## How this service works

Khan 2019 PCP-HF 10-year incident heart-failure percent for age 30-79 from sex, caller-assigned white or black cohort, treated or untreated systolic BP and fasting glucose, total and HDL cholesterol, BMI, smoking, and QRS duration. Table 2 coefficients. Caller assigns cohort; magent does not assign race. Not PREVENT 2024, not 2013 PCE, not a diagnosis or treatment order. magent does not assay lipids, measure blood pressure, or interpret an ECG.

## Output

Returns the 10-year incident heart failure risk as a percentage, computed from Khan 2019 Table 2 PCP-HF coefficients using the supplied sex- and cohort-specific model terms including log-transformed age, SBP, glucose, BMI, cholesterol, HDL, QRS, and binary smoking and treatment flags.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "age",
      "sex",
      "cohort",
      "sbp_mm_hg",
      "antihypertensive",
      "glucose_mg_dl",
      "diabetes_medication",
      "bmi_kg_m2",
      "total_cholesterol_mg_dl",
      "hdl_mg_dl",
      "smoker",
      "qrs_ms"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (integer 30-79). Khan 2019 Table 2 10-year incident HF is for ages 30-79. magent does not take a date of birth."
      },
      "sex": {
       "enum": [
        "female",
        "male"
       ],
       "type": "string",
       "description": "Sex used by the sex-specific Table 2 coefficients (female or male). Not cohort."
      },
      "cohort": {
       "enum": [
        "white",
        "black"
       ],
       "type": "string",
       "description": "Caller-assigned cohort as used in Khan 2019 Table 2: white or black (paper terms). Not param race. magent does not assign race or ethnicity. Other strings are rejected."
      },
      "qrs_ms": {
       "type": "number",
       "description": "QRS duration in ms (40-300). Enters as ln(QRS). magent does not interpret an ECG."
      },
      "smoker": {
       "type": "boolean",
       "description": "Current cigarette smoking as assigned by the caller (true or false). Adds the Table 2 smoker term and ln(age) × smoker when that cell is not N/A. magent does not take a smoking history."
      },
      "bmi_kg_m2": {
       "type": "number",
       "description": "Body-mass index in kg/m2 (10-80). Enters as ln(BMI) and ln(age)×ln(BMI) when that Table 2 cell is not N/A. magent does not measure height or weight."
      },
      "hdl_mg_dl": {
       "type": "number",
       "description": "HDL cholesterol in mg/dL (5-150). Enters as ln(HDL-C) when that Table 2 cell is not N/A. magent does not assay lipids."
      },
      "sbp_mm_hg": {
       "type": "number",
       "description": "Systolic blood pressure
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/khan-2019-pcp-hf-10-year-incident-heart-failure-risk-calculator-9a89b7ce/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
