# JSON Repair

> JSON Repair is a paid API for AI agents from digitalworkerapi.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-30).

Conservatively repairs common JSON syntax errors (unquoted keys, single-quoted strings, trailing commas) and returns a parsed, valid JSON object.

## Facts

- Endpoint: POST https://digitalworkerapi.com/v1/tools/json-repair?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-repair-46ed866b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Y7QNePHxHVwZQfisuuSAR

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-46ed866b -d '<json body>'
```

Example prompt: This JSON string is failing to parse because of unquoted keys and trailing commas — can you repair it and give me back a valid, parsed JSON object?

## When to prefer this

Choose this endpoint when you have JSON with known common syntax errors (unquoted keys, single-quoted strings, trailing commas) that need conservative repair without code evaluation. Ideal for fixing LLM-generated JSON, user-submitted payloads, or degraded API responses where you need a safe, non-evaluating parser. Prefer this over custom regex fixes or eval-based approaches when safety and predictability are priorities.

## Known failure modes

- Input JSON is too malformed to repair conservatively — returns an error indicating the structure cannot be salvaged
- Input body is empty or missing the required fields — returns a validation error
- JSON contains ambiguous structures that cannot be safely repaired without changing semantics — may return partial result or error
- Non-JSON content types submitted — returns a rejection error

## How this service works

Conservatively repair common JSON syntax errors (unquoted keys, single-quoted strings, trailing commas) and parse the result; input is never evaluated as code.

## Output

A valid, parsed JSON object produced by conservatively repairing the input's syntax errors (unquoted keys normalized to quoted, single-quoted strings converted to double-quoted, trailing commas removed). The input is never evaluated as code.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "enum": [
      "json"
     ],
     "type": "string"
    },
    "example": {}
   },
   "additionalProperties": false
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-repair-46ed866b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from digitalworkerapi.com](https://www.zero.xyz/host/digitalworkerapi.com/llms.txt)
