# HTTPay Token Correlations API

> HTTPay Token Correlations API is a paid API for AI agents from httpay.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Calculates a Pearson correlation matrix between Base ecosystem tokens over a specified time period to support portfolio optimization and diversification analysis.

## Facts

- Endpoint: POST https://httpay.xyz/api/token-correlations
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/httpay-token-correlations-api-a4e7a854
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HR7y1BtTOwQYO7K4qFOQj

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 httpay-token-correlations-api-a4e7a854 -d '<json body>'
```

Example prompt: Show me the price correlation matrix for WETH, AERO, and cbBTC on Base over the last 7 days — I want to see the diversification score and which pairs are most correlated.

## When to prefer this

Use this endpoint when an AI agent needs quantitative correlation analysis between Base ecosystem tokens specifically — particularly when building portfolio optimization logic, assessing diversification, or evaluating co-movement risk among DeFi tokens on Base. Prefer this over generic price feeds when the goal is pairwise statistical relationships rather than raw prices.

## Known failure modes

- Invalid or unrecognized token symbols return an error or empty matrix
- Unsupported period format causes a 400 bad request
- Insufficient historical price data for the requested period may yield incomplete results
- Payment failure (402) if USDC balance is insufficient or x402 handshake fails
- Rate limiting or server errors on the httpay.xyz infrastructure

## How this service works

Calculate price correlation matrix between Base ecosystem tokens. Params: ?tokens=WETH,AERO,cbBTC&period=7d. Returns Pearson correlation coefficients, diversification score, and portfolio insights. Useful for portfolio optimization agents.

## Output

Returns a JSON object with a Pearson correlation coefficient matrix for the requested tokens, an overall diversification score, and natural-language portfolio insights to guide asset allocation decisions.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "description": "Calculate price correlation matrix between Base ecosystem tokens. Params: ?tokens=WETH,AERO,cbBTC&period=7d. Returns Pearson correlation coefficients, diversification score, and portfolio insights. Useful for portfolio optimization agents."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/httpay-token-correlations-api-a4e7a854/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from httpay.xyz](https://www.zero.xyz/host/httpay.xyz/llms.txt)
