# AgentsTools Quant Risk Metrics

> AgentsTools Quant Risk Metrics is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-11).

Computes a full suite of portfolio risk metrics—VaR, CVaR, Sharpe, Sortino, max drawdown, Calmar, volatility, and more—from an array of periodic returns.

## Facts

- Endpoint: POST https://api.agentstools.dev/quant/risk?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentstools-quant-risk-metrics-1b4091f0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ijDtAxqfbcIYMCjS_Q3xr

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 agentstools-quant-risk-metrics-1b4091f0 -d '<json body>'
```

Example prompt: Calculate the Sharpe ratio, Sortino ratio, max drawdown, and value-at-risk at 95% confidence for this list of daily returns: [0.01, -0.02, 0.005, ...], assuming a risk-free rate of 4% annually and 252 trading periods per year.

## When to prefer this

Choose this endpoint when you need pure, stateless computation of standard quantitative risk metrics from a series of periodic returns—no data fetching, no storage, no external market data required. Ideal when you already have return series from your own data pipeline and want fast, reproducible risk analytics including VaR, CVaR, Sharpe, Sortino, max drawdown, and Calmar without standing up your own quant library.

## Known failure modes

- Missing or empty 'returns' array returns a validation error
- Returns array exceeding 10,000 entries is rejected
- Invalid metric name in the 'metrics' array causes a validation error
- Non-numeric values in returns array cause a parsing error
- Confidence value outside (0,1) range may produce unexpected results

## How this service works

Portfolio risk metrics over an array of periodic returns: value-at-risk, conditional VaR, Sharpe, Sortino, max drawdown, Calmar, volatility, and more. Pure computation over your inputs.

## Output

A JSON object containing the requested risk metrics computed from the provided returns array. Possible fields include mean, std, volatility (annualized), var_historical, var_parametric, cvar, downside_deviation, sharpe, sortino, max_drawdown, and calmar—each as a numeric value. If no metrics are specified, all are returned.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "metrics": {
   "type": "array",
   "items": {
    "enum": [
     "mean",
     "std",
     "volatility",
     "var_historical",
     "var_parametric",
     "cvar",
     "downside_deviation",
     "sharpe",
     "sortino",
     "max_drawdown",
     "calmar"
    ],
    "type": "string"
   },
   "description": "Which metrics to compute; omit for all"
  },
  "returns": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "description": "Periodic returns as decimals, at most 10000 entries"
  },
  "risk_free": {
   "type": "number",
   "description": "Annual risk-free rate as a decimal, default 0"
  },
  "confidence": {
   "type": "number",
   "description": "Confidence for VaR and CVaR, default 0.95"
  },
  "periods_per_year": {
   "type": "number",
   "description": "Annualization factor, default 252"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentstools-quant-risk-metrics-1b4091f0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
