# Stool Osmotic Gap Calculator (Eherer–Fordtran 1992)

> Stool Osmotic Gap Calculator (Eherer–Fordtran 1992) 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 the fecal osmotic gap using the Eherer–Fordtran 1992 formula: stool osmolality minus 2×(stool Na + stool K), defaulting stool osm to 290 mOsm/kg if not provided.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/stool_osmotic_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/stool-osmotic-gap-calculator-eherer-fordtran-1992-63c72251
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pdMZ8V0ELDILkBXY0jwQS

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 stool-osmotic-gap-calculator-eherer-fordtran-1992-63c72251
```

Example prompt: Calculate the stool osmotic gap for a patient with stool sodium of 45 mmol/L and stool potassium of 20 mmol/L — use the assumed osmolality of 290 mOsm/kg since we don't have a measured value.

## When to prefer this

Choose this endpoint when you need a fast, deterministic, citation-backed fecal osmotic gap calculation from stool electrolytes following the Eherer–Fordtran 1992 method. Ideal for clinical decision-support pipelines, automated lab report enrichment, or bedside GI workup tools where a reliable published formula is required. Prefer this over manual calculation when stool osmolality may be missing and the 290 mOsm/kg default assumption is acceptable.

## Known failure modes

- Missing required stool_sodium_mmol_l or stool_potassium_mmol_l parameters returns a 400 error
- Values outside the accepted range (Na or K: 1–150 mmol/L; osm: 200–600 mOsm/kg) may be rejected or return an error
- Non-numeric inputs for any parameter will cause a validation failure
- Payment failure (402) if x402 USDC payment header is missing or rejected

## How this service works

Eherer–Fordtran 1992 fecal osmotic gap: stool osmolality minus 2×(stool Na + stool K). Assumed stool osm 290 mOsm/kg when measured osm is omitted. Deterministic published arithmetic with citation; not a diagnosis of osmotic versus secretory diarrhea.

## Output

Returns the computed fecal osmotic gap in mOsm/kg as a numeric value based on the Eherer–Fordtran 1992 formula (stool osmolality − 2 × [stool Na + stool K]), with stool osmolality defaulting to 290 mOsm/kg if not supplied. The result is a deterministic arithmetic output; it does not render a clinical diagnosis of osmotic vs. secretory diarrhea.

## 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": [
      "stool_sodium_mmol_l",
      "stool_potassium_mmol_l"
     ],
     "properties": {
      "stool_osm_mosm_kg": {
       "type": "number",
       "description": "Measured stool osmolality in mOsm/kg (200-600). When omitted, 290 mOsm/kg is assumed."
      },
      "stool_sodium_mmol_l": {
       "type": "number",
       "description": "Stool sodium in mmol/L (1-150)."
      },
      "stool_potassium_mmol_l": {
       "type": "number",
       "description": "Stool potassium in mmol/L (1-150)."
      }
     }
    }
   },
   "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/stool_osmotic_gap",
  "count": 2,
  "items": [
   {
    "formula": "eherer_fordtran",
    "citation": {
     "id": "eherer-fordtran-1992",
     "doi": "10.1016/0016-5085(92)90845-P",
     "title": "Fecal osmotic gap and pH in experimental diarrhea of various causes",
     "source": "Gastroenterology. 1992;103(2):545-551",
     "authors": "Eherer AJ, Fordtran JS"
    },
    "gap_gt_50": true,
    "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.",
    "osmotic_gap": 80,
    "stool_osm_mosm_kg": 290,
    "assumed_osmolality": true,
    "formula_expression": "osmotic_gap = stool_osm_mosm_kg - 2 * (stool_sodium_mmol_l + stool_potassium_mmol_l)",
    "stool_sodium_mmol_l": 30,
    "stool_potassium_mmol_l": 75
   },
   {
    "formula": "eherer_fordtran",
    "citation": {
     "id": "eherer-fordtran-1992",
     "doi": "10.1016/0016-5085(92)90845-P",
     "title": "Fecal osmotic gap and pH in experimental diarrhea of various causes",
     "source": "Gastroenterology. 1992;103(2):545-551",
     "authors": "Eherer AJ, Fordtran JS"
    },
    "gap_gt_50": true,
    "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.",
    "osmotic_gap": 80,
    "stool_osm_mosm_kg": 290,
    "assumed_osmolality": true,
    "formula_expression": "osmotic_gap = stool_osm_mosm_kg - 2 * (stool_sodium_mmol_l + stool_potassium_mmol_l)",
    "stool_sodium_mmol_l": 30,
    "stool_potassium_mmol_l": 75
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stool-osmotic-gap-calculator-eherer-fordtran-1992-63c72251/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)
