{"uid":"cap_HB7i4AaEU3goDVag3awbX","slug":"transtubular-potassium-gradient-ttkg-calculator-82c07252","name":"Transtubular Potassium Gradient (TTKG) Calculator","description":"Transtubular potassium gradient (TTKG) from plasma potassium, urine potassium, plasma osmolality, and urine osmolality (Ethier JH et al., Am J Kidney Dis 1990). TTKG = (urine_k / potassium) / (urine_osm / plasma_osm), 1 decimal. Not valid when urine osmolality is not greater than plasma osmolality (water diuresis). Numeric TTKG only; not a potassium-disorder diagnosis or medical device.","url":"https://api.magentlab.com/api/calc/ttkg","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":["potassium_mmol_l","urine_k_mmol_l","plasma_osm_mosm_kg","urine_osm_mosm_kg"],"properties":{"urine_k_mmol_l":{"type":"number","description":"Urine potassium in mmol/L (1-200)."},"potassium_mmol_l":{"type":"number","description":"Plasma potassium in mmol/L (1.5-8.0)."},"urine_osm_mosm_kg":{"type":"number","description":"Urine osmolality in mOsm/kg (50-1400). Must be greater than plasma_osm_mosm_kg."},"plasma_osm_mosm_kg":{"type":"number","description":"Plasma osmolality in mOsm/kg (240-400)."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"path":"/api/calc/ttkg","count":2,"items":[{"ttkg":5,"formula":"ethier","citation":{"id":"ethier-1990","doi":"10.1016/S0272-6386(12)80076-X","pmid":"2321642","title":"The transtubular potassium concentration in patients with hypokalemia and hyperkalemia","source":"Am J Kidney Dis. 1990;15(4):309-315","authors":"Ethier JH, Kamel KS, Magner PO, Lemann J Jr, Halperin ML"},"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.","urine_k_mmol_l":40,"potassium_mmol_l":4,"urine_osm_mosm_kg":600,"formula_expression":"ttkg = (urine_k_mmol_l / potassium_mmol_l) / (urine_osm_mosm_kg / plasma_osm_mosm_kg)","plasma_osm_mosm_kg":300},{"ttkg":5,"formula":"ethier","citation":{"id":"ethier-1990","doi":"10.1016/S0272-6386(12)80076-X","pmid":"2321642","title":"The transtubular potassium concentration in patients with hypokalemia and hyperkalemia","source":"Am J Kidney Dis. 1990;15(4):309-315","authors":"Ethier JH, Kamel KS, Magner PO, Lemann J Jr, Halperin ML"},"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.","urine_k_mmol_l":40,"potassium_mmol_l":4,"urine_osm_mosm_kg":600,"formula_expression":"ttkg = (urine_k_mmol_l / potassium_mmol_l) / (urine_osm_mosm_kg / plasma_osm_mosm_kg)","plasma_osm_mosm_kg":300}]}},"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_PGvpqHA0LysAG7zpaQu7O","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 transtubular potassium gradient (TTKG) from plasma potassium, urine potassium, plasma osmolality, and urine osmolality using the Ethier 1990 formula.","exampleAgentPrompt":"Calculate the TTKG for a patient with a plasma potassium of 6.2 mmol/L, urine potassium of 80 mmol/L, plasma osmolality of 290 mOsm/kg, and urine osmolality of 620 mOsm/kg.","exampleUseCases":[{"title":"Hyperkalemia renal excretion workup","prompt":"My patient has hyperkalemia — plasma K is 5.9 mmol/L, urine K is 45 mmol/L, plasma osmolality 295, urine osmolality 540. Can you calculate the TTKG to see if the kidney is appropriately excreting potassium?"},{"title":"Hypokalemia renal wasting assessment","prompt":"I need to evaluate whether this hypokalemic patient is losing potassium renally. Plasma potassium is 2.8 mmol/L, urine potassium 35 mmol/L, plasma osmolality 282 mOsm/kg, urine osmolality 480 mOsm/kg — what's the TTKG?"},{"title":"Adrenal insufficiency potassium monitoring","prompt":"For a patient suspected of adrenal insufficiency, plasma K is 5.4 mmol/L, urine K is 22 mmol/L, plasma osmolality 288 mOsm/kg, urine osmolality 410 mOsm/kg — compute the TTKG using the Ethier formula."}],"resultDescription":"Returns a single numeric TTKG value rounded to one decimal place, computed as (urine_k / plasma_k) / (urine_osm / plasma_osm). The result reflects tubular handling of potassium in the collecting duct; the endpoint does not provide a clinical diagnosis or interpretation of potassium disorders.","failureModes":["Urine osmolality not greater than plasma osmolality (water diuresis state) — result is invalid and may be rejected","Out-of-range plasma potassium (outside 1.5–8.0 mmol/L) causes validation error","Out-of-range urine potassium (outside 1–200 mmol/L) causes validation error","Plasma osmolality outside 240–400 mOsm/kg causes validation error","Urine osmolality outside 50–1400 mOsm/kg causes validation error","Missing any required query parameter returns an error","Payment failure (x402) if USDC balance is insufficient"],"whenToPreferThis":"Use this endpoint when you need a fast, formula-based computation of the TTKG from four standard electrolyte lab values (Ethier 1990 method), particularly during hyperkalemia or hypokalemia workup to assess renal potassium handling. It is appropriate when urine osmolality exceeds plasma osmolality (antidiuretic state); do not use during water diuresis. Prefer this over general-purpose LLM math for reproducibility and guaranteed one-decimal precision.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T07:11:13.089Z","isFirstParty":false}