# ROX Index Calculator (SpO2/FiO2/RR)

> ROX Index Calculator (SpO2/FiO2/RR) is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Calculates the ROX index as (SpO2% / FiO2) / respiratory rate per the Roca 2016 definition, returning the result rounded to two decimals.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/rox
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/rox-index-calculator-spo2-fio2-rr-24256016
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PMh1_g1zS55GQ1qVyXzci

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability rox-index-calculator-spo2-fio2-rr-24256016
```

Example prompt: Calculate the ROX index for a patient with SpO2 of 94%, on 50% inspired oxygen (FiO2 0.50), and a respiratory rate of 30 breaths per minute.

## When to prefer this

Use this endpoint when you need the Roca 2016 ROX index specifically — (SpO2/FiO2)/RR — distinct from the PaO2/FiO2 (P/F) ratio or RSBI (RR/tidal volume). Ideal for assessing HFNC success likelihood in clinical decision support agents or ICU monitoring workflows. Prefer this over manual calculation when integrating ROX scoring into automated pipelines.

## Known failure modes

- Missing required parameter (spo2_percent, fio2, or respiratory_rate) returns a validation error
- FiO2 provided as percent (e.g. 40) instead of fraction (0.40) will produce a nonsensical result — no server-side correction
- Respiratory rate of 0 causes division-by-zero error
- SpO2 or FiO2 outside valid physiological range may be rejected or return unexpected output
- Payment not included or insufficient (x402) results in 402 Payment Required response

## How this service works

ROX index as (SpO2 percent / FiO2) / respiratory rate in breaths/min (Roca 2016). Returns the index rounded to two decimals. Not a ventilation order. This is not the PaO2/FiO2 (P/F) ratio and not RSBI (respiratory rate / tidal volume).

## Output

A single numeric ROX index value rounded to two decimal places, computed as (SpO2_percent / FiO2) / respiratory_rate. No interpretation, diagnosis, or ventilation order is included — the index alone is returned.

## Request schema (JSON Schema)

```json
{
 "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": [
      "spo2_percent",
      "fio2",
      "respiratory_rate"
     ],
     "properties": {
      "fio2": {
       "type": "number",
       "description": "Inspired oxygen as a fraction (0.21-1.0), not a percent. Required."
      },
      "spo2_percent": {
       "type": "number",
       "description": "Pulse-oximetry SpO2 as a percent (50-100)."
      },
      "respiratory_rate": {
       "type": "integer",
       "description": "Respiratory rate in breaths/min (integer 4-80)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/rox",
  "count": 2,
  "items": [
   {
    "rox": 22.62,
    "fio2": 0.21,
    "formula": "rox",
    "citation": {
     "id": "roca-2016",
     "doi": "10.1016/j.jcrc.2016.05.022",
     "title": "Predicting success of high-flow nasal cannula in pneumonia patients with hypoxemic respiratory failure: The utility of the ROX index",
     "source": "J Crit Care. 2016;35:200-205",
     "authors": "Roca O, Messika J, Caralt B, García-de-Acilu M, Sztrymf B, Ricard JD, Masclans JR"
    },
    "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.",
    "spo2_percent": 95,
    "respiratory_rate": 20,
    "formula_expression": "rox = (spo2_percent / fio2) / respiratory_rate"
   },
   {
    "rox": 22.62,
    "fio2": 0.21,
    "formula": "rox",
    "citation": {
     "id": "roca-2016",
     "doi": "10.1016/j.jcrc.2016.05.022",
     "title": "Predicting success of high-flow nasal cannula in pneumonia patients with hypoxemic respiratory failure: The utility of the ROX index",
     "source": "J Crit Care. 2016;35:200-205",
     "authors": "Roca O, Messika J, Caralt B, García-de-Acilu M, Sztrymf B, Ricard JD, Masclans JR"
    },
    "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.",
    "spo2_percent": 95,
    "respiratory_rate": 20,
    "formula_expression": "rox = (spo2_percent / fio2) / respiratory_rate"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/rox-index-calculator-spo2-fio2-rr-24256016/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
