# Return Tail Statistics Calculator

> Return Tail Statistics Calculator is a paid API for AI agents from heb-utils-x402.hebutils-api.workers.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-11).

Computes lower-tail quantile and conditional mean (CVaR-style) from a user-supplied series of periodic returns

## Facts

- Endpoint: GET https://heb-utils-x402.hebutils-api.workers.dev/return-tail-stats?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/return-tail-statistics-calculator-d3f3fc02
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_O6GWI22rFER_k188mAVYd

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 return-tail-statistics-calculator-d3f3fc02
```

Example prompt: I have 60 monthly portfolio returns as decimals — can you compute the lower-tail statistics at the 95% confidence level? Here are the values: 0.02, -0.03, 0.01, ... (comma-separated list)

## When to prefer this

Choose this endpoint when you need empirical lower-tail statistics (quantile + conditional tail mean) computed directly from a user-supplied return series of 20–250 observations, without needing a full risk platform or advisory service. It is ideal for lightweight, on-demand quantitative risk summaries in agent workflows where pay-per-call USDC micropayments are acceptable and no server-side data storage is needed.

## Known failure modes

- Fewer than 20 or more than 250 values supplied — request rejected
- Non-numeric or malformed comma-separated string causes parse error
- Confidence level outside 0.5–0.999 range causes validation failure
- Payment not made (x402 payment required before response is returned)
- Too few observations below the quantile threshold to compute a stable mean

## How this service works

Empirical lower-tail statistics of periodic returns you supply (decimals, 20-250 values): lower quantile and mean of observations at or below it. Numbers only, documented convention. Not advice, not a risk limit.

## Output

Returns the lower-tail quantile at the specified confidence level and the mean of all observations at or below that quantile, computed empirically from the supplied return series. Output is numeric — no advice or risk limits included.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "returns"
     ],
     "properties": {
      "returns": {
       "type": "string",
       "description": "comma-separated returns as decimals, 20-250 values"
      },
      "confidence": {
       "type": "string",
       "description": "up to 3 levels, 0.5-0.999"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/return-tail-statistics-calculator-d3f3fc02/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from heb-utils-x402.hebutils-api.workers.dev](https://www.zero.xyz/host/heb-utils-x402.hebutils-api.workers.dev/llms.txt)
