LIVE
QTc
Compute heart-rate-corrected QT using Bazett or Fridericia. The formula argument is required.
Markdown: /docs/qtc.md · Canonical: https://magentlab.com/docs/qtc
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute heart-rate-corrected QT using Bazett or Fridericia. The formula argument is required.
When to use
When an agent must not apply Bazett silently. Callers must choose formula=bazett or formula=fridericia.
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
- RR_s = 60 / 80 = 0.75
- QTc = 400 / sqrt(0.75) = 461.9 ms
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
x402 V2 curl
Expect HTTP 402 and a PAYMENT-REQUIRED
header 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"
Cursor mcp.json
Intended config for @magent/mcp. This is not npm @x402/fetch
(a payment fetch wrapper).
{
"mcpServers": {
"magent": {
"args": [
"-y",
"@magent/mcp"
],
"command": "npx",
"env": {
"X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY"
}
}
}
}
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. |
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 coded-ontology 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,
"qt_ms": 400.0,
"qtc_ms": 461.9,
"rr_s": 0.75
}
Errors
| 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. |
| 402 | payment_required |
Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header |
| 409 | payment_in_progress |
The same authorization nonce is already being settled; retry shortly |
| 429 | rate_limited |
Too many requests from this client |
| 503 | settlement_uncertain |
Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE |
| 503 | facilitator_unavailable |
Payment facilitator unavailable |
| 503 | facilitator_misconfigured |
Payment facilitator is not configured |
| 503 | facilitator_unauthorized |
Payment facilitator rejected credentials |
| 503 | ledger_unavailable |
Payment ledger unavailable |
| 503 | payment_unavailable |
Payment processing unavailable |
Related tools
- Corrected calcium — Compute Payne albumin-corrected calcium from total calcium and albumin.
Also searched as
- QTc Bazett vs Fridericia
- Bazett formula
- Fridericia QTc
- corrected QT
Payment
Required query parameters must be present and valid. 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. Retry the same URL with PAYMENT-SIGNATURE. Settlement completes before the
tool runs. Full handshake and shared payment errors: Payments.
Guarantees
- Invalid query parameters return HTTP 400 before settlement. You are not charged.
- Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are not persisted. Request logs store path without query.