# pretty-print

> pretty-print is a paid API for AI agents from intel.rallylive.ca, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Formats JSON, HTML/XML, and SQL into human-readable indented output with detected type and line count.

## Facts

- Endpoint: GET https://intel.rallylive.ca/dev/pretty
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pretty-print-408e204f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3c23SoWzTcVzabhURmae5

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 pretty-print-408e204f
```

Example prompt: Can you pretty-print this JSON for me and sort the keys alphabetically? Here it is: {"z":1,"a":2,"m":3}

## When to prefer this

Choose this endpoint when you need lightweight, single-call formatting of JSON, HTML/XML, or SQL without setting up a local linter or formatter. It's ideal for agents processing raw API responses, reviewing user-submitted code, or displaying structured data readably. The auto-detection of document type is useful when the format is uncertain.

## Known failure modes

- Input is not valid JSON, HTML/XML, or SQL — returns error or unformatted text
- Ambiguous or mixed-format input may be misdetected
- Very large documents may hit size limits or increase latency
- Missing 'input' parameter returns a 400-style error
- Malformed query parameters result in failure to parse

## How this service works

Pretty-printer: JSON (2-space indent, sorted keys optional via 'sorted:' prefix), HTML/XML (one tag per line, nested indentation) and SQL (keyword casing and clause breaks). Returns the formatted text, detected type and line count. $0.01 per document.

## Output

Returns the fully formatted text with proper indentation (2-space for JSON, one-tag-per-line for HTML/XML, keyword casing for SQL), plus the auto-detected document type (json/html/xml/sql) and the total line count of the formatted 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pretty-print-408e204f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from intel.rallylive.ca](https://www.zero.xyz/host/intel.rallylive.ca/llms.txt)
