{
  "x402Version": 2,
  "id": 39339,
  "slug": "39339",
  "resource": "https://api.magentlab.com/api/calc/abg",
  "description": "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.",
  "type": "http",
  "serviceName": "magent",
  "resourceType": "Agent Service",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x836Be278f1739fB4308091cD1852F7971Bc19Ee2",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5000",
      "amountUsd": 0.005,
      "maxTimeoutSeconds": 600
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "iconUrl": "https://api.magentlab.com/favicon.ico",
        "input": {
          "body": {
            "items": [
              {
                "albumin_g_dl": 4,
                "bicarbonate_mmol_l": 18,
                "chloride_mmol_l": 115,
                "lactate_mmol_l": 2,
                "paco2_mm_hg": 39,
                "ph": 7.28,
                "sodium_mmol_l": 135
              },
              {
                "albumin_g_dl": 4,
                "bicarbonate_mmol_l": 18,
                "chloride_mmol_l": 115,
                "lactate_mmol_l": 2,
                "paco2_mm_hg": 39,
                "ph": 7.28,
                "sodium_mmol_l": 135
              }
            ]
          },
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "count": 2,
            "items": [
              {
                "anion_gap_class": "normal",
                "anion_gap_mmol_l": 2,
                "bicarbonate_mmol_l": 18,
                "chloride_mmol_l": 115,
                "citation": {
                  "authors": "Berend K, de Vries APJ, Gans ROB",
                  "doi": "10.1056/NEJMra1003327",
                  "id": "berend-2014-acid-base",
                  "pmid": "25295502",
                  "source": "N Engl J Med. 2014;371:1434-1445",
                  "title": "Physiological Approach to Assessment of Acid-Base Disturbances"
                },
                "criteria": [
                  {
                    "factor": "acidemia",
                    "met": true,
                    "value": 7.28
                  },
                  {
                    "factor": "alkalemia",
                    "met": false,
                    "value": 7.28
                  },
                  {
                    "factor": "metabolic_acidosis",
                    "met": true,
                    "value": 18
                  },
                  {
                    "factor": "metabolic_alkalosis",
                    "met": false,
                    "value": 18
                  },
                  {
                    "factor": "respiratory_acidosis",
                    "met": false,
                    "value": 39
                  },
                  {
                    "factor": "respiratory_alkalosis",
                    "met": false,
                    "value": 39
                  },
                  {
                    "factor": "high_anion_gap",
                    "met": false,
                    "value": 2
                  },
                  {
                    "factor": "normal_anion_gap",
                    "met": true,
                    "value": 2
                  }
                ],
                "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.",
                "disorders": [
                  "acidemia",
                  "metabolic acidosis",
                  "normal anion-gap acidosis",
                  "additional respiratory acidosis"
                ],
                "expected_paco2_high_mm_hg": 37,
                "expected_paco2_low_mm_hg": 33,
                "expected_paco2_mm_hg": 35,
                "formula": "abg",
                "formula_expression": "Berend 2014: acidemia if pH<7.38; alkalemia if pH>7.42; metabolic acidosis if pH<7.38 and HCO3<22; metabolic alkalosis if pH>7.42 and HCO3>26; respiratory acidosis if pH<7.38 and PaCO2>42; respiratory alkalosis if pH>7.42 and PaCO2<38; anion_gap=Na-Cl-HCO3 (high if >12); albumin-corrected AG=AG+2.5*(4.0-albumin) when albumin<4.0 g/dL; metabolic acidosis expected PaCO2=1.5*HCO3+8±2; metabolic alkalosis expected PaCO2=0.7*(HCO3-24)+40±2; acute respiratory acidosis HCO3 +1 per 10 mm Hg PaCO2 above 40; chronic +4 to +5; acute respiratory alkalosis HCO3 -2 per 10 mm Hg PaCO2 below 40; chronic -4 to -5; ketoacidosis delta-delta=ΔAG-ΔHCO3; lactic delta-delta=0.6*ΔAG-ΔHCO3 (simple if -5 to 5)",
                "paco2_mm_hg": 39,
                "ph": 7.28,
                "ph_status": "acidemia",
                "primary_process": "metabolic acidosis",
                "secondary_response": "additional respiratory acidosis",
                "sodium_mmol_l": 135
              },
              {
                "anion_gap_class": "normal",
                "anion_gap_mmol_l": 2,
                "bicarbonate_mmol_l": 18,
                "chloride_mmol_l": 115,
                "citation": {
                  "authors": "Berend K, de Vries APJ, Gans ROB",
                  "doi": "10.1056/NEJMra1003327",
                  "id": "berend-2014-acid-base",
                  "pmid": "25295502",
                  "source": "N Engl J Med. 2014;371:1434-1445",
                  "title": "Physiological Approach to Assessment of Acid-Base Disturbances"
                },
                "criteria": [
                  {
                    "factor": "acidemia",
                    "met": true,
                    "value": 7.28
                  },
                  {
                    "factor": "alkalemia",
                    "met": false,
                    "value": 7.28
                  },
                  {
                    "factor": "metabolic_acidosis",
                    "met": true,
                    "value": 18
                  },
                  {
                    "factor": "metabolic_alkalosis",
                    "met": false,
                    "value": 18
                  },
                  {
                    "factor": "respiratory_acidosis",
                    "met": false,
                    "value": 39
                  },
                  {
                    "factor": "respiratory_alkalosis",
                    "met": false,
                    "value": 39
                  },
                  {
                    "factor": "high_anion_gap",
                    "met": false,
                    "value": 2
                  },
                  {
                    "factor": "normal_anion_gap",
                    "met": true,
                    "value": 2
                  }
                ],
                "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.",
                "disorders": [
                  "acidemia",
                  "metabolic acidosis",
                  "normal anion-gap acidosis",
                  "additional respiratory acidosis"
                ],
                "expected_paco2_high_mm_hg": 37,
                "expected_paco2_low_mm_hg": 33,
                "expected_paco2_mm_hg": 35,
                "formula": "abg",
                "formula_expression": "Berend 2014: acidemia if pH<7.38; alkalemia if pH>7.42; metabolic acidosis if pH<7.38 and HCO3<22; metabolic alkalosis if pH>7.42 and HCO3>26; respiratory acidosis if pH<7.38 and PaCO2>42; respiratory alkalosis if pH>7.42 and PaCO2<38; anion_gap=Na-Cl-HCO3 (high if >12); albumin-corrected AG=AG+2.5*(4.0-albumin) when albumin<4.0 g/dL; metabolic acidosis expected PaCO2=1.5*HCO3+8±2; metabolic alkalosis expected PaCO2=0.7*(HCO3-24)+40±2; acute respiratory acidosis HCO3 +1 per 10 mm Hg PaCO2 above 40; chronic +4 to +5; acute respiratory alkalosis HCO3 -2 per 10 mm Hg PaCO2 below 40; chronic -4 to -5; ketoacidosis delta-delta=ΔAG-ΔHCO3; lactic delta-delta=0.6*ΔAG-ΔHCO3 (simple if -5 to 5)",
                "paco2_mm_hg": 39,
                "ph": 7.28,
                "ph_status": "acidemia",
                "primary_process": "metabolic acidosis",
                "secondary_response": "additional respiratory acidosis",
                "sodium_mmol_l": 135
              }
            ],
            "path": "/api/calc/abg"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "items": {
                      "properties": {
                        "albumin_g_dl": {
                          "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.",
                          "type": "number"
                        },
                        "bicarbonate_mmol_l": {
                          "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.",
                          "type": "number"
                        },
                        "chloride_mmol_l": {
                          "description": "Serum chloride in mmol/L (70-130). Used for anion gap Na-Cl-HCO3.",
                          "type": "number"
                        },
                        "lactate_mmol_l": {
                          "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.",
                          "type": "number"
                        },
                        "paco2_mm_hg": {
                          "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.",
                          "type": "number"
                        },
                        "ph": {
                          "description": "Arterial pH (6.80-7.80). Acidemia if pH<7.38; alkalemia if pH>7.42 (Berend 2014 Table 1).",
                          "type": "number"
                        },
                        "sodium_mmol_l": {
                          "description": "Serum sodium in mmol/L (110-160). Used for anion gap Na-Cl-HCO3.",
                          "type": "number"
                        }
                      },
                      "required": [
                        "ph",
                        "paco2_mm_hg",
                        "bicarbonate_mmol_l",
                        "sodium_mmol_l",
                        "chloride_mmol_l"
                      ],
                      "type": "object"
                    },
                    "maxItems": 25,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "items"
                ],
                "type": "object"
              },
              "headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "method": {
                "const": "POST",
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "abg",
    "acid-base",
    "berend",
    "electrolytes",
    "calculator",
    "bazaar"
  ],
  "sourceHost": "api.magentlab.com",
  "lastUpdated": "2026-10-12T22:51:12.611Z",
  "quality": {
    "calls30d": 5,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-12T22:51:12.362Z"
  },
  "metadata": {
    "serviceName": "magent",
    "extensions": {
      "bazaar": {
        "info": {
          "iconUrl": "https://api.magentlab.com/favicon.ico",
          "input": {
            "body": {
              "items": [
                {
                  "albumin_g_dl": 4,
                  "bicarbonate_mmol_l": 18,
                  "chloride_mmol_l": 115,
                  "lactate_mmol_l": 2,
                  "paco2_mm_hg": 39,
                  "ph": 7.28,
                  "sodium_mmol_l": 135
                },
                {
                  "albumin_g_dl": 4,
                  "bicarbonate_mmol_l": 18,
                  "chloride_mmol_l": 115,
                  "lactate_mmol_l": 2,
                  "paco2_mm_hg": 39,
                  "ph": 7.28,
                  "sodium_mmol_l": 135
                }
              ]
            },
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "count": 2,
              "items": [
                {
                  "anion_gap_class": "normal",
                  "anion_gap_mmol_l": 2,
                  "bicarbonate_mmol_l": 18,
                  "chloride_mmol_l": 115,
                  "citation": {
                    "authors": "Berend K, de Vries APJ, Gans ROB",
                    "doi": "10.1056/NEJMra1003327",
                    "id": "berend-2014-acid-base",
                    "pmid": "25295502",
                    "source": "N Engl J Med. 2014;371:1434-1445",
                    "title": "Physiological Approach to Assessment of Acid-Base Disturbances"
                  },
                  "criteria": [
                    {
                      "factor": "acidemia",
                      "met": true,
                      "value": 7.28
                    },
                    {
                      "factor": "alkalemia",
                      "met": false,
                      "value": 7.28
                    },
                    {
                      "factor": "metabolic_acidosis",
                      "met": true,
                      "value": 18
                    },
                    {
                      "factor": "metabolic_alkalosis",
                      "met": false,
                      "value": 18
                    },
                    {
                      "factor": "respiratory_acidosis",
                      "met": false,
                      "value": 39
                    },
                    {
                      "factor": "respiratory_alkalosis",
                      "met": false,
                      "value": 39
                    },
                    {
                      "factor": "high_anion_gap",
                      "met": false,
                      "value": 2
                    },
                    {
                      "factor": "normal_anion_gap",
                      "met": true,
                      "value": 2
                    }
                  ],
                  "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.",
                  "disorders": [
                    "acidemia",
                    "metabolic acidosis",
                    "normal anion-gap acidosis",
                    "additional respiratory acidosis"
                  ],
                  "expected_paco2_high_mm_hg": 37,
                  "expected_paco2_low_mm_hg": 33,
                  "expected_paco2_mm_hg": 35,
                  "formula": "abg",
                  "formula_expression": "Berend 2014: acidemia if pH<7.38; alkalemia if pH>7.42; metabolic acidosis if pH<7.38 and HCO3<22; metabolic alkalosis if pH>7.42 and HCO3>26; respiratory acidosis if pH<7.38 and PaCO2>42; respiratory alkalosis if pH>7.42 and PaCO2<38; anion_gap=Na-Cl-HCO3 (high if >12); albumin-corrected AG=AG+2.5*(4.0-albumin) when albumin<4.0 g/dL; metabolic acidosis expected PaCO2=1.5*HCO3+8±2; metabolic alkalosis expected PaCO2=0.7*(HCO3-24)+40±2; acute respiratory acidosis HCO3 +1 per 10 mm Hg PaCO2 above 40; chronic +4 to +5; acute respiratory alkalosis HCO3 -2 per 10 mm Hg PaCO2 below 40; chronic -4 to -5; ketoacidosis delta-delta=ΔAG-ΔHCO3; lactic delta-delta=0.6*ΔAG-ΔHCO3 (simple if -5 to 5)",
                  "paco2_mm_hg": 39,
                  "ph": 7.28,
                  "ph_status": "acidemia",
                  "primary_process": "metabolic acidosis",
                  "secondary_response": "additional respiratory acidosis",
                  "sodium_mmol_l": 135
                },
                {
                  "anion_gap_class": "normal",
                  "anion_gap_mmol_l": 2,
                  "bicarbonate_mmol_l": 18,
                  "chloride_mmol_l": 115,
                  "citation": {
                    "authors": "Berend K, de Vries APJ, Gans ROB",
                    "doi": "10.1056/NEJMra1003327",
                    "id": "berend-2014-acid-base",
                    "pmid": "25295502",
                    "source": "N Engl J Med. 2014;371:1434-1445",
                    "title": "Physiological Approach to Assessment of Acid-Base Disturbances"
                  },
                  "criteria": [
                    {
                      "factor": "acidemia",
                      "met": true,
                      "value": 7.28
                    },
                    {
                      "factor": "alkalemia",
                      "met": false,
                      "value": 7.28
                    },
                    {
                      "factor": "metabolic_acidosis",
                      "met": true,
                      "value": 18
                    },
                    {
                      "factor": "metabolic_alkalosis",
                      "met": false,
                      "value": 18
                    },
                    {
                      "factor": "respiratory_acidosis",
                      "met": false,
                      "value": 39
                    },
                    {
                      "factor": "respiratory_alkalosis",
                      "met": false,
                      "value": 39
                    },
                    {
                      "factor": "high_anion_gap",
                      "met": false,
                      "value": 2
                    },
                    {
                      "factor": "normal_anion_gap",
                      "met": true,
                      "value": 2
                    }
                  ],
                  "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.",
                  "disorders": [
                    "acidemia",
                    "metabolic acidosis",
                    "normal anion-gap acidosis",
                    "additional respiratory acidosis"
                  ],
                  "expected_paco2_high_mm_hg": 37,
                  "expected_paco2_low_mm_hg": 33,
                  "expected_paco2_mm_hg": 35,
                  "formula": "abg",
                  "formula_expression": "Berend 2014: acidemia if pH<7.38; alkalemia if pH>7.42; metabolic acidosis if pH<7.38 and HCO3<22; metabolic alkalosis if pH>7.42 and HCO3>26; respiratory acidosis if pH<7.38 and PaCO2>42; respiratory alkalosis if pH>7.42 and PaCO2<38; anion_gap=Na-Cl-HCO3 (high if >12); albumin-corrected AG=AG+2.5*(4.0-albumin) when albumin<4.0 g/dL; metabolic acidosis expected PaCO2=1.5*HCO3+8±2; metabolic alkalosis expected PaCO2=0.7*(HCO3-24)+40±2; acute respiratory acidosis HCO3 +1 per 10 mm Hg PaCO2 above 40; chronic +4 to +5; acute respiratory alkalosis HCO3 -2 per 10 mm Hg PaCO2 below 40; chronic -4 to -5; ketoacidosis delta-delta=ΔAG-ΔHCO3; lactic delta-delta=0.6*ΔAG-ΔHCO3 (simple if -5 to 5)",
                  "paco2_mm_hg": 39,
                  "ph": 7.28,
                  "ph_status": "acidemia",
                  "primary_process": "metabolic acidosis",
                  "secondary_response": "additional respiratory acidosis",
                  "sodium_mmol_l": 135
                }
              ],
              "path": "/api/calc/abg"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "properties": {
                          "albumin_g_dl": {
                            "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.",
                            "type": "number"
                          },
                          "bicarbonate_mmol_l": {
                            "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.",
                            "type": "number"
                          },
                          "chloride_mmol_l": {
                            "description": "Serum chloride in mmol/L (70-130). Used for anion gap Na-Cl-HCO3.",
                            "type": "number"
                          },
                          "lactate_mmol_l": {
                            "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.",
                            "type": "number"
                          },
                          "paco2_mm_hg": {
                            "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.",
                            "type": "number"
                          },
                          "ph": {
                            "description": "Arterial pH (6.80-7.80). Acidemia if pH<7.38; alkalemia if pH>7.42 (Berend 2014 Table 1).",
                            "type": "number"
                          },
                          "sodium_mmol_l": {
                            "description": "Serum sodium in mmol/L (110-160). Used for anion gap Na-Cl-HCO3.",
                            "type": "number"
                          }
                        },
                        "required": [
                          "ph",
                          "paco2_mm_hg",
                          "bicarbonate_mmol_l",
                          "sodium_mmol_l",
                          "chloride_mmol_l"
                        ],
                        "type": "object"
                      },
                      "maxItems": 25,
                      "minItems": 1,
                      "type": "array"
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "type": "object"
                },
                "headers": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "method": {
                  "const": "POST",
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "api.magentlab.com",
    "manifest_name": "api.magentlab.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "example": {},
    "type": "string"
  }
}