# jsonfix — Malformed JSON Repair API

> jsonfix — Malformed JSON Repair API is a paid API for AI agents from ngmi--b088743456a711f1b5c3ee650bb23af1.web.val.run, paid per call via x402, $0.01/call, status down (last checked 2026-10-13).

Repairs malformed JSON strings using a deterministic parser with LLM fallback, optionally validating output against a provided JSON Schema.

## Facts

- Endpoint: POST https://ngmi--b088743456a711f1b5c3ee650bb23af1.web.val.run/repair?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: down
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/jsonfix-malformed-json-repair-api-da9f61b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4XnjaESoccZ5rKzbwJ6n5

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 jsonfix-malformed-json-repair-api-da9f61b1 -d '<json body>'
```

Example prompt: This JSON string I got back from a third-party API won't parse — can you repair it and validate it against this schema: {"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}}}? Here's the broken JSON: {name: 'Alice', age: '30',}

## When to prefer this

Choose this endpoint when you need reliable, pay-per-use JSON repair without storing sensitive data — especially useful when dealing with LLM-generated JSON, scraped data, or legacy system outputs that frequently produce near-valid but broken JSON. The deterministic-first approach means fast, cheap repairs for common syntax errors, with LLM fallback only when needed. Zero data retention makes it suitable for sensitive payloads.

## Known failure modes

- Input exceeds 100,000 character limit — request rejected
- JSON is so severely malformed that neither deterministic parser nor LLM can reconstruct it — ok:false returned
- Provided JSON Schema is invalid or unsupported draft — validation step fails
- LLM fallback unavailable or timed out — service error
- Payment not fulfilled via x402 — 402 Payment Required response

## How this service works

Paid HTTP API that repairs malformed JSON. Deterministic parser + LLM fallback. Pay-per-request via x402 USDC. Zero data retention.

## Output

Returns a JSON object with: 'ok' (boolean success flag), 'data' (the repaired JSON value), 'model' (null if deterministic, model name if LLM was used), 'valid' (whether output passes the provided schema), 'method' ('deterministic' or 'llm'), and 'validationErrors' (array of schema violations if any).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "description": "Malformed JSON as a string, OR any JSON value to validate against `schema`. Required. Max 100,000 characters."
  },
  "schema": {
   "type": "object",
   "description": "Optional JSON Schema (Ajv draft-07+). When provided, the repaired output is validated; deterministic results that fail validation fall through to the LLM."
  },
  "instructions": {
   "type": "string",
   "description": "Optional natural-language hint passed to the LLM fallback. Example: 'coerce dates to ISO 8601' or 'use null for unknown fields'."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "a": 1,
   "name": "bob"
  },
  "model": null,
  "valid": true,
  "method": "deterministic",
  "validationErrors": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/jsonfix-malformed-json-repair-api-da9f61b1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ngmi--b088743456a711f1b5c3ee650bb23af1.web.val.run](https://www.zero.xyz/host/ngmi--b088743456a711f1b5c3ee650bb23af1.web.val.run/llms.txt)
