MAGENT

ECG interval · LIVE

QTc Bazett vs Fridericia

QTc

Compute heart-rate-corrected QT using Bazett or Fridericia. The formula argument is required.

LIVE $0.005 USDC GET /api/calc/qtc

Markdown: /docs/qtc.md · Canonical: https://magentlab.com/docs/qtc

Not a medical device. Not a diagnosis or dosing recommendation.

What it computes

Compute heart-rate-corrected QT using Bazett or Fridericia. The formula argument is required.

When to use

Requires formula=bazett or formula=fridericia; Bazett is not applied silently.

When not to use

  • Not a diagnosis and not a drug-safety recommendation.
  • formula is required. Magent does not pick Bazett or Fridericia.
  • Fridericia has no verified DOI in this record; citation is the 1920 Acta Med Scand paper.

Formula

QTc_ms = QT_ms / sqrt(RR_s)

Citation

Title
An analysis of the time-relations of electrocardiograms
Authors
Bazett HC
Source
Heart. 1920;7:353-370
DOI
none

Worked example

QT 400 ms, HR 80, Bazett

Given: formula=bazettheart_rate_bpm=80qt_ms=400

  1. RR_s = 60 / 80 = 0.75
  2. QTc = 400 / sqrt(0.75) = 461.9 ms

Also searched as

  • QTc Bazett vs Fridericia
  • Bazett formula
  • Fridericia QTc
  • corrected QT

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/qtc?qt_ms=400&heart_rate_bpm=80&formula=bazett

Full URL: https://api.magentlab.com/api/calc/qtc?qt_ms=400&heart_rate_bpm=80&formula=bazett

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/qtc?qt_ms=400&heart_rate_bpm=80&formula=bazett"

Parameters

Name Type Required Description
qt_ms number required Measured QT interval in milliseconds (200-800).
heart_rate_bpm integer required Heart rate in beats per minute (30-220). RR_s = 60 / HR.
formula string required · bazett, fridericia Correction formula. Required; magent does not pick one silently.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/qtc Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "formula": "bazett",
      "heart_rate_bpm": "80",
      "qt_ms": "400"
    },
    {
      "formula": "bazett",
      "heart_rate_bpm": "80",
      "qt_ms": "400"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/qtc",
  "items": [
    {
      "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.",
      "citation": {
        "authors": "Bazett HC",
        "doi": null,
        "id": "bazett-1920",
        "source": "Heart. 1920;7:353-370",
        "title": "An analysis of the time-relations of electrocardiograms"
      },
      "formula": "bazett",
      "formula_expression": "QTc_ms = QT_ms / sqrt(RR_s)",
      "heart_rate_bpm": 80,
      "qtc_ms": 461.9,
      "qt_ms": 400.0,
      "rr_s": 0.75
    },
    {
      "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.",
      "citation": {
        "authors": "Bazett HC",
        "doi": null,
        "id": "bazett-1920",
        "source": "Heart. 1920;7:353-370",
        "title": "An analysis of the time-relations of electrocardiograms"
      },
      "formula": "bazett",
      "formula_expression": "QTc_ms = QT_ms / sqrt(RR_s)",
      "heart_rate_bpm": 80,
      "qtc_ms": 461.9,
      "qt_ms": 400.0,
      "rr_s": 0.75
    }
  ]
}

Response

Field Type Description
formula string bazett or fridericia
formula_expression string Exact expression used
qt_ms number Input QT in ms
heart_rate_bpm integer Input heart rate
rr_s number RR interval in seconds (60/HR)
qtc_ms number Corrected QT in ms, 1 decimal
citation object Bazett 1920 or Fridericia 1920
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "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.",
  "citation": {
    "authors": "Bazett HC",
    "doi": null,
    "id": "bazett-1920",
    "source": "Heart. 1920;7:353-370",
    "title": "An analysis of the time-relations of electrocardiograms"
  },
  "formula": "bazett",
  "formula_expression": "QTc_ms = QT_ms / sqrt(RR_s)",
  "heart_rate_bpm": 80,
  "qtc_ms": 461.9,
  "qt_ms": 400.0,
  "rr_s": 0.75
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_qt qt_ms must be a number from 200 to 800 Returned before settlement; you are not charged.
400 invalid_heart_rate heart_rate_bpm must be an integer from 30 to 220 Returned before settlement; you are not charged.
400 invalid_formula formula must be bazett or fridericia Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • Albumin-corrected calcium (simplified Payne formula, 0.8 factor) — Compute albumin-corrected calcium as calcium_mg_dl + 0.8 * (4.0 - albumin_g_dl). Payne 1973 reports an adjustment of calcium - albumin + 4.0 (coefficient 1.0). This calculator uses the simplified form (0.8 mg/dL per g/dL, equivalent to 0.02 mmol/L per g/L). Simplified form: Desgagnés N, King JA, Kline GA, Seiden-Long I, Leung AA. Use of Albumin-Adjusted Calcium Measurements in Clinical Practice. JAMA Netw Open. 2025;8(1):e2455251. DOI 10.1001/jamanetworkopen.2024.55251.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. Magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.