# HOMA-IR Calculator

> HOMA-IR 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-15).

Calculates the Homeostatic Model Assessment of Insulin Resistance (HOMA-IR) score from fasting glucose and fasting insulin values using the Matthews 1985 formula.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/homa_ir
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/homa-ir-calculator-fe31691d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aCrjsbTOWplq9TVaov76c

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 homa-ir-calculator-fe31691d
```

Example prompt: Can you calculate the HOMA-IR score for a patient with a fasting glucose of 95 mg/dL and a fasting insulin of 14 µU/mL?

## When to prefer this

Use this endpoint when you need a quick, standards-referenced HOMA-IR calculation (Matthews 1985) for a single patient or data record using either mg/dL or mmol/L glucose units. Prefer this over manual computation when glucose unit conversion reliability matters or when embedding clinical calculators in automated workflows. Not suitable when HOMA2 model precision or HOMA-B beta-cell function is required.

## Known failure modes

- Both glucose_mg_dl and glucose_mmol_l provided simultaneously — endpoint expects exactly one
- Glucose value out of range (mg/dL: 50–1000; mmol/L: 2.8–55.5) — validation error
- Insulin value out of range (0.1–500 µU/mL) — validation error
- Missing required insulin_uu_ml parameter — request rejected
- Missing glucose parameter entirely — request rejected

## How this service works

HOMA-IR as (fasting glucose in mmol/L × insulin in µU/mL) / 22.5 (Matthews et al. 1985). Provide glucose_mg_dl (50–1000) or glucose_mmol_l (2.8–55.5), not both; mg/dL converts as mmol/L = mg/dL / 18. Returns the approximation rounded to two decimals. Not HOMA-B, not the HOMA2 computer model, not a diabetes diagnosis, and not an insulin-resistance cutoff.

## Output

Returns a single HOMA-IR numeric value rounded to two decimal places, computed as (glucose in mmol/L × insulin in µU/mL) / 22.5. Does not include diagnostic interpretation, HOMA-B, or HOMA2 model output.

## 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": [
      "insulin_uu_ml"
     ],
     "properties": {
      "glucose_mg_dl": {
       "type": "number",
       "description": "Fasting plasma glucose in mg/dL (50-1000). Converted as mmol/L = mg/dL / 18. Provide this or glucose_mmol_l, not both."
      },
      "insulin_uu_ml": {
       "type": "number",
       "description": "Fasting insulin in µU/mL (= mU/L) (0.1-500)."
      },
      "glucose_mmol_l": {
       "type": "number",
       "description": "Fasting plasma glucose in mmol/L (2.8-55.5). Provide this or glucose_mg_dl, not both."
      }
     }
    }
   },
   "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/homa_ir",
  "count": 2,
  "items": [
   {
    "formula": "homa_ir",
    "homa_ir": 2.22,
    "citation": {
     "id": "matthews-1985",
     "doi": "10.1007/BF00280883",
     "title": "Homeostasis model assessment: insulin resistance and beta-cell function from fasting plasma glucose and insulin concentrations in man",
     "source": "Diabetologia. 1985;28(7):412-419",
     "authors": "Matthews DR, Hosker JP, Rudenski AS, Naylor BA, Treacher DF, Turner RC"
    },
    "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.",
    "insulin_uu_ml": 10,
    "glucose_mmol_l": 5,
    "formula_expression": "homa_ir = (glucose_mmol_l * insulin_uu_ml) / 22.5"
   },
   {
    "formula": "homa_ir",
    "homa_ir": 2.22,
    "citation": {
     "id": "matthews-1985",
     "doi": "10.1007/BF00280883",
     "title": "Homeostasis model assessment: insulin resistance and beta-cell function from fasting plasma glucose and insulin concentrations in man",
     "source": "Diabetologia. 1985;28(7):412-419",
     "authors": "Matthews DR, Hosker JP, Rudenski AS, Naylor BA, Treacher DF, Turner RC"
    },
    "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.",
    "insulin_uu_ml": 10,
    "glucose_mmol_l": 5,
    "formula_expression": "homa_ir = (glucose_mmol_l * insulin_uu_ml) / 22.5"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/homa-ir-calculator-fe31691d/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)
