# JSON Format / Pretty-Print API

> JSON Format / Pretty-Print API is a paid API for AI agents from lin-desk-x402.lindesk.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-11).

Formats, minifies, or pretty-prints JSON, CSV, YAML, or XML payload text into clean JSON output

## Facts

- Endpoint: GET https://lin-desk-x402.lindesk.workers.dev/v1/dataformat/json_format?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-format-pretty-print-api-9d7071bf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4uamOBaBlcy1LhONjV4xc

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-format-pretty-print-api-9d7071bf
```

Example prompt: Can you pretty-print this JSON for me with 2-space indentation so it's easier to read: {"b":1,"a":[1,2]}?

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call (no API key) JSON/data formatting or conversion utility, especially in agentic pipelines that already use x402 micropayment infrastructure on Base. Ideal for formatting debug output, normalizing API responses, or converting CSV/YAML/XML to JSON on demand without setting up a dedicated service.

## Known failure modes

- Input payload exceeds 100 KiB limit — request rejected
- Malformed or unparseable input text — errors array returned with validation details
- Invalid indent parameter (non-integer string) — may return error or default behavior
- Unsupported input format — conversion may fail with error details

## How this service works

Pay-per-call API for AI agents: turn any public web page or PDF into clean, LLM-ready Markdown. $0.002 per call in USDC on Base via x402. No API key, no signup.

## Output

Returns a JSON object containing the operation name ('json_format'), the formatted result string (pretty-printed or minified JSON), and elapsed processing time in milliseconds. The result field holds the reformatted text output.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "input"
     ],
     "properties": {
      "input": {
       "type": "string",
       "description": "Payload text (CSV/JSON/YAML/XML); max 100 KiB"
      },
      "indent": {
       "type": "string",
       "pattern": "^-?\\d+$",
       "description": "Indent; 0 = minify (default 2)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "op": {
       "type": "string"
      },
      "cols": {
       "type": "array"
      },
      "rows": {
       "type": "integer"
      },
      "valid": {
       "type": "boolean"
      },
      "errors": {
       "type": "array"
      },
      "result": {},
      "encoding": {
       "type": "string"
      },
      "elapsed_ms": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "op": "json_format",
  "mode": "pretty",
  "result": "{\n  \"b\": 1,\n  \"a\": [\n    1,\n    2\n  ]\n}",
  "elapsed_ms": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-format-pretty-print-api-9d7071bf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lin-desk-x402.lindesk.workers.dev](https://www.zero.xyz/host/lin-desk-x402.lindesk.workers.dev/llms.txt)
