# 24K Labs Return & Risk Metrics Calculator

> 24K Labs Return & Risk Metrics Calculator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-13).

Computes CAGR, total return, annualized volatility, Sharpe ratio, and maximum drawdown from a value series or start/end/years inputs

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/return-cagr-drawdown
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-return-risk-metrics-calculator-ae5f0c2d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wMp5Gtx3ytBTSbTwjxRhY

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 24k-labs-return-risk-metrics-calculator-ae5f0c2d -d '<json body>'
```

Example prompt: Calculate the CAGR, annualized volatility, Sharpe ratio (using a 4.5% risk-free rate), and maximum drawdown for this series of monthly portfolio values: [100, 108, 115, 104, 120, 135, 128, 142, 155, 149, 162, 170].

## When to prefer this

Choose this endpoint when you need a comprehensive set of quantitative investment performance and risk metrics — especially CAGR, Sharpe ratio, and maximum drawdown — computed in a single call from a price or value series. Prefer it over building calculations manually or calling separate analytics APIs when you need a fast, cheap ($0.003), self-contained computation that covers both return and risk dimensions simultaneously.

## Known failure modes

- Insufficient data points in series for meaningful volatility or drawdown computation
- Missing required inputs (no series provided and no start/end/years combination)
- Risk-free rate not provided when Sharpe ratio is requested
- Non-numeric values in the series causing parsing errors
- Zero or negative start value causing division errors in return calculations
- Series with fewer than 2 data points returning an error

## How this service works

From a value series (or start/end/years): CAGR, total return, annualized volatility, Sharpe ratio (given risk-free) and maximum drawdown.

## Output

Returns a JSON object containing: CAGR (compound annual growth rate as a percentage), total return (percentage), annualized volatility (standard deviation of returns annualized), Sharpe ratio (excess return per unit of risk given the risk-free rate), and maximum drawdown (largest peak-to-trough decline in the series).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "series": {
   "type": "array"
  },
  "risk_free": {
   "type": "number"
  },
  "periods_per_year": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "cagr_pct": 94.6,
  "max_drawdown_pct": -5.56,
  "total_return_pct": 35
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-return-risk-metrics-calculator-ae5f0c2d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
