---
title: "Exact descriptive statistics — LLMs cannot reliably sum 200 numbers; this can"
method: POST
path: "/api/calc/stats"
tags: ["Math"]
---

# Exact descriptive statistics — LLMs cannot reliably sum 200 numbers; this can

`POST /api/calc/stats`

## Request

- Base URL: `https://api.webbersites.com`
- URL: `https://api.webbersites.com/api/calc/stats`
- Auth: API key in header `X-PAYMENT`

Exact descriptive statistics — LLMs cannot reliably sum 200 numbers; this can. POST {values:[…]} for count/sum/mean/median/stddev/percentiles; {x:[],y:[]} for Pearson correlation + linear regression; {rows:[…], field} for object arrays — or {collection, field?} to run stats DIRECTLY ON YOUR DATASTORE collection (the paying wallet is the identity; reading extends its life 30 days). Up to 100k values, Kahan-summed.

Price: $0.005 per call, paid in USDC via the x402 protocol (see the x402 security scheme).

## Request body

- object
  - `values` unknown[]: numbers to describe
    - unknown
  - `x` unknown[]: with y: correlation + regression
    - unknown
  - `y` unknown[]
    - unknown
  - `rows` unknown[]: objects — with field/fields to pick columns
    - unknown
  - `field` string
  - `collection` string: run stats on YOUR datastore collection instead of posting data

## Response `200`

Success

- object
  - `count` number
  - `sum` number
  - `mean` number
  - `median` number
  - `min` number
  - `max` number
  - `variance` number
  - `stddev` number
  - `percentiles` object
  - `pearson_r` number
  - `regression` object

## Other responses

- `402`: Payment required — the response body lists accepted payment methods (amount, asset, network, pay-to address). Retry the request with a signed X-PAYMENT header.

---

[API](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api.md) · [All operations](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/revisions/c14a76c67a94?raw)
