# Serum Osmolality Calculator (Worthley 1987 + Osmolar Gap)

> Serum Osmolality Calculator (Worthley 1987 + Osmolar Gap) 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).

Calculates estimated serum osmolality using the Worthley 1987 formula (2×Na + glucose/18 + BUN/2.8) and optionally computes the osmolar gap when a measured osmolality is provided.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/serum_osmolality
- 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/serum-osmolality-calculator-worthley-1987-osmolar-gap-f6029937
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qALGTWf11pwZOGGB5KAkO

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 serum-osmolality-calculator-worthley-1987-osmolar-gap-f6029937
```

Example prompt: Calculate the estimated serum osmolality for a patient with sodium 138 mmol/L, BUN 22 mg/dL, and glucose 108 mg/dL — and if the measured osmolality came back at 310 mOsm/kg, include the osmolar gap too.

## When to prefer this

Use this endpoint when you need a fast, deterministic, citation-backed serum osmolality calculation following the Worthley 1987 formula, especially when you also want an osmolar gap derived from a measured value. Prefer this over manual arithmetic to ensure correct unit conversions (glucose mmol/L support) and validated input ranges. Not a substitute for a freezing-point osmometer or clinical diagnosis.

## Known failure modes

- Missing required parameters (sodium_mmol_l or bun_mg_dl not provided) — returns validation error
- Sodium out of range (110–160 mmol/L) — returns range error
- BUN out of range (1–200 mg/dL) — returns range error
- Glucose out of range (50–1000 mg/dL or 2.8–55.5 mmol/L) — returns range error
- Measured osmolality out of range (200–400 mOsm/kg) — returns range error
- Payment not completed (x402 protocol) — returns 402 Payment Required

## How this service works

Worthley 1987 calculated serum osmolality: 2×Na + glucose/18 + BUN/2.8. Optional osmolar gap when a measured osm is supplied. Deterministic published arithmetic with citation; not a measured freezing-point osmometer or a diagnosis.

## Output

Returns the calculated serum osmolality in mOsm/kg using the Worthley 1987 formula (2×Na + glucose/18 + BUN/2.8). When a measured osmolality is supplied, also returns the osmolar gap (measured minus calculated). Includes citation metadata confirming the deterministic arithmetic used.

## 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": [
      "sodium_mmol_l",
      "bun_mg_dl"
     ],
     "properties": {
      "bun_mg_dl": {
       "type": "number",
       "description": "Blood urea nitrogen in mg/dL (1-200)."
      },
      "glucose_mg_dl": {
       "type": "number",
       "description": "Plasma glucose in mg/dL (50-1000). Provide this or glucose_mmol_l."
      },
      "sodium_mmol_l": {
       "type": "number",
       "description": "Serum sodium in mmol/L (110-160)."
      },
      "glucose_mmol_l": {
       "type": "number",
       "description": "Plasma glucose in mmol/L (2.8-55.5). Converted as mg/dL = mmol/L * 18.015."
      },
      "measured_osm_mosm_kg": {
       "type": "number",
       "description": "Measured serum osmolality in mOsm/kg (200-400). When supplied, osm_gap_mosm_kg is returned."
      }
     }
    }
   },
   "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/serum_osmolality",
  "count": 2,
  "items": [
   {
    "formula": "worthley",
    "citation": {
     "id": "worthley-1987",
     "doi": "10.1177/0310057X8701500214",
     "title": "For calculating osmolality, the simplest formula is the best",
     "source": "Anaesth Intensive Care. 1987;15(2):199-202",
     "authors": "Worthley LI, Guerin M, Pain RW"
    },
    "bun_mg_dl": 14,
    "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.",
    "glucose_mg_dl": 90,
    "sodium_mmol_l": 140,
    "formula_expression": "calculated_osm_mosm_kg = 2 * sodium_mmol_l + glucose_mg_dl / 18 + bun_mg_dl / 2.8",
    "calculated_osm_mosm_kg": 290
   },
   {
    "formula": "worthley",
    "citation": {
     "id": "worthley-1987",
     "doi": "10.1177/0310057X8701500214",
     "title": "For calculating osmolality, the simplest formula is the best",
     "source": "Anaesth Intensive Care. 1987;15(2):199-202",
     "authors": "Worthley LI, Guerin M, Pain RW"
    },
    "bun_mg_dl": 14,
    "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.",
    "glucose_mg_dl": 90,
    "sodium_mmol_l": 140,
    "formula_expression": "calculated_osm_mosm_kg = 2 * sodium_mmol_l + glucose_mg_dl / 18 + bun_mg_dl / 2.8",
    "calculated_osm_mosm_kg": 290
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/serum-osmolality-calculator-worthley-1987-osmolar-gap-f6029937/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)
