{
  "x402Version": 2,
  "id": 38917,
  "slug": "38917",
  "resource": "https://api.magentlab.com/api/calc/ttkg",
  "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.",
  "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": [
              {
                "plasma_osm_mosm_kg": 300,
                "potassium_mmol_l": 4,
                "urine_k_mmol_l": 40,
                "urine_osm_mosm_kg": 600
              },
              {
                "plasma_osm_mosm_kg": 300,
                "potassium_mmol_l": 4,
                "urine_k_mmol_l": 40,
                "urine_osm_mosm_kg": 600
              }
            ]
          },
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "count": 2,
            "items": [
              {
                "citation": {
                  "authors": "Ethier JH, Kamel KS, Magner PO, Lemann J Jr, Halperin ML",
                  "doi": "10.1016/S0272-6386(12)80076-X",
                  "id": "ethier-1990",
                  "pmid": "2321642",
                  "source": "Am J Kidney Dis. 1990;15(4):309-315",
                  "title": "The transtubular potassium concentration in patients with hypokalemia and hyperkalemia"
                },
                "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": "ethier",
                "formula_expression": "ttkg = (urine_k_mmol_l / potassium_mmol_l) / (urine_osm_mosm_kg / plasma_osm_mosm_kg)",
                "plasma_osm_mosm_kg": 300,
                "potassium_mmol_l": 4,
                "ttkg": 5,
                "urine_k_mmol_l": 40,
                "urine_osm_mosm_kg": 600
              },
              {
                "citation": {
                  "authors": "Ethier JH, Kamel KS, Magner PO, Lemann J Jr, Halperin ML",
                  "doi": "10.1016/S0272-6386(12)80076-X",
                  "id": "ethier-1990",
                  "pmid": "2321642",
                  "source": "Am J Kidney Dis. 1990;15(4):309-315",
                  "title": "The transtubular potassium concentration in patients with hypokalemia and hyperkalemia"
                },
                "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": "ethier",
                "formula_expression": "ttkg = (urine_k_mmol_l / potassium_mmol_l) / (urine_osm_mosm_kg / plasma_osm_mosm_kg)",
                "plasma_osm_mosm_kg": 300,
                "potassium_mmol_l": 4,
                "ttkg": 5,
                "urine_k_mmol_l": 40,
                "urine_osm_mosm_kg": 600
              }
            ],
            "path": "/api/calc/ttkg"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "items": {
                      "properties": {
                        "plasma_osm_mosm_kg": {
                          "description": "Plasma osmolality in mOsm/kg (240-400).",
                          "type": "number"
                        },
                        "potassium_mmol_l": {
                          "description": "Plasma potassium in mmol/L (1.5-8.0).",
                          "type": "number"
                        },
                        "urine_k_mmol_l": {
                          "description": "Urine potassium in mmol/L (1-200).",
                          "type": "number"
                        },
                        "urine_osm_mosm_kg": {
                          "description": "Urine osmolality in mOsm/kg (50-1400). Must be greater than plasma_osm_mosm_kg.",
                          "type": "number"
                        }
                      },
                      "required": [
                        "potassium_mmol_l",
                        "urine_k_mmol_l",
                        "plasma_osm_mosm_kg",
                        "urine_osm_mosm_kg"
                      ],
                      "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": [
    "ttkg",
    "potassium",
    "kidney",
    "osmolality",
    "calculator",
    "bazaar"
  ],
  "sourceHost": "api.magentlab.com",
  "lastUpdated": "2026-10-13T15:53:58.047Z",
  "quality": {
    "calls30d": 6,
    "uniquePayers30d": 3,
    "lastCalledAt": "2026-10-13T15:53:57.797Z"
  },
  "metadata": {
    "serviceName": "magent",
    "extensions": {
      "bazaar": {
        "info": {
          "iconUrl": "https://api.magentlab.com/favicon.ico",
          "input": {
            "body": {
              "items": [
                {
                  "plasma_osm_mosm_kg": 300,
                  "potassium_mmol_l": 4,
                  "urine_k_mmol_l": 40,
                  "urine_osm_mosm_kg": 600
                },
                {
                  "plasma_osm_mosm_kg": 300,
                  "potassium_mmol_l": 4,
                  "urine_k_mmol_l": 40,
                  "urine_osm_mosm_kg": 600
                }
              ]
            },
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "count": 2,
              "items": [
                {
                  "citation": {
                    "authors": "Ethier JH, Kamel KS, Magner PO, Lemann J Jr, Halperin ML",
                    "doi": "10.1016/S0272-6386(12)80076-X",
                    "id": "ethier-1990",
                    "pmid": "2321642",
                    "source": "Am J Kidney Dis. 1990;15(4):309-315",
                    "title": "The transtubular potassium concentration in patients with hypokalemia and hyperkalemia"
                  },
                  "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": "ethier",
                  "formula_expression": "ttkg = (urine_k_mmol_l / potassium_mmol_l) / (urine_osm_mosm_kg / plasma_osm_mosm_kg)",
                  "plasma_osm_mosm_kg": 300,
                  "potassium_mmol_l": 4,
                  "ttkg": 5,
                  "urine_k_mmol_l": 40,
                  "urine_osm_mosm_kg": 600
                },
                {
                  "citation": {
                    "authors": "Ethier JH, Kamel KS, Magner PO, Lemann J Jr, Halperin ML",
                    "doi": "10.1016/S0272-6386(12)80076-X",
                    "id": "ethier-1990",
                    "pmid": "2321642",
                    "source": "Am J Kidney Dis. 1990;15(4):309-315",
                    "title": "The transtubular potassium concentration in patients with hypokalemia and hyperkalemia"
                  },
                  "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": "ethier",
                  "formula_expression": "ttkg = (urine_k_mmol_l / potassium_mmol_l) / (urine_osm_mosm_kg / plasma_osm_mosm_kg)",
                  "plasma_osm_mosm_kg": 300,
                  "potassium_mmol_l": 4,
                  "ttkg": 5,
                  "urine_k_mmol_l": 40,
                  "urine_osm_mosm_kg": 600
                }
              ],
              "path": "/api/calc/ttkg"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "properties": {
                          "plasma_osm_mosm_kg": {
                            "description": "Plasma osmolality in mOsm/kg (240-400).",
                            "type": "number"
                          },
                          "potassium_mmol_l": {
                            "description": "Plasma potassium in mmol/L (1.5-8.0).",
                            "type": "number"
                          },
                          "urine_k_mmol_l": {
                            "description": "Urine potassium in mmol/L (1-200).",
                            "type": "number"
                          },
                          "urine_osm_mosm_kg": {
                            "description": "Urine osmolality in mOsm/kg (50-1400). Must be greater than plasma_osm_mosm_kg.",
                            "type": "number"
                          }
                        },
                        "required": [
                          "potassium_mmol_l",
                          "urine_k_mmol_l",
                          "plasma_osm_mosm_kg",
                          "urine_osm_mosm_kg"
                        ],
                        "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"
  }
}