# HAS-BLED Score Calculator

> HAS-BLED Score 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-10-12).

Computes the HAS-BLED bleeding risk score for patients with atrial fibrillation from discrete clinical flags

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/has_bled?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/has-bled-score-calculator-5686cd87
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4ds3UKCcyev4YGR7PRIer

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 has-bled-score-calculator-5686cd87
```

Example prompt: Calculate the HAS-BLED bleeding risk score for a 68-year-old patient with uncontrolled hypertension and a prior stroke, no abnormal renal or liver function, no bleeding history, labile INR, taking an antiplatelet agent, and no alcohol excess.

## When to prefer this

Use this endpoint when you need a deterministic, citation-backed HAS-BLED bleeding risk score for an atrial fibrillation patient — particularly when deciding whether to initiate or continue anticoagulation therapy. Prefer this over general-purpose LLM reasoning for clinical scoring, as it guarantees the published formula is applied correctly and consistently.

## Known failure modes

- Missing required query parameters returns a 400 error
- Age outside valid range (18–120) causes a validation error
- Non-boolean values passed to boolean fields cause a schema validation error
- Payment not included or insufficient USDC causes a 402 Payment Required response

## How this service works

Deterministic published-formula arithmetic plus ICD-10-CM, RxNorm, and LOINC. Pay in USDC on Base via x402.

## Output

Returns the computed HAS-BLED score (integer 0–9) based on the nine clinical flags, along with a risk interpretation (e.g., low, moderate, or high bleeding risk) and a citation to the published scoring system.

## 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",
      "hypertension",
      "abnormal_renal",
      "abnormal_liver",
      "stroke",
      "bleeding",
      "labile_inr",
      "drugs",
      "alcohol"
     ],
     "properties": {
      "age": {
       "type": "integer",
       "description": "Age in years (18-120). Age >65 scores 1 (E)."
      },
      "drugs": {
       "type": "boolean",
       "description": "Concomitant antiplatelet or NSAID (D). true or false."
      },
      "stroke": {
       "type": "boolean",
       "description": "Prior stroke (S). true or false."
      },
      "alcohol": {
       "type": "boolean",
       "description": "Alcohol excess (D). true or false. Drugs and alcohol each score 1."
      },
      "bleeding": {
       "type": "boolean",
       "description": "Bleeding history or predisposition (B). true or false."
      },
      "labile_inr": {
       "type": "boolean",
       "description": "Labile INR (L). true or false."
      },
      "hypertension": {
       "type": "boolean",
       "description": "Uncontrolled hypertension (H). true or false."
      },
      "abnormal_liver": {
       "type": "boolean",
       "description": "Abnormal liver function (A). true or false. Renal and liver each score 1."
      },
      "abnormal_renal": {
       "type": "boolean",
       "description": "Abnormal renal function (A). true or false."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/has_bled",
  "count": 2,
  "items": [
   {
    "score": 2,
    "formula": "has_bled",
    "citation": {
     "id": "pisters-2010",
     "doi": "10.1378/chest.10-0134",
     "title": "A novel user-friendly score (HAS-BLED) to assess 1-year risk of major bleeding in patients with atrial fibrillation: the Euro Heart Survey",
     "source": "Chest. 2010;138(5):1093-1100",
     "authors": "Pisters R, Lane DA, Nieuwlaat R, de Vos CB, Crijns HJ, Lip GYH"
    },
    "age_years": 78,
    "max_score": 9,
    "components": [
     {
      "factor": "hypertension",
      "points": 1,
      "present": true
     },
     {
      "factor": "abnormal_renal",
      "points": 0,
      "present": false
     },
     {
      "factor": "abnormal_liver",
      "points": 0,
      "present": false
     },
     {
      "factor": "stroke",
      "points": 0,
      "present": false
     },
     {
      "factor": "bleeding",
      "points": 0,
      "present": false
     },
     {
      "factor": "labile_inr",
      "points": 0,
      "present": false
     },
     {
      "value": 78,
      "factor": "elderly_age_gt_65",
      "points": 1,
      "present": true
     },
     {
      "factor": "drugs",
      "points": 0,
      "present": false
     },
     {
      "factor": "alcohol",
      "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_expression": "HAS-BLED = hypertension + abnormal_renal + abnormal_liver + stroke + bleeding + labile_inr + elderly(age>65) + drugs + alcohol; max 9"
   },
   {
    "score": 2,
    "formula": "has_bled",
    "citation": {
     "id": "pisters-2010",
     "doi": "10.1378/chest.10-0134",
     "title": "A novel user-friendly score (HAS-BLED) to assess 1-year risk of major bleeding in patients with atrial fibrillation: the Euro Heart Survey",
     "source": "Chest. 2010;138(5):1093-1100",
     "authors": "Pisters R, Lane DA, Nieuwlaat R, de Vos CB, Crijns HJ, Lip GYH"
    },
    "age_years": 78,
    "max_score": 9,
    "components": [
     {
      "factor": "hypertension",
      "points": 1,
      "present": true
     },
     {
      "factor": "abnormal_renal",
      "points": 0,
      "present": false
     },
     {
      "factor": "abnormal_liver",
      "points": 0,
      "present": false
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/has-bled-score-calculator-5686cd87/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)
