# NetIntel JSON Repair

> NetIntel JSON Repair is a paid API for AI agents from netintel.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-11).

Repairs malformed JSON strings into valid JSON using a deterministic tokenizer with optional LLM fallback, schema validation, and type coercion

## Facts

- Endpoint: POST https://netintel.dev/json/repair?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/netintel-json-repair-956e9b40
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9DTxrENw739gSJlaePMb_

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 netintel-json-repair-956e9b40 -d '<json body>'
```

Example prompt: This JSON came back from the model with trailing commas, single quotes, and some prose around it — can you repair it into valid JSON and validate it against this schema: {"name": "string", "age": "number"}? Also coerce types where you can.

## When to prefer this

Choose this endpoint when you need to rescue broken JSON from LLM outputs, dirty data pipelines, or third-party APIs — especially when you want deterministic repair (no LLM cost) with an optional LLM fallback for trickier cases, plus built-in schema validation and type coercion in one call. Prefer it over hand-rolled parsers or generic LLM prompting when you need auditability (changes list, grade, confidence) and pay-per-call pricing without managing API keys.

## Known failure modes

- Input too severely malformed for deterministic tokenizer and allow_llm is false — returns repair_succeeded: false with a 200
- Input exceeds 100KB limit — returns an error
- Schema validation fails after successful repair — repair_succeeded is true but schema_valid is false with validation_errors populated
- LLM fallback unavailable or fails — falls back to deterministic result or returns repair_succeeded: false
- Input is valid JSON already — returns was_valid: true with no changes

## How this service works

Repair malformed JSON into valid JSON — fixes code fences, trailing commas, single quotes, unquoted keys, bad escapes, duplicate keys, truncation, and JSON buried in prose. A deterministic tokenizer runs first (no LLM cost), with an optional Haiku fallback, plus optional schema validation and type coercion — so agents can rescue broken model output or dirty data in one call.

## Output

Returns a JSON object with: repaired (the fixed JSON as an object/array/null), repair_succeeded (boolean), was_valid (boolean indicating input was already valid), method (how repair was achieved: deterministic or LLM), confidence (0-1 score), grade (letter grade of repair quality), changes (list of modifications made), warnings (non-fatal issues), schema_valid (boolean or null if no schema supplied), and validation_errors (list of schema violations if any).

## 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": [
      "input"
     ],
     "properties": {
      "input": {
       "type": "string",
       "description": "The malformed JSON, as a string. May include markdown code fences or surrounding prose. Max 100KB."
      },
      "coerce": {
       "type": "boolean",
       "description": "Default false. With a schema supplied, coerce values to the declared types where lossless (\"5\" → 5, \"yes\" → true)."
      },
      "schema": {
       "type": "object",
       "description": "Optional. Validate the repaired JSON against this schema. Accepts a flat field→type map ({\"n\":\"number\"}) or a JSON-Schema-shaped object ({\"type\":\"object\",\"properties\":{...},\"required\":[...]}). Types: string, number, integer, boolean, object, array, null."
      },
      "allow_llm": {
       "type": "boolean",
       "description": "Default true. When false, deterministic-only: if the tokenizer cannot fix the input, repair_succeeded is false (still a 200)."
      }
     }
    },
    "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",
     "properties": {
      "grade": {
       "type": "string"
      },
      "score": {
       "type": "number"
      },
      "method": {
       "type": "string"
      },
      "changes": {
       "type": "array"
      },
      "findings": {
       "type": "array"
      },
      "repaired": {
       "type": [
        "object",
        "array",
        "null"
       ]
      },
      "warnings": {
       "type": "array"
      },
      "was_valid": {
       "type": "boolean"
      },
      "confidence": {
       "type": "number"
      },
      "schema_valid": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "repair_succeeded": {
       "type": "boolean"
      },
      "validation_errors": {
       "typ
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "grade": "A",
  "score": 100,
  "method": "deterministic",
  "changes": [
   "removed markdown code fences",
   "converted 3 single-quoted strings to double-quoted",
   "removed 2 trailing commas"
  ],
  "findings": [],
  "repaired": {
   "name": "acme",
   "ports": [
    80,
    443
   ]
  },
  "warnings": [],
  "was_valid": false,
  "confidence": 1,
  "schema_valid": null,
  "repair_succeeded": true,
  "validation_errors": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/netintel-json-repair-956e9b40/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from netintel.dev](https://www.zero.xyz/host/netintel.dev/llms.txt)
