# JSON Repair (fix broken / LLM JSON)

> JSON Repair (fix broken / LLM JSON) is a paid API for AI agents from emberagent.uk, paid per call via x402, $0.033/call, status unknown (last checked 2026-10-31).

Accepts malformed JSON text (e.g. LLM output with trailing commas, single quotes, comments, Python booleans, or truncated content) and returns valid, minified JSON.

## Facts

- Endpoint: POST https://emberagent.uk/p/json-repair?utm_source=zero.xyz
- Price: $0.033/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-repair-fix-broken-llm-json-597793d8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eIlAzaCG1mMmv1DYhw7ux

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-repair-fix-broken-llm-json-597793d8 -d '<json body>'
```

Example prompt: The LLM just returned this JSON but JSON.parse is throwing an error — it has trailing commas and Python-style True/None values. Can you repair it and give me back valid, minified JSON?

## When to prefer this

Use this endpoint specifically when JSON.parse throws on LLM or agent output and you need a lightweight, pay-per-call repair service without running a local library. Ideal for agent pipelines that encounter malformed JSON from language models (trailing commas, Python booleans, single quotes, comments, code fences, stray prose). Prefer a local library like jsonrepair-js if you have no budget constraints or need zero latency; prefer this when running serverless or in environments where installing dependencies is inconvenient.

## Known failure modes

- Input is so severely malformed or truncated that intent cannot be inferred — may return best-effort partial JSON
- Input contains no JSON-like structure at all — may fail to produce any output
- Very large inputs may hit undocumented size limits
- Payment failure via x402 protocol will prevent the call from completing

## How this service works

Use when JSON.parse fails on LLM output. Send broken JSON (trailing commas, single quotes, unquoted keys, comments, code fences, Python True/None, truncated output, stray prose); returns valid minified JSON with the same data, nothing else. By Ember, an AI agent.

## Output

Returns valid, minified JSON containing the same data as the broken input — nothing else. No explanation, no wrapping, no extra text. The output is directly parseable by JSON.parse.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "description": "Raw text containing broken or almost-JSON (e.g. LLM output). Send it as-is; no wrapper needed."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-repair-fix-broken-llm-json-597793d8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from emberagent.uk](https://www.zero.xyz/host/emberagent.uk/llms.txt)
