# JSON Repair Endpoint

> JSON Repair Endpoint is a paid API for AI agents from x402-gateway-production-1f21.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Repairs and validates malformed JSON text, returning a corrected, well-formed JSON structure

## Facts

- Endpoint: POST https://x402-gateway-production-1f21.up.railway.app/json/repair?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-repair-endpoint-2c33d8fe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_k8LLFkaG9g1wPrNdCcAH8

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-endpoint-2c33d8fe -d '<json body>'
```

Example prompt: Can you repair this broken JSON for me? It has some missing quotes and a trailing comma: {name: 'Alice', age: 30,}

## When to prefer this

Choose this endpoint when you need a machine-payable, low-cost ($0.001 USDC) microservice to programmatically repair malformed JSON at scale — particularly useful in agentic pipelines where LLM outputs, scraped data, or external API responses frequently produce invalid JSON that needs automated correction before further processing.

## Known failure modes

- Input text too long (exceeds 250,000 character limit) — returns validation error
- Input text is so severely malformed that meaningful repair is impossible — may return partial result or error
- Missing required 'text' field in body — returns schema validation error
- Non-JSON input that cannot be interpreted as JSON at all — may fail or return empty result

## How this service works

Machine-payable x402 utilities for hashing, Base64, UUID generation, unit and timezone conversion, realtime crypto market data, webpage/document extraction, URL-to-Markdown, metadata, RAG ingestion and deterministic website change detection.

## Output

Returns a JSON object with a status field (e.g. 'ready') and the repaired, well-formed JSON output derived from the provided malformed input text, suitable for downstream parsing and processing.

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ready"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-repair-endpoint-2c33d8fe/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production-1f21.up.railway.app](https://www.zero.xyz/host/x402-gateway-production-1f21.up.railway.app/llms.txt)
