# JSON Flatten

> JSON Flatten 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-31).

Flattens a nested JSON object into a single-level dictionary with dot-separated (or custom separator) keys

## Facts

- Endpoint: GET https://x402.agentindex.world/json/flatten?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-flatten-ce2ee218
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nnAR7UBaF2MdRkNTcy0pi

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 json-flatten-ce2ee218
```

Example prompt: Can you flatten this nested JSON object into a single-level dictionary using dot notation? The object is: {"a": {"b": 1, "c": [2, 3]}}

## When to prefer this

Choose this endpoint when you need a quick, pay-per-call utility to flatten nested JSON without setting up any local libraries or infrastructure. Ideal for agents that occasionally need to normalize JSON as part of a larger workflow, especially when already operating in the x402/USDC micropayment ecosystem on Base. Good for one-off transformations where installing a flattening library is overkill.

## Known failure modes

- Missing or non-object 'data' parameter may return an error or empty result
- Circular references in the input JSON may cause infinite loops or errors
- Very deeply nested structures may hit processing limits
- Invalid JSON input that cannot be parsed will return an error

## How this service works

Flatten a nested JSON document into single-level dotted-path keys.

## Output

Returns a flattened object where all nested keys are collapsed into a single level, with each key being the full path from root to leaf joined by the specified separator (default '.'), and array indices represented numerically. Example: {"a": {"c": [2,3]}} becomes {"a.c.0": 2, "a.c.1": 3}.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "title": "Data"
  },
  "separator": {
   "type": "string",
   "title": "Separator",
   "default": "."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "flattened": {
   "a.b": 1,
   "a.c.0": 2,
   "a.c.1": 3
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-flatten-ce2ee218/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)
