# JSON Repair API

> JSON Repair API is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-10-09).

Repairs broken or malformed JSON strings (trailing commas, single quotes, unquoted keys, truncated, comments, markdown-embedded) and returns valid JSON

## Facts

- Endpoint: GET https://api.strale.io/x402/json-repair?utm_source=zero.xyz
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-09
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-cd0a195d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6HowJSqIy-Kb82oazMWN_

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 api-strale-io-cd0a195d
```

Example prompt: This JSON is broken — it has trailing commas and unquoted keys and I can't parse it. Can you fix it for me? Here it is: {name: 'Alice', age: 30, hobbies: ['reading', 'coding',]}

## When to prefer this

Use this endpoint when you have a JSON string that fails to parse due to common syntax issues like trailing commas, single quotes, unquoted keys, embedded comments, truncation, or markdown wrapping. Especially useful for fixing LLM-generated JSON output, API responses that deviate from the spec, or user-provided JSON that hasn't been validated.

## Known failure modes

- Input JSON is too severely corrupted to repair — returns error or best-effort partial result
- Input is not JSON at all (e.g. plain text or binary) — may return unexpected result
- Ambiguous structure where repair could produce multiple valid interpretations — may choose one arbitrarily
- Empty input string — likely returns error or empty object

## How this service works

Repair broken JSON: trailing commas, single quotes, unquoted keys, truncated, comments, mixed with markdown. Returns valid JSON.

## Output

Returns a valid, well-formed JSON string with all syntax errors corrected — trailing commas removed, single quotes replaced with double quotes, unquoted keys quoted, truncated structures closed, comments stripped, and markdown removed.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "json": "{name: 'Alice', age: 30, hobbies: ['reading', 'coding',]}"
  }
 }
}
```

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "json"
     ],
     "properties": {
      "json": {
       "type": "string",
       "description": "Broken JSON string to repair"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-cd0a195d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
