# fittings JSON Flatten

> fittings JSON Flatten is a paid API for AI agents from fittings.sh, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Flattens arbitrarily nested JSON into a single-level object with dotted-path keys, or expands a flat dotted-path object back into nested JSON.

## Facts

- Endpoint: POST https://fittings.sh/v1/fmt/json-flatten
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fittings-json-flatten-8336cb94
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q0-04eEF4hJi8KcUehV2d

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 fittings-json-flatten-8336cb94 -d '<json body>'
```

Example prompt: Flatten this deeply nested JSON object into a single-level object using dotted paths: {"user":{"address":{"city":"Austin","zip":"78701"},"name":"Alice"}}.

## When to prefer this

Use this endpoint when you need a reliable, hosted, pay-per-call JSON flattening or unflattening operation without deploying your own code. Ideal for agents processing arbitrarily nested API responses, config objects, or database documents that need to be normalized for flat storage, CSV export, or environment variable mapping. Prefer this over a custom implementation when the nesting depth or leaf count is large and correctness matters.

## Known failure modes

- Input JSON exceeds 50,000 leaf nodes — returns error
- Nesting depth exceeds 64 levels — returns error
- Total key characters exceed 1,000,000 — returns error
- Malformed JSON input — returns parse error
- Empty or missing 'json' field in request body — returns validation error

## How this service works

Flatten arbitrarily nested JSON to a single-level object of dotted paths, or expand one back.

## Output

A single-level JSON object where each key is a dotted path representing the full depth of the original nesting (e.g. {"user.address.city": "Austin"}), or the inverse: a fully reconstructed nested JSON object from dotted-path keys. Supports up to 50,000 leaves, 1,000,000 key characters, and 64 levels of depth.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "json": {
   "type": "object",
   "description": "Any JSON value, up to 50000 leaves, 1000000 key characters and 64 levels deep"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fittings-json-flatten-8336cb94/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
