API reference
Read models & reliability, create datasets and fit, read fleet forecasts, run strategy calculators, and push operational data — through the reliafy-client Python package or the raw HTTP API. Create a free account, then generate a token under Settings › API access.
reliafy-client is a thin Python wrapper over the HTTP API — each call maps to one endpoint (shown on the right). Pure standard library; you bring SurPyval.
Install & authenticate
pip install reliafy-client # installed as reliafy-client, imported as `reliafy`
import reliafy
reliafy.configure(token="rlf_...") # or set RELIAFY_TOKEN; base_url= for self-hostedCreate a token under Settings → API access (Pro on Reliafy Cloud).
reliafy.models
models.push(model, name, *, data=True, unit=None)POST /api/import/modelsPush a fitted SurPyval model and return its URL.
model | SurPyval model | required | A fitted SurPyval distribution. |
name | str | required | Model name. |
data | bool | optional | Upload the fitted observations too (default True → full plot, refittable). False = params only. |
unit | str | optional | Unit of the time axis. |
"https://reliafy.com/modelling/m/a1b2…" # str — open in the appmodels.push_params(distribution, params, name, *, unit=None, extras=None)POST /api/import/modelsPush a model by distribution + parameter values (no SurPyval object).
distribution | str | required | e.g. "weibull". |
params | number[] | {name,value}[] | required | Parameter values. |
name | str | required | Model name. |
unit | str | optional | Time unit. |
extras | dict | optional | gamma / p / f0 for offset / LFP / zero-inflation. |
"https://reliafy.com/modelling/m/…" # strmodels.list()GET /api/v1/modelsYour saved models.
[ { "id": "a1b2…", "name": "Bearing life", "distribution": "Weibull",
"kind": "distribution", "n": 30, "unit": "hours", "url": "/modelling/m/…" }, … ]models.get(model_id)GET /api/v1/models/{id}One model's fit.
model_id | str | required | Model id. |
{ "id": …, "distribution": "Weibull", "params": [{name, value, se, ci}],
"coefficients": [], "metrics": null, "gof": [{id, label, value}] }models.reliability(model_id, t=None, covariates=None)POST /api/v1/models/{id}/reliabilityEvaluate the reliability functions.
model_id | str | required | Model id. |
t | number | optional | Time to evaluate at. Omit for the whole curve. |
covariates | dict | optional | Covariate values for a proportional-hazards model. |
{ "at": { "reliability": 0.666, "failure": 0.334, "hazard": …,
"cumulative_hazard": …, "density": … } } # or {"curves": {...}}models.fit(dataset_id, distribution, name, *, mapping=None, unit=None, covariates=None, formula=None)POST /api/v1/fitFit and save a model from one of your datasets.
dataset_id | str | required | Dataset to fit. |
distribution | str | required | e.g. weibull, weibull_ph, best. |
name | str | required | Model name. |
mapping | dict | required | Role → column, e.g. {"x": "hours", "c": "failed"}. |
unit | str | optional | Time unit. |
covariates | str[] | optional | Covariate columns (PH). |
formula | str | optional | Formulaic covariate formula. |
{ "id": …, "name": "Bearing life", "distribution": "Weibull", "url": "/modelling/m/…" }reliafy.data
data.upload(name, *, csv=None, data=None)POST /api/v1/datasetsCreate a dataset from CSV text or column arrays.
name | str | required | Dataset name. |
csv | str | optional | Raw CSV text (with a header). Provide this or data. |
data | dict | optional | Column arrays, e.g. {"hours": [...], "failed": [...]}. |
{ "id": "d3…", "name": "Bearings", "n_rows": 8, "columns": ["hours","failed"], "url": "/datasets/d/…" }reliafy.strategy
strategy.optimal_replacement(distribution, params, planned_cost, unplanned_cost, *, unit=None)POST /api/v1/strategy/optimal-replacementCost-optimal preventive-replacement interval.
distribution | str | required | e.g. weibull. |
params | number[] | required | Distribution parameters. |
planned_cost | number | required | Cost of a planned replacement. |
unplanned_cost | number | required | Cost of a failure. |
unit | str | optional | Time unit. |
{ "optimal_time": 580.5, "optimal_cost_rate": 0.51, "beneficial": true, "mttf": 1272.4 }strategy.failure_finding(distribution, params, target_availability, *, unit=None)POST /api/v1/strategy/failure-findingInspection interval for a hidden (protective) function.
distribution | str | required | e.g. exponential. |
params | number[] | required | Distribution parameters. |
target_availability | number | required | Target availability in (0,1), e.g. 0.99. |
unit | str | optional | Time unit. |
{ "interval": 176.4, "method": "…", "mttf": 8760, "target_availability": 0.99 }reliafy.fleet
fleet.forecast(fleet_id)GET /api/v1/fleets/{id}/forecastThe live failure forecast for one of your fleets.
fleet_id | str | required | Fleet id (from /fleet/forecasts/<id>). |
{ "fleet": {id, name, model_id}, "forecast": {status, method, periods, expected_failures, …} }- Errors raise
reliafy.ReliafyError; reads/writes are scoped to your own data. - Full request/response field tables are on the HTTP API tab.