# Weighted Average Calculator with Plain Average Comparison

> Weighted Average Calculator with Plain Average Comparison is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Computes a weighted average of a list of values given corresponding weights, and returns the plain (unweighted) average alongside for comparison.

## Facts

- Endpoint: POST https://twin.unykorn.org/weighted-average?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/weighted-average-calculator-with-plain-average-comparison-30cad761
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_h7FJRGjhc0LqXlNq2kYmE

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 weighted-average-calculator-with-plain-average-comparison-30cad761 -d '<json body>'
```

Example prompt: Calculate the weighted average of [80, 90, 70] with weights [1, 2, 1], and also show me what the plain unweighted average works out to.

## When to prefer this

Use this endpoint when you need to compute a weighted average and want the plain average surfaced automatically for side-by-side comparison. Particularly useful for finance (portfolio returns), education (GPA), or survey analysis scenarios where different items have different levels of importance or representation. Choose this over a manual calculation when operating in an agentic workflow that already uses x402 micropayments.

## Known failure modes

- Mismatched lengths between values and weights arrays causing a 400 error
- Missing or empty values/weights parameters returning a validation error
- Non-numeric values in the arrays causing computation failure
- Payment failure via x402 protocol preventing endpoint access
- Weights summing to zero causing a division-by-zero error

## How this service works

Weighted average, with the plain average for comparison — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with a boolean ok status, the result type labeled 'weighted-average', the computed weighted average and plain average for comparison, a generated_at ISO8601 timestamp, and a payment receipt containing tx_hash, amount_usd, and receipt_id.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "values": {},
    "weights": {}
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "weighted-average",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.002,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/weighted-average-calculator-with-plain-average-comparison-30cad761/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
