# Reliability Engineering API
> Reliability-engineering maths as an API, computed locally and deterministically — the availability, MTBF and failure maths behind SLAs and dependable systems. The availability endpoint converts between MTBF and MTTR, a target availability and the SLA "nines": give it a mean time between failures and a mean time to repair and it returns the availability A = MTBF/(MTBF+MTTR) and the downtime per year, month, week and day; give it a number of nines and it returns the budget — three nines (99.9 %) is 8.76 hours of downtime a year, five nines (99.999 %) just 5.26 minutes. The reliability endpoint computes the probability a unit survives a mission time under the exponential model R(t) = e^(−λt) with its constant hazard λ = 1/MTBF, or the Weibull model R(t) = e^(−(t/η)^β) — β below one for infant mortality, one for random failures, above one for wear-out — returning the reliability, failure probability, hazard rate and the mean life η·Γ(1+1/β). The system endpoint combines component reliabilities into a system: series (the weakest link, ΠRᵢ), parallel redundancy (1−Π(1−Rᵢ)) or k-of-n voting. Everything is computed locally and deterministically, so it is instant and private. Ideal for SRE, DevOps, hardware-reliability, safety-engineering and SLA-planning app developers, uptime-budget and redundancy-design tools, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. This is reliability and availability maths; for queue wait-times use a queueing API and for live uptime checks use a monitoring service.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/reliability-api/..."
```

## Pricing
- **Free** (Free) — 4,150 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 43,000 calls/Mo, 6 req/s
- **Pro** ($17/Mo) — 198,000 calls/Mo, 15 req/s
- **Mega** ($51/Mo) — 1,140,000 calls/Mo, 40 req/s

## Endpoints

### Reliability

#### `GET /v1/availability` — Availability & downtime

**Parameters:**
- `mtbf` (query, optional, string) — Mean time between failures (h) Example: `1000`
- `mttr` (query, optional, string) — Mean time to repair (h) Example: `10`
- `availability` (query, optional, string) — Target availability (% or 0–1)
- `nines` (query, optional, string) — Number of nines (e.g. 5)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reliability-api/v1/availability?mtbf=1000&mttr=10"
```

**Response:**
```json
{
    "data": {
        "mtbf": 1000,
        "mttr": 10,
        "note": "Availability A = MTBF/(MTBF+MTTR). Three nines (99.9%) is 8.76 h/year of downtime; five nines (99.999%) is about 5.26 min/year.",
        "inputs": {
            "mtbf": 1000,
            "mttr": 10
        },
        "downtime": {
            "per_year_hours": 86.7327,
            "per_day_seconds": 855.4455,
            "per_week_minutes": 99.802,
            "per_month_minutes": 433.6634
        },
        "availability": 0.99009901,
        "nines_equivalent": 2.0043,
        "availability_percent": 99.009901
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:49.267Z",
        "request_id": "4a14f2c3-ff8c-405c-99cf-79153bd81b1b"
    },
    "status": "ok",
    "message": "Availability",
    "success": true
}
```

#### `GET /v1/reliability` — Reliability at mission time

**Parameters:**
- `time` (query, required, string) — Mission time Example: `100`
- `mtbf` (query, optional, string) — MTBF (exponential or Weibull scale) Example: `1000`
- `failure_rate` (query, optional, string) — Constant failure rate λ
- `beta` (query, optional, string) — Weibull shape β
- `eta` (query, optional, string) — Weibull scale η

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reliability-api/v1/reliability?time=100&mtbf=1000"
```

**Response:**
```json
{
    "data": {
        "mtbf": 1000,
        "note": "Exponential R(t) = exp(−λt) with constant hazard λ = 1/MTBF — the memoryless 'useful life' part of the bathtub curve.",
        "model": "exponential",
        "inputs": {
            "mtbf": 1000,
            "time": 100,
            "failure_rate": 0.001
        },
        "hazard_rate": 0.001,
        "reliability": 0.904837418,
        "failure_probability": 0.095162582
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:49.358Z",
        "request_id": "e77de998-2db3-42be-bb05-028412a81d79"
    },
    "status": "ok",
    "message": "Reliability",
    "success": true
}
```

#### `GET /v1/system` — System reliability

**Parameters:**
- `config` (query, optional, string) — series, parallel or kofn Example: `parallel`
- `reliabilities` (query, required, string) — Comma-separated 0–1 list Example: `0.9,0.8,0.95`
- `k` (query, optional, string) — k for k-of-n

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reliability-api/v1/system?config=parallel&reliabilities=0.9%2C0.8%2C0.95"
```

**Response:**
```json
{
    "data": {
        "note": "Series = ΠRᵢ (weakest-link); parallel = 1−Π(1−Rᵢ) (redundancy); k-of-n uses identical components R and the binomial of i≥k working.",
        "inputs": {
            "config": "parallel",
            "reliabilities": [
                0.9,
                0.8,
                0.95
            ]
        },
        "components": 3,
        "system_reliability": 0.999,
        "system_failure_probability": 0.001
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:49.456Z",
        "request_id": "d742da98-7197-4a24-88c0-f65c6b7e1682"
    },
    "status": "ok",
    "message": "System reliability",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reliability-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Use consistent time units (hours by default for MTBF/MTTR). Availability assumes a year of 8760 h. For queueing/wait times use a queue API.",
        "service": "reliability-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/system": "System reliability from component reliabilities (series, parallel, k-of-n).",
            "GET /v1/reliability": "Reliability, failure probability and hazard rate at a mission time (exponential or Weibull).",
            "GET /v1/availability": "Availability and downtime from MTBF/MTTR, a target availability, or nines."
        },
        "description": "Reliability engineering: availability & SLA nines, exponential/Weibull reliability, and series/parallel/k-of-n system reliability."
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:49.522Z",
        "request_id": "08db6d22-4440-43ff-bbe6-3ff5ae4a8346"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/reliability-api
OpenAPI spec: https://www.oanor.com/api/reliability-api/openapi.json
