# PennyRail JSON Flatten

> PennyRail JSON Flatten is a paid API for AI agents from pennyrail.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Flattens a nested JSON object into a single-level key-value representation

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/f/json.flatten
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pennyrail-json-flatten-b495493c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_C40S5uXp11WJJB4wyZTlJ

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 pennyrail-json-flatten-b495493c -d '<json body>'
```

Example prompt: Flatten this nested JSON object for me so all the keys are at the top level: {"user":{"name":"Alice","address":{"city":"New York","zip":"10001"}}}

## When to prefer this

Choose this endpoint when you need a quick, pay-per-call microservice to flatten a nested JSON object without setting up local transformation logic. It is ideal for lightweight agent pipelines that occasionally encounter deeply nested JSON and need a normalized flat structure. Prefer alternatives (local libraries, free utilities) for high-volume batch flattening where per-call cost would add up.

## Known failure modes

- Missing required 'input' field returns an error response
- Input value is not a valid JSON object (e.g. array or primitive) may cause unexpected behavior or error
- Extremely large or deeply nested objects may time out or exceed payload limits
- Service unavailability on the Vercel deployment returns 5xx errors
- Payment failure via x402 protocol prevents the call from completing

## How this service works

Machine-readable settlement service

## Output

Returns an object containing the operation name (e.g. 'flatten') and the result, which is the input JSON object flattened to a single level with nested keys joined by a delimiter (e.g. dot notation). Additional metadata may be present as extra properties.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "description": "JSON object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "operation",
  "result"
 ],
 "properties": {
  "result": {},
  "operation": {
   "type": "string"
  }
 },
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pennyrail-json-flatten-b495493c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyrail.vercel.app](https://www.zero.xyz/host/pennyrail.vercel.app/llms.txt)
