# Serum Anion Gap Calculator (Emmett–Narins 1977)

> Serum Anion Gap Calculator (Emmett–Narins 1977) 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).

Computes serum anion gap from sodium, chloride, and bicarbonate (with optional potassium) using the Emmett–Narins 1977 formula, returning a deterministic arithmetic result with citation.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/anion_gap
- 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/serum-anion-gap-calculator-emmett-narins-1977-d7cb6f9b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_N32Q0LicrSxJef3AgZ81j

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-anion-gap-calculator-emmett-narins-1977-d7cb6f9b
```

Example prompt: Calculate the serum anion gap without potassium using the Emmett–Narins formula for a patient with sodium 138 mmol/L, chloride 100 mmol/L, and bicarbonate 22 mmol/L.

## When to prefer this

Use this endpoint when you need a deterministic, cited serum anion gap computation from raw electrolyte values and want explicit formula selection (with or without potassium). Prefer it over manual calculation when auditability and citation are important, or when embedding anion gap logic into a clinical decision pipeline. Do not use it if you need albumin-corrected (Figge/Fencl) gap, delta gap, or a diagnostic interpretation — this endpoint returns arithmetic only.

## Known failure modes

- Missing required formula parameter — endpoint requires explicit formula=without_k or formula=with_k
- Missing potassium when formula=with_k is specified
- Sodium, chloride, or bicarbonate values outside accepted physiological ranges (Na 110–160, Cl 70–130, HCO3 2–45 mmol/L)
- Potassium out of range (1.5–8.0 mmol/L) when with_k formula is used
- Payment failure (x402) if USDC balance is insufficient

## How this service works

Serum anion gap from sodium, chloride, and bicarbonate, with or without potassium. formula=without_k or formula=with_k is required; magent does not pick one. Deterministic Emmett–Narins 1977 arithmetic with citation. Not a diagnosis, albumin-corrected gap (Figge/Fencl), or delta gap.

## Output

Returns the calculated anion gap value in mmol/L, the formula variant applied (without_k: Na − Cl − HCO3, or with_k: Na + K − Cl − HCO3), and a citation to Emmett & Narins 1977. Does not produce a diagnosis, albumin-corrected gap, or delta gap.

## 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",
      "chloride_mmol_l",
      "bicarbonate_mmol_l",
      "formula"
     ],
     "properties": {
      "formula": {
       "enum": [
        "without_k",
        "with_k"
       ],
       "type": "string",
       "description": "without_k (Na - Cl - HCO3) or with_k (Na + K - Cl - HCO3). Required; magent does not pick one silently."
      },
      "sodium_mmol_l": {
       "type": "number",
       "description": "Serum sodium in mmol/L (110-160)."
      },
      "chloride_mmol_l": {
       "type": "number",
       "description": "Serum chloride in mmol/L (70-130)."
      },
      "potassium_mmol_l": {
       "type": "number",
       "description": "Serum potassium in mmol/L (1.5-8.0). Required when formula=with_k. Ignored when formula=without_k."
      },
      "bicarbonate_mmol_l": {
       "type": "number",
       "description": "Serum bicarbonate in mmol/L (2-45)."
      }
     }
    }
   },
   "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/anion_gap",
  "count": 2,
  "items": [
   {
    "formula": "without_k",
    "citation": {
     "id": "emmett-narins-1977",
     "doi": "10.1097/00005792-197701000-00002",
     "title": "Clinical use of the anion gap",
     "source": "Medicine (Baltimore). 1977;56(1):38-54",
     "authors": "Emmett M, Narins RG"
    },
    "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.",
    "sodium_mmol_l": 140,
    "chloride_mmol_l": 104,
    "anion_gap_mmol_l": 12,
    "bicarbonate_mmol_l": 24,
    "formula_expression": "anion_gap_mmol_l = sodium_mmol_l - chloride_mmol_l - bicarbonate_mmol_l"
   },
   {
    "formula": "without_k",
    "citation": {
     "id": "emmett-narins-1977",
     "doi": "10.1097/00005792-197701000-00002",
     "title": "Clinical use of the anion gap",
     "source": "Medicine (Baltimore). 1977;56(1):38-54",
     "authors": "Emmett M, Narins RG"
    },
    "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.",
    "sodium_mmol_l": 140,
    "chloride_mmol_l": 104,
    "anion_gap_mmol_l": 12,
    "bicarbonate_mmol_l": 24,
    "formula_expression": "anion_gap_mmol_l = sodium_mmol_l - chloride_mmol_l - bicarbonate_mmol_l"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/serum-anion-gap-calculator-emmett-narins-1977-d7cb6f9b/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)
