# Halowerk Leak Indicator API

> Halowerk Leak Indicator API is a paid API for AI agents from natur.halowerk.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Analyzes flow and pressure time series for water distribution zones to compute minimum night flow, infrastructure leakage index, and night pressure trend as independent leak indicators, then ranks all submitted zones by leak severity.

## Facts

- Endpoint: POST https://natur.halowerk.com/v1/leak-indicator
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/halowerk-leak-indicator-api-cca978d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Pn2oEzqf4gGuuEc2SSpQX

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-leak-indicator-api-cca978d2 -d '<json body>'
```

Example prompt: Analyze these two district metered areas for leaks — Zone A has 450 service connections, metered consumption of 12500 m3, and 4 weeks of hourly flow readings; Zone B has 280 connections and flow data but no pressure — use a night window ending at 4am, UTC offset of 60 minutes, and require at least 5 qualifying nights before scoring.

## When to prefer this

Choose this endpoint when you need quantitative, standards-aligned leak indicators (minimum night flow, ILI-style volume balance, pressure trend) for one or more district metered areas from raw time series data, especially when you need cross-zone ranking in a single call. It is purpose-built for water utility non-revenue water programmes and handles the statistical night-window analysis internally. Prefer it over generic time-series anomaly detectors when your domain is water distribution and you need hydraulic-domain-aware metrics like legitimate night consumption subtraction and pressure-dependent trend analysis.

## Known failure modes

- Fewer than min_nights nights with a sample in the night window — zone is excluded from scoring and flagged
- flow_series has fewer than 4 data points — validation error returned
- Timestamps without explicit time zone offset cause parsing errors
- metered_consumption_m3 does not span exactly the flow_series window — volume balance omitted or error returned
- Submitting more than 40 zones in a single call exceeds the array limit
- night_use_l_per_connection_h not provided and service_connections absent — legitimate night consumption cannot be separated
- HTTP 402 if x402 payment is not attached or USDC balance is insufficient

## How this service works

Takes one or more district metered areas, each with a flow series and optionally a pressure series, a metered consumption figure and a service connection count, and returns three independent leak indicators per area plus a ranking across all of them. The first is minimum night flow: the lowest flow inside the night window is taken for every night in the record, the median of those nightly minima is reported, and where a connection count is given the legitimate night consumption is subtracted so…

## Output

For each submitted zone the endpoint returns three independent leak indicators: (1) minimum night flow — the median of nightly minimum flows with legitimate night consumption subtracted where connection count is provided; (2) infrastructure leakage index or equivalent volume balance metric when metered consumption is supplied; (3) night pressure trend when a pressure series is provided. A cross-zone ranking is also returned, ordering areas from most to least leaky with the zone_id used as a tie-breaker. Zones that do not meet the min_nights threshold are flagged but not scored. Any unrecognised field names submitted inside a zone object are echoed back in the response.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "zones": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "zone_id",
     "flow_series"
    ],
    "properties": {
     "zone_id": {
      "type": "string",
      "maxLength": 40,
      "minLength": 1,
      "description": "Your own identifier. Returned unchanged; also the tie-break in the ranking."
     },
     "flow_series": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "timestamp",
        "flow_m3_h"
       ],
       "properties": {
        "flow_m3_h": {
         "type": "number",
         "maximum": 100000,
         "minimum": 0
        },
        "timestamp": {
         "type": "string",
         "description": "ISO 8601 with an explicit time zone."
        }
       }
      },
      "maxItems": 4032,
      "minItems": 4,
      "description": "Inlet flow. Needs a sample inside the night window on at least min_nights nights."
     },
     "pressure_series": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "timestamp",
        "pressure_bar"
       ],
       "properties": {
        "timestamp": {
         "type": "string"
        },
        "pressure_bar": {
         "type": "number",
         "maximum": 25,
         "minimum": 0
        }
       }
      },
      "maxItems": 4032,
      "minItems": 3,
      "description": "Optional. Used for the night pressure trend only."
     },
     "service_connections": {
      "type": "integer",
      "maximum": 1000000,
      "minimum": 1,
      "description": "Optional. Without it the legitimate share of the night flow cannot be separated out."
     },
     "metered_consumption_m3": {
      "type": "number",
      "maximum": 10000000,
      "minimum": 0,
      "description": "Optional. Must cover exactly the window spanned by flow_series. Without it there is no volume balance."
     },
     "night_use_l_per_connection_h": {
      "type": "number",
      "maximum": 50,
      "minimum": 0,
      "description": "Optional per-zone override of the assumed legitimate night use."
     }
    }
   },
   "maxItems": 40,
   "minItems": 1,
   "description": "The areas to assess. Unknown field names inside a zone are named back to you, never ignored."
  },
  "min_nights": {
   "type": "integer",
   "default": 2,
   "maximum": 30,
   "minimum": 1,
   "description": "Nights with a night-window sample required before a zone is scored. Below three, no trend."
  
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/halowerk-leak-indicator-api-cca978d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from natur.halowerk.com](https://www.zero.xyz/host/natur.halowerk.com/llms.txt)
