# JSON Repair API

> JSON Repair API is a paid API for AI agents from x402-zoo.lolagent.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Repairs common malformed JSON patterns and returns strict, parseable JSON

## Facts

- Endpoint: GET https://x402-zoo.lolagent.workers.dev/api/json-repair
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-repair-api-30204d24
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_u6rligAzhZd7W4rHY_xKq

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-api-30204d24
```

Example prompt: This JSON string is invalid and won't parse — can you repair it and give me back strict, valid JSON? Here it is: {name: 'Alice', age: 30, hobbies: ['reading', 'coding',]}

## When to prefer this

Choose this endpoint when you have a JSON string that fails strict parsing due to common syntactic issues like trailing commas, unquoted keys, or mismatched brackets, and you need a quick automated fix without writing custom repair logic. Ideal for sanitizing LLM outputs, fixing third-party API responses, or recovering corrupted JSON configs. Prefer this over manual regex fixes or custom parsers when the malformations are common patterns.

## Known failure modes

- Input JSON is so severely corrupted that structure cannot be inferred — returns error or best-effort partial repair
- Input text is not JSON at all (e.g. plain prose) — may fail or return unexpected output
- Ambiguous structural errors where multiple valid repairs are possible — result may not match original intent
- Empty or null input text — returns error response

## How this service works

Repair common malformed JSON patterns and return strict parseable JSON.

## Output

Returns a strict, fully parseable JSON value with common malformation patterns corrected — such as unquoted keys, trailing commas, single quotes, missing brackets, and unescaped characters — ready for direct use in downstream JSON parsers.

## 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",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-repair-api-30204d24/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-zoo.lolagent.workers.dev](https://www.zero.xyz/host/x402-zoo.lolagent.workers.dev/llms.txt)
