# stats-regression

> stats-regression is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Performs ordinary least squares (OLS) simple linear regression on two numeric arrays, returning slope, intercept, and R-squared.

## Facts

- Endpoint: GET https://x402.agentindex.world/stats/regression?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stats-regression-48534bc3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cIz9k1mt2rQNdkd1MJj2o

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 stats-regression-48534bc3
```

Example prompt: Can you run a simple linear regression on these two arrays — x: [1,2,3,4,5] and y: [2.1,3.9,6.2,7.8,10.1] — and tell me the slope, intercept, and R-squared?

## When to prefer this

Use this endpoint when you need a fast, pay-per-call OLS simple linear regression (single predictor) with R-squared, without setting up a local stats library or managing API keys. Ideal for agents doing ad-hoc analytics, validating linear trends, or building lightweight data pipelines. For multiple regression or non-linear fitting, look elsewhere.

## Known failure modes

- Arrays of different lengths cause a validation error
- Arrays with fewer than 2 elements are rejected (minItems: 2)
- Non-numeric values in either array cause a schema validation failure
- Perfectly vertical data (zero variance in x) causes division by zero / undefined slope
- Payment failure or insufficient funds returns HTTP 402

## How this service works

Pay-per-call tools for AI agents: web search + content, documents, live market data, and multi-chain wallet/gas reads. Mainnet test from $0.000001 USDC on Base. Pay-per-call tools for AI agents in USDC on Base (x402/MPP): search, pdf, web-read, extract, summarize, fact-check, translate, jobs, discover. See GET /capabilities.

## Output

Returns the OLS regression slope (rate of change of y per unit x), intercept (y-value when x is zero), and R-squared (coefficient of determination, 0–1, indicating how much variance in y is explained by x).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "x": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "title": "X",
   "minItems": 2
  },
  "y": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "title": "Y",
   "minItems": 2
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "slope": 2,
  "intercept": 0,
  "r_squared": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stats-regression-48534bc3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
