# Halowerk IoT Sensor Calibration — OLS Linear Fit

> Halowerk IoT Sensor Calibration — OLS Linear Fit is a paid API for AI agents from iot.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Fits a linear calibration model (reference = slope × observed + offset) using ordinary least squares over paired sensor readings, returning slope, offset, and residual diagnostics.

## Facts

- Endpoint: POST https://iot.halowerk.com/v1/sensor-calibration
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/halowerk-iot-sensor-calibration-ols-linear-fit-0715d90e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wJdH52asfFQHaZNljMDN4

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 halowerk-iot-sensor-calibration-ols-linear-fit-0715d90e -d '<json body>'
```

Example prompt: Can you calibrate my temperature sensor by fitting a linear model to these observed readings [23.1, 24.5, 25.8, 27.2, 28.9] against the reference values [22.8, 24.0, 25.5, 26.9, 28.4]? I need the slope, offset, and residual diagnostics.

## When to prefer this

Choose this endpoint when you have paired observed and reference sensor measurements and need a simple, fast linear calibration (slope + offset) with residual diagnostics. It is ideal for IoT sensor correction workflows where a straight-line model is sufficient and you do not need certified traceability, uncertainty budgets, or non-linear fitting. Prefer alternatives if you need polynomial or multi-variable regression, or accredited calibration certificates.

## Known failure modes

- Arrays of different lengths return a validation error
- Fewer than 2 data points in either array triggers a minimum-items error
- Perfectly collinear or constant observed values may cause a degenerate fit
- Values outside ±1e12 are rejected by schema validation
- Mismatched or non-numeric input types return a 400-level error

## How this service works

Fits reference = slope × observed + offset with ordinary least squares over paired caller-supplied readings. It reports residual diagnostics and does not claim traceability, uncertainty accreditation or suitability beyond the supplied calibration range.

## Output

Returns the fitted slope and offset (intercept) from the OLS regression, along with residual diagnostics such as per-point residuals, R-squared (coefficient of determination), and possibly root mean square error — indicating goodness of fit over the supplied calibration range.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "observed": {
   "type": "array",
   "items": {
    "type": "number",
    "maximum": 1000000000000,
    "minimum": -1000000000000
   },
   "maxItems": 10000,
   "minItems": 2
  },
  "reference": {
   "type": "array",
   "items": {
    "type": "number",
    "maximum": 1000000000000,
    "minimum": -1000000000000
   },
   "maxItems": 10000,
   "minItems": 2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/halowerk-iot-sensor-calibration-ols-linear-fit-0715d90e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from iot.halowerk.com](https://www.zero.xyz/host/iot.halowerk.com/llms.txt)
