{
  "x402Version": 2,
  "id": 39330,
  "slug": "39330",
  "resource": "https://api.magentlab.com/api/calc/bicarbonate_deficit",
  "description": "Bicarbonate deficit from weight and measured HCO3 using Adrogué–Madias 50 percent body-weight space. Deterministic published arithmetic with citation; not a dosing protocol.",
  "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": [
              {
                "bicarbonate_mmol_l": 4,
                "desired_hco3_mmol_l": 8,
                "weight_kg": 70,
                "weight_lb": 154.3236
              },
              {
                "bicarbonate_mmol_l": 4,
                "desired_hco3_mmol_l": 8,
                "weight_kg": 70,
                "weight_lb": 154.3236
              }
            ]
          },
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "count": 2,
            "items": [
              {
                "bicarbonate_mmol_l": 4,
                "bicarbonate_space_l": 35,
                "citation": {
                  "authors": "Adrogué HJ, Madias NE",
                  "doi": "10.1056/NEJM199801013380106",
                  "id": "adrogue-madias-1998",
                  "source": "N Engl J Med. 1998;338(1):26-34",
                  "title": "Management of life-threatening acid-base disorders. First of two parts"
                },
                "deficit_meq": 140,
                "desired_hco3_mmol_l": 8,
                "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.",
                "formula": "adrogue_madias",
                "formula_expression": "bicarbonate_space_L = 0.5 * weight_kg; deficit_mEq = bicarbonate_space_L * (desired_hco3 - measured_hco3)",
                "weight_kg": 70
              },
              {
                "bicarbonate_mmol_l": 4,
                "bicarbonate_space_l": 35,
                "citation": {
                  "authors": "Adrogué HJ, Madias NE",
                  "doi": "10.1056/NEJM199801013380106",
                  "id": "adrogue-madias-1998",
                  "source": "N Engl J Med. 1998;338(1):26-34",
                  "title": "Management of life-threatening acid-base disorders. First of two parts"
                },
                "deficit_meq": 140,
                "desired_hco3_mmol_l": 8,
                "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.",
                "formula": "adrogue_madias",
                "formula_expression": "bicarbonate_space_L = 0.5 * weight_kg; deficit_mEq = bicarbonate_space_L * (desired_hco3 - measured_hco3)",
                "weight_kg": 70
              }
            ],
            "path": "/api/calc/bicarbonate_deficit"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "items": {
                      "properties": {
                        "bicarbonate_mmol_l": {
                          "description": "Measured plasma bicarbonate in mmol/L (same as mEq/L). Range 2-45.",
                          "type": "number"
                        },
                        "desired_hco3_mmol_l": {
                          "description": "Target plasma bicarbonate in mmol/L (8-30), must exceed measured HCO3. Omitted uses 24.",
                          "type": "number"
                        },
                        "weight_kg": {
                          "description": "Weight in kilograms. Provide weight_kg or weight_lb.",
                          "type": "number"
                        },
                        "weight_lb": {
                          "description": "Weight in pounds. Converted as kg = lb * 0.45359237.",
                          "type": "number"
                        }
                      },
                      "required": [
                        "bicarbonate_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": [
    "bicarbonate",
    "acidosis",
    "electrolytes",
    "calculator",
    "bazaar"
  ],
  "sourceHost": "api.magentlab.com",
  "lastUpdated": "2026-10-12T23:06:57.78Z",
  "quality": {
    "calls30d": 5,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-12T23:06:57.556Z"
  },
  "metadata": {
    "serviceName": "magent",
    "extensions": {
      "bazaar": {
        "info": {
          "iconUrl": "https://api.magentlab.com/favicon.ico",
          "input": {
            "body": {
              "items": [
                {
                  "bicarbonate_mmol_l": 4,
                  "desired_hco3_mmol_l": 8,
                  "weight_kg": 70,
                  "weight_lb": 154.3236
                },
                {
                  "bicarbonate_mmol_l": 4,
                  "desired_hco3_mmol_l": 8,
                  "weight_kg": 70,
                  "weight_lb": 154.3236
                }
              ]
            },
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "count": 2,
              "items": [
                {
                  "bicarbonate_mmol_l": 4,
                  "bicarbonate_space_l": 35,
                  "citation": {
                    "authors": "Adrogué HJ, Madias NE",
                    "doi": "10.1056/NEJM199801013380106",
                    "id": "adrogue-madias-1998",
                    "source": "N Engl J Med. 1998;338(1):26-34",
                    "title": "Management of life-threatening acid-base disorders. First of two parts"
                  },
                  "deficit_meq": 140,
                  "desired_hco3_mmol_l": 8,
                  "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.",
                  "formula": "adrogue_madias",
                  "formula_expression": "bicarbonate_space_L = 0.5 * weight_kg; deficit_mEq = bicarbonate_space_L * (desired_hco3 - measured_hco3)",
                  "weight_kg": 70
                },
                {
                  "bicarbonate_mmol_l": 4,
                  "bicarbonate_space_l": 35,
                  "citation": {
                    "authors": "Adrogué HJ, Madias NE",
                    "doi": "10.1056/NEJM199801013380106",
                    "id": "adrogue-madias-1998",
                    "source": "N Engl J Med. 1998;338(1):26-34",
                    "title": "Management of life-threatening acid-base disorders. First of two parts"
                  },
                  "deficit_meq": 140,
                  "desired_hco3_mmol_l": 8,
                  "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.",
                  "formula": "adrogue_madias",
                  "formula_expression": "bicarbonate_space_L = 0.5 * weight_kg; deficit_mEq = bicarbonate_space_L * (desired_hco3 - measured_hco3)",
                  "weight_kg": 70
                }
              ],
              "path": "/api/calc/bicarbonate_deficit"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "properties": {
                          "bicarbonate_mmol_l": {
                            "description": "Measured plasma bicarbonate in mmol/L (same as mEq/L). Range 2-45.",
                            "type": "number"
                          },
                          "desired_hco3_mmol_l": {
                            "description": "Target plasma bicarbonate in mmol/L (8-30), must exceed measured HCO3. Omitted uses 24.",
                            "type": "number"
                          },
                          "weight_kg": {
                            "description": "Weight in kilograms. Provide weight_kg or weight_lb.",
                            "type": "number"
                          },
                          "weight_lb": {
                            "description": "Weight in pounds. Converted as kg = lb * 0.45359237.",
                            "type": "number"
                          }
                        },
                        "required": [
                          "bicarbonate_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"
  }
}