# API Usage Secondary-Measure Weighted Mean Calculator

> API Usage Secondary-Measure Weighted Mean Calculator is a paid API for AI agents from market.datapackvibe.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-18).

Computes a secondary-measure weighted mean (e.g. latency weighted by request count) across up to 200 API usage records, grouped by endpoint and date.

## Facts

- Endpoint: POST https://market.datapackvibe.com/x402/assistant-sector-analytics-api-usage-weighted-average?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-usage-secondary-measure-weighted-mean-calculator-a6f4b9b0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MUBY3xWHnHzSBvT0OGWQm

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 api-usage-secondary-measure-weighted-mean-calculator-a6f4b9b0 -d '<json body>'
```

Example prompt: Calculate the weighted mean of latency_ms (weighted by requests) across these 4 API usage records: endpoint group-a on 2026-10-01 had 10 requests and 1ms latency, group-b on 2026-10-02 had 20 requests and 2ms, group-a on 2026-10-03 had 15 requests and 3ms, and group-b on 2026-10-04 had 30 requests and 4ms.

## When to prefer this

Choose this endpoint when you have tabular API usage data with request counts and latency values and need a statistically correct weighted mean rather than a simple arithmetic average. It is purpose-built for API analytics datasets with up to 200 records, processed locally without external dependencies. Prefer it over generic statistics APIs when your data matches the endpoint/date/requests/latency_ms schema exactly.

## Known failure modes

- Empty or missing rows array returns validation error
- More than 200 rows submitted exceeds maxItems limit
- Invalid date format (not YYYY-MM-DD) causes schema rejection
- Null values in both requests and latency_ms for all rows may produce undefined result
- Invalid field enum value (not 'requests' or 'latency_ms') causes rejection
- row_id missing or empty string triggers required field error

## How this service works

API usage - Secondary-measure weighted mean: Secondary-measure weighted mean for API usage. Up to 200 supplied typed records. Local numeric and data-quality processing; no external enrichment or forecasting. One of 25 profiles or calculations across 20 shared operations in this sector. 0.01 USDC includes one bounded secondary-measure weighted mean deliverable.

## Output

Returns a single weighted mean value computed by using one numeric field (e.g. latency_ms) as the measure and the other (e.g. requests) as the weight, across all supplied API usage records. The calculation is performed locally with no external enrichment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "rows": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "row_id",
     "endpoint",
     "date",
     "requests",
     "latency_ms"
    ],
    "properties": {
     "date": {
      "type": "string",
      "default": "",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "maxLength": 10
     },
     "row_id": {
      "type": "string",
      "default": "",
      "maxLength": 80,
      "minLength": 1
     },
     "endpoint": {
      "type": "string",
      "default": "",
      "maxLength": 80
     },
     "requests": {
      "type": [
       "number",
       "null"
      ],
      "maximum": 1000000000000,
      "minimum": -1000000000000
     },
     "latency_ms": {
      "type": [
       "number",
       "null"
      ],
      "maximum": 1000000000000,
      "minimum": -1000000000000
     }
    },
    "additionalProperties": false
   },
   "default": [
    {
     "date": "2026-10-01",
     "row_id": "row-1",
     "endpoint": "group-a",
     "requests": 10,
     "latency_ms": 1
    },
    {
     "date": "2026-10-02",
     "row_id": "row-2",
     "endpoint": "group-b",
     "requests": 20,
     "latency_ms": 2
    },
    {
     "date": "2026-10-03",
     "row_id": "row-3",
     "endpoint": "group-a",
     "requests": 15,
     "latency_ms": 3
    },
    {
     "date": "2026-10-04",
     "row_id": "row-4",
     "endpoint": "group-b",
     "requests": 30,
     "latency_ms": 4
    }
   ],
   "maxItems": 200,
   "minItems": 1
  },
  "field": {
   "enum": [
    "requests",
    "latency_ms"
   ],
   "type": "string",
   "default": "requests"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-usage-secondary-measure-weighted-mean-calculator-a6f4b9b0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market.datapackvibe.com](https://www.zero.xyz/host/market.datapackvibe.com/llms.txt)
