# SAAG Calculator (Serum-Ascites Albumin Gradient)

> SAAG Calculator (Serum-Ascites Albumin Gradient) 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 Serum-Ascites Albumin Gradient (SAAG) using Runyon 1992 criteria and flags portal hypertension physiology when SAAG ≥ 1.1 g/dL

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/saag
- 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/saag-calculator-serum-ascites-albumin-gradient-6e73e3f9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_u0OoQksov9JWPm1dgQmOf

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 saag-calculator-serum-ascites-albumin-gradient-6e73e3f9
```

Example prompt: Calculate the SAAG for my patient whose serum albumin is 3.8 g/dL and ascites albumin is 1.4 g/dL — does the gradient suggest portal hypertension physiology?

## When to prefer this

Use this endpoint when you need a fast, deterministic SAAG calculation per Runyon 1992 for portal hypertension physiology classification. Prefer it over generic lab calculators when you need explicit portal_hypertension_physiology boolean output. Note: this does NOT apply Light criteria (exudate/transudate) — use the sibling Light 1972 pleural fluid endpoint for pleural effusions. Best for hepatology, gastroenterology, or hospitalist workflows requiring ascites etiology triage.

## Known failure modes

- Missing required albumin inputs — returns error if neither serum albumin field is provided
- Both unit variants provided for the same parameter (e.g., albumin_g_dl and albumin_g_l simultaneously) — rejected as conflicting input
- Values outside physiological range (e.g., serum albumin below 1 g/dL or above 6 g/dL) may return validation error
- Ascites albumin exceeding serum albumin is physiologically unusual but accepted; gradient may be negative
- Payment failure via x402 protocol returns 402 status before computation occurs

## How this service works

Runyon 1992 SAAG as serum albumin minus ascites albumin in g/dL, rounded to one decimal. portal_hypertension_physiology is true when SAAG >= 1.1 g/dL. Gradient only; not Light-style exudate/transudate criteria for ascites. Not a diagnosis. magent does not diagnose portal hypertension or peritonitis. Serum and ascites albumin as g/dL or g/L.

## Output

Returns the calculated SAAG value in g/dL rounded to one decimal place and a boolean portal_hypertension_physiology flag (true when SAAG ≥ 1.1 g/dL). Does not diagnose portal hypertension, peritonitis, or classify by Light criteria.

## 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": [],
     "properties": {
      "albumin_g_l": {
       "type": "number",
       "description": "Serum albumin in g/L (10-60). Converted as g/dL = g/L / 10. Provide this or albumin_g_dl, not both."
      },
      "albumin_g_dl": {
       "type": "number",
       "description": "Serum albumin in g/dL (1-6). Provide this or albumin_g_l, not both."
      },
      "ascites_albumin_g_l": {
       "type": "number",
       "description": "Ascites albumin in g/L (1-60). Converted as g/dL = g/L / 10. Provide this or ascites_albumin_g_dl, not both."
      },
      "ascites_albumin_g_dl": {
       "type": "number",
       "description": "Ascites albumin in g/dL (0.1-6). Provide this or ascites_albumin_g_l, not both. May be lower than serum albumin."
      }
     }
    }
   },
   "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/saag",
  "count": 2,
  "items": [
   {
    "formula": "saag",
    "citation": {
     "id": "runyon-1992",
     "doi": "10.7326/0003-4819-117-3-215",
     "title": "The serum-ascites albumin gradient is superior to the exudate-transudate concept in the differential diagnosis of ascites",
     "source": "Ann Intern Med. 1992;117(3):215-220",
     "authors": "Runyon BA, Montano AA, Akriviadis EA, Antillon MR, Irving MA, McHutchison JG"
    },
    "saag_g_dl": 1.5,
    "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.",
    "albumin_g_dl": 3.5,
    "formula_expression": "saag_g_dl = albumin_g_dl - ascites_albumin_g_dl",
    "ascites_albumin_g_dl": 2,
    "portal_hypertension_physiology": true
   },
   {
    "formula": "saag",
    "citation": {
     "id": "runyon-1992",
     "doi": "10.7326/0003-4819-117-3-215",
     "title": "The serum-ascites albumin gradient is superior to the exudate-transudate concept in the differential diagnosis of ascites",
     "source": "Ann Intern Med. 1992;117(3):215-220",
     "authors": "Runyon BA, Montano AA, Akriviadis EA, Antillon MR, Irving MA, McHutchison JG"
    },
    "saag_g_dl": 1.5,
    "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.",
    "albumin_g_dl": 3.5,
    "formula_expression": "saag_g_dl = albumin_g_dl - ascites_albumin_g_dl",
    "ascites_albumin_g_dl": 2,
    "portal_hypertension_physiology": true
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saag-calculator-serum-ascites-albumin-gradient-6e73e3f9/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)
