# Fractal Scaling API

> Fractal Scaling API is a paid API for AI agents from fractal-scaling-api.onrender.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-12-03).

Returns deterministic progressive selection indices for a 2D point set at a given scale value between 0 and 1, enabling reversible multi-resolution subsampling.

## Facts

- Endpoint: POST https://fractal-scaling-api.onrender.com/scale?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fractal-scaling-api-be997fd8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oJ2gxOBzVHGbgvtMLwrqm

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 fractal-scaling-api-be997fd8 -d '<json body>'
```

Example prompt: I have a set of 2D points and I want to progressively scale them down to about 30% — give me the deterministic indices of the best-coverage representative subset at scale 0.3.

## When to prefer this

Choose this endpoint when you need deterministic, reversible, coverage-optimal subsampling of a finite 2D point set at a specific fractional scale. It is especially useful when you need consistent indices across multiple scale levels (progressive refinement), spatial representativeness (maximum spread), and reproducibility. Prefer it over random sampling when determinism matters, and over grid-based thinning when your points are irregularly distributed.

## Known failure modes

- Invalid scale value outside [0,1] range — likely returns a 400 error
- Malformed or non-2D point data in the request body — parsing error
- Empty point set provided — undefined behavior or error
- Payment failure via x402 — request rejected without processing
- Server cold-start latency on Render free tier causing timeout

## How this service works

Fractal scale operation - 0.02 USDC per successful request

## Output

A JSON object containing: an array of selected_indices (integers identifying which points from the input set were chosen), and a stats object with the scale value used, total point count, number selected, how many were reused from a previous scale level, and coverage quality metrics (max, mean, and weighted mean coverage distance).

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "stats": {
       "type": "object"
      },
      "selected_indices": {
       "type": "array",
       "items": {
        "type": "integer"
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "stats": {
   "scale": 0.5,
   "total": 4,
   "selected": 2,
   "reuse_from_previous": 1,
   "max_coverage_distance": 0.578,
   "mean_coverage_distance": 0.289,
   "weighted_mean_coverage_distance": 0.289
  },
  "selected_indices": [
   3,
   0
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fractal-scaling-api-be997fd8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fractal-scaling-api.onrender.com](https://www.zero.xyz/host/fractal-scaling-api.onrender.com/llms.txt)
