# JSON Repair and Schema Validation Service

> JSON Repair and Schema Validation Service is a paid API for AI agents from foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Repairs malformed or near-valid JSON into well-formed JSON and optionally validates it against a safe JSON Schema subset

## Facts

- Endpoint: POST https://foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev/v1/json/repair
- Price: $0.005/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-and-schema-validation-service-ec96de55
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LK-CB8SeiLgq5voAVxlT3

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-and-schema-validation-service-ec96de55 -d '<json body>'
```

Example prompt: This JSON from the LLM output has single-quoted strings, unquoted keys, and trailing commas — can you repair it into valid JSON and tell me what fixes were applied?

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair (not LLM-based guessing) — ideal for fixing predictable issues like trailing commas, single-quoted strings, and unquoted keys. Prefer it over manual parsing when you need an audit trail of exactly what repairs were applied, or when you want to validate the repaired output against a schema in a single call.

## Known failure modes

- Input too large or unbounded (service targets bounded near-JSON)
- Input is so malformed it cannot be deterministically repaired
- Schema validation fails after repair if provided schema is incompatible
- Invalid or unsupported JSON Schema subset provided for validation
- Network timeout or worker cold-start latency

## How this service works

Pay-per-request evidence and data tools: CSV validation and reconciliation, DNS/email configuration evidence, and bounded official weather, earthquake, vehicle, company and study records. Exact USDC prices, explicit JSON contracts and source provenance. No mailbox, ownership, medical or safety guarantees.

## Output

Returns a JSON object indicating whether the input was valid, whether repairs were applied, the repaired JSON string, and a list of named repair operations performed (e.g. 'quote-object-keys', 'convert-single-quoted-strings', 'remove-trailing-commas')

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "valid": true,
   "value": {
    "count": 2,
    "status": "ok"
   },
   "repairs": [
    "quote-object-keys",
    "convert-single-quoted-strings",
    "remove-trailing-commas"
   ],
   "repaired": true,
   "input_sha256": "8147e3f39e30dbd5b9b6c4d29a06d543dc7402eda2d1b3d8d00b508b36977546",
   "schema_valid": true,
   "output_sha256": "321dcf1c0f4785b1a8db97d962655d69b487533cc4a8ca81da64795c7ed16dfd",
   "schema_errors": [],
   "normalized_json": "{\"count\":2,\"status\":\"ok\"}"
  },
  "service": "Foundry PAR-007",
  "version": "illustrative",
  "endpoint": "json-contract-repair",
  "protocol": "x402-v2"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-repair-and-schema-validation-service-ec96de55/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev](https://www.zero.xyz/host/foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev/llms.txt)
