# QTc

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/qtc`
HTML: https://magentlab.com/docs/qtc
Markdown: https://magentlab.com/docs/qtc.md

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

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

## Worked example

### QT 400 ms, HR 80, Bazett

Given: `formula=bazett, heart_rate_bpm=80, qt_ms=400`

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


## Parameters

- `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): Correction formula. Required; magent does not pick one silently.

## Bulk (POST)

POST the same path with a JSON items array. Price is n times the GET unit. Invalid items return HTTP 400 before settlement.

Method: `POST /api/calc/qtc`
Max items: 25
Price: unit_amount * n (unit 5000 atomic)
Status: PREVIEW

- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- 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. HTML paywall is GET only.

Example request:

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/qtc",
  "items": [
    {
      "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
    },
    {
      "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
    }
  ]
}
```

## Response fields

- `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

Frozen fixture. Not a live lookup.

```json
{
  "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 400 `invalid_qt`: qt_ms must be a number from 200 to 800 Returned before settlement; you are not charged.
- HTTP 400 `invalid_heart_rate`: heart_rate_bpm must be an integer from 30 to 220 Returned before settlement; you are not charged.
- HTTP 400 `invalid_formula`: formula must be bazett or fridericia Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.
- HTTP 402 `payment_required`: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header
- HTTP 409 `payment_in_progress`: The same authorization nonce is already being settled; retry shortly
- HTTP 429 `rate_limited`: Too many requests from this client
- HTTP 503 `settlement_uncertain`: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE
- HTTP 503 `facilitator_unavailable`: Payment facilitator unavailable
- HTTP 503 `facilitator_misconfigured`: Payment facilitator is not configured
- HTTP 503 `facilitator_unauthorized`: Payment facilitator rejected credentials
- HTTP 503 `ledger_unavailable`: Payment ledger unavailable
- HTTP 503 `payment_unavailable`: Payment processing unavailable

## Related tools

- [Corrected calcium](https://magentlab.com/docs/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.

## 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.
