# BitBooth JSON Repair

> BitBooth JSON Repair is a paid API for AI agents from app.heinrichstech.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11).

Fixes malformed JSON strings (trailing commas, single quotes, unquoted keys, missing brackets) and optionally validates against a JSON Schema, paying 0.001 USDC per call with no API key required.

## Facts

- Endpoint: POST https://app.heinrichstech.com/v1/cdp/json-repair?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitbooth-json-repair-d6640ed0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nacJffU4XTV8ffFX0BNL2

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 bitbooth-json-repair-d6640ed0 -d '<json body>'
```

Example prompt: This LLM response came back with malformed JSON — trailing commas, single-quoted strings, and an unquoted key. Can you run it through BitBooth JSON Repair and also validate it against my schema?

## When to prefer this

Choose this endpoint when your agent receives JSON output from LLMs or third-party APIs that frequently contains common syntax errors like trailing commas, single quotes, or unquoted keys. It is ideal for defensive parsing pipelines where structured output cannot be trusted to be valid, especially when you also need JSON Schema validation in the same call. At $0.001 per call with no API key, it is suitable for high-frequency agentic workflows. Prefer it over rolling your own regex-based fixer when you need reliable, schema-aware repair.

## Known failure modes

- Input is so malformed it cannot be parsed even heuristically — returns error with description of unparseable content
- Provided JSON Schema is itself invalid — returns schema parse error
- Input is not JSON-like at all (e.g. plain text or binary) — returns cannot-repair error
- Payment of 0.001 USDC fails or is insufficient — returns payment error
- Rate limiting or server error — returns 5xx with error message

## How this service works

BitBooth JSON Repair: take any almost-JSON string (LLM tool output, broken API response, etc.), fix the common errors (trailing commas, single quotes, unquoted keys, missing brackets), and optionally validate against a JSON Schema. Built for AI agents that wrap every tool call in defensive parsing. Pay 0.001 USDC per call, no API key, no subscription.

## Output

Returns the repaired, valid JSON string along with a flag indicating whether the input required changes, details of what was fixed, and optionally a JSON Schema validation result including any schema errors found.

## 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": {
     "required": [
      "malformed"
     ],
     "properties": {
      "schema": {
       "type": "object",
       "description": "Optional JSON Schema to validate the repaired output against. AJV-compatible."
      },
      "malformed": {
       "type": "string",
       "description": "The broken JSON string to repair."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "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/bitbooth-json-repair-d6640ed0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from app.heinrichstech.com](https://www.zero.xyz/host/app.heinrichstech.com/llms.txt)
