{"uid":"cap_jvoPxGorvfHD1hP1_e3zV","slug":"a-a-gradient-calculator-alveolar-arterial-oxygen-gradient-410a267a","name":"A-a Gradient Calculator (Alveolar-Arterial Oxygen Gradient)","description":"Alveolar–arterial oxygen gradient from FiO2, barometric pressure, PaCO2, PaO2, and RQ using the simplified alveolar-gas equation (PH2O 47 mm Hg). Deterministic published arithmetic with citation; not a diagnosis.","url":"https://api.magentlab.com/api/calc/aa_gradient","method":"GET","headers":{},"bodySchema":{"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":["paco2_mm_hg","pao2_mm_hg"],"properties":{"rq":{"type":"number","description":"Respiratory exchange ratio R (0.7-1.0). Omitted uses 0.8."},"fio2":{"type":"number","description":"Inspired oxygen as a fraction (0.21-1.0), not a percent. Omitted uses 0.21 (room air)."},"pb_mm_hg":{"type":"number","description":"Barometric pressure in mm Hg (500-800). Omitted uses 760."},"pao2_mm_hg":{"type":"number","description":"Arterial PO2 in mm Hg (20-700)."},"paco2_mm_hg":{"type":"number","description":"Arterial PCO2 in mm Hg (8-80)."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"path":"/api/calc/aa_gradient","count":2,"items":[{"rq":0.8,"fio2":0.21,"formula":"aa_gradient","citation":{"id":"riley-cournand-1949","doi":"10.1152/jappl.1949.1.12.825","title":"\"Ideal\" alveolar air and the analysis of ventilation-perfusion relationships in the lungs","source":"J Appl Physiol. 1949;1(12):825-847","authors":"Riley RL, Cournand A"},"pb_mm_hg":760,"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.","pao2_mm_hg":95,"paco2_mm_hg":40,"aa_gradient_mm_hg":4.7,"water_vapor_mm_hg":47,"formula_expression":"PAO2_mm_hg = fio2 * (pb_mm_hg - 47) - paco2_mm_hg / rq; aa_gradient_mm_hg = PAO2_mm_hg - pao2_mm_hg","pao2_alveolar_mm_hg":99.7},{"rq":0.8,"fio2":0.21,"formula":"aa_gradient","citation":{"id":"riley-cournand-1949","doi":"10.1152/jappl.1949.1.12.825","title":"\"Ideal\" alveolar air and the analysis of ventilation-perfusion relationships in the lungs","source":"J Appl Physiol. 1949;1(12):825-847","authors":"Riley RL, Cournand A"},"pb_mm_hg":760,"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.","pao2_mm_hg":95,"paco2_mm_hg":40,"aa_gradient_mm_hg":4.7,"water_vapor_mm_hg":47,"formula_expression":"PAO2_mm_hg = fio2 * (pb_mm_hg - 47) - paco2_mm_hg / rq; aa_gradient_mm_hg = PAO2_mm_hg - pao2_mm_hg","pao2_alveolar_mm_hg":99.7}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_rLlW7rJoZeX_1TSwzViQW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the alveolar–arterial oxygen gradient using the simplified alveolar gas equation given FiO2, barometric pressure, PaCO2, PaO2, and respiratory quotient","exampleAgentPrompt":"Calculate the A-a oxygen gradient for a patient on room air (FiO2 0.21) with a PaCO2 of 40 mm Hg and a PaO2 of 80 mm Hg at standard barometric pressure of 760 mm Hg using an RQ of 0.8.","exampleUseCases":[{"title":"ICU blood gas interpretation","prompt":"My ICU patient is on 50% oxygen (FiO2 0.50), their PaCO2 is 35 mm Hg and PaO2 is 65 mm Hg at sea level — what is the A-a gradient?"},{"title":"High-altitude hypoxemia workup","prompt":"Can you compute the A-a oxygen gradient for someone at altitude where barometric pressure is 620 mm Hg, breathing room air, with a PaCO2 of 32 and a PaO2 of 58?"},{"title":"Post-op respiratory monitoring","prompt":"Post-surgical patient is breathing 40% O2 (FiO2 0.40), PaCO2 is 45 mm Hg, PaO2 is 90 mm Hg, barometric pressure 760 — calculate their alveolar-arterial oxygen gradient."}],"resultDescription":"Returns the computed alveolar oxygen tension (PAO2), the A-a gradient in mm Hg (PAO2 − PaO2), and interpretive reference context including citation to the published formula. All values are deterministic arithmetic; no diagnosis is rendered.","failureModes":["PaCO2 or PaO2 out of accepted range (8–80 and 20–700 mm Hg respectively) returns a validation error","FiO2 outside 0.21–1.0 range rejected","Barometric pressure outside 500–800 mm Hg range rejected","RQ outside 0.7–1.0 range rejected","Missing required parameters (paco2_mm_hg or pao2_mm_hg) returns 400 error","Payment not settled via x402 returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need a fast, deterministic, citeable A-a gradient computation from raw arterial blood gas values. Prefer it over manual calculation or LLM arithmetic to avoid rounding errors and to get a traceable citation. It is ideal for clinical decision-support pipelines, EHR automation, and educational tools that require reproducible pulmonary physiology math.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:12:00.536Z","isFirstParty":false}