# Magent ABG Acid-Base Analyzer

> Magent ABG Acid-Base Analyzer 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).

Performs Berend 2014 arterial blood gas acid-base assessment: labels acidemia/alkalemia, identifies primary metabolic or respiratory process, calculates anion gap, and prints delta-delta ratios.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/abg
- 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/magent-abg-acid-base-analyzer-6f95888c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-yiP6nTT1BpckBOqfqMhS

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 magent-abg-acid-base-analyzer-6f95888c
```

Example prompt: Run a Berend 2014 acid-base assessment on this ABG: pH 7.28, PaCO2 52 mmHg, bicarbonate 22 mmol/L, sodium 140, chloride 104 — and include the anion gap calculation.

## When to prefer this

Choose this endpoint when you need a structured, Berend 2014–compliant acid-base interpretation from raw blood gas and electrolyte values, including anion gap and delta-delta output. Prefer it over manual calculation when you need albumin-corrected anion gap or want labeled outputs (acidemia/alkalemia, metabolic/respiratory) ready to include in a clinical summary. Not appropriate if you need a blood gas measurement, a ventilator setting, a bicarbonate dose recommendation, or a differential diagnosis.

## Known failure modes

- pH outside 6.80–7.80 range returns validation error
- PaCO2 outside 8–120 mm Hg returns out-of-range error
- Sodium outside 110–160 mmol/L returns error
- Chloride outside 70–130 mmol/L returns error
- Bicarbonate outside 2–55 mmol/L returns error
- Albumin outside 1–6 g/dL (if supplied) returns error
- Missing required query parameters returns 400 bad request
- Payment not included or insufficient USDC triggers 402 payment required

## How this service works

Berend 2014 physiological acid-base assessment. Labels acidemia or alkalemia, primary metabolic vs respiratory process, anion gap (Na-Cl-HCO3), optional albumin-corrected gap, and printed delta-delta. Not a diagnosis, ventilator order, bicarbonate dose, or blood-gas assay.

## Output

Returns an acid-base label (acidemia or alkalemia), identification of the primary process as metabolic or respiratory, calculated anion gap (Na−Cl−HCO3), optional albumin-corrected anion gap when albumin is supplied, and printed delta-delta equations when the anion gap is elevated. Lactate is echoed back if provided but does not alter the delta-delta logic.

## 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": [
      "ph",
      "paco2_mm_hg",
      "bicarbonate_mmol_l",
      "sodium_mmol_l",
      "chloride_mmol_l"
     ],
     "properties": {
      "ph": {
       "type": "number",
       "description": "Arterial pH (6.80-7.80). Acidemia if pH<7.38; alkalemia if pH>7.42 (Berend 2014 Table 1)."
      },
      "paco2_mm_hg": {
       "type": "number",
       "description": "Arterial PaCO2 in mm Hg (8-120). Respiratory acidosis if pH<7.38 and PaCO2>42; respiratory alkalosis if pH>7.42 and PaCO2<38."
      },
      "albumin_g_dl": {
       "type": "number",
       "description": "Serum albumin in g/dL (1-6). When supplied and below 4.0 g/dL, anion gap is increased by 2.5 mmol/L per 1 g/dL decrease (Figure 1). Omitted skips the correction."
      },
      "sodium_mmol_l": {
       "type": "number",
       "description": "Serum sodium in mmol/L (110-160). Used for anion gap Na-Cl-HCO3."
      },
      "lactate_mmol_l": {
       "type": "number",
       "description": "Serum lactate in mmol/L (0-30) when supplied. Echoed only; magent does not pick keto vs lactic delta-delta from lactate. Both printed equations are returned when the anion gap is high."
      },
      "chloride_mmol_l": {
       "type": "number",
       "description": "Serum chloride in mmol/L (70-130). Used for anion gap Na-Cl-HCO3."
      },
      "bicarbonate_mmol_l": {
       "type": "number",
       "description": "Plasma bicarbonate in mmol/L (2-55). Metabolic acidosis if pH<7.38 and HCO3<22; metabolic alkalosis if pH>7.42 and HCO3>26."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/magent-abg-acid-base-analyzer-6f95888c/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)
