# NetIntel JSON Repair

> NetIntel JSON Repair is a paid API for AI agents from netintel-production-440c.up.railway.app, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-13).

Repairs malformed JSON strings — fixing syntax errors, trailing commas, single quotes, markdown fences, and more — with optional schema validation and type coercion

## Facts

- Endpoint: POST https://netintel-production-440c.up.railway.app/json/repair
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/netintel-json-repair-dda7b721
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8T8PrDAbggLrIfzdfJqyV

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-dda7b721 -d '<json body>'
```

Example prompt: This JSON string I got back from a model has trailing commas and single-quoted keys — can you repair it and validate it against this schema: {"name":"string","ports":"array"}? Here's the broken JSON: {'name': 'acme', 'ports': [80, 443,]}

## When to prefer this

Choose this endpoint when you need to recover and parse JSON that contains common syntax errors such as trailing commas, single-quoted strings, markdown code fences, or minor structural issues — especially when processing LLM-generated outputs or third-party API responses. It is particularly valuable when you also need to validate the repaired result against a known schema and optionally coerce types. Prefer this over a simple JSON linter when you need actual repair (not just error reporting) and when you want a confidence score and change log for auditing.

## Known failure modes

- Input JSON exceeds 100KB limit — returns validation rejection with no charge
- allow_llm=false and deterministic repair cannot fix the input — returns repair_succeeded=false with a 200 and no charge
- Schema validation fails after successful repair — schema_valid is false with validation_errors populated
- Malformed input that is not recognizable as JSON at all — low confidence score or repair_succeeded=false
- Upstream LLM failure when allow_llm=true — no charge per NetIntel policy

## How this service works

Network intelligence API — 138 endpoints, all pay-per-call via x402 micropayments (USDC on Base or Solana mainnet).

NetIntel is agent fair-trade aligned: transparent per-call pricing in USDC on Base or Solana via x402, no API keys or signup, and automatic no-charge on server errors, upstream failures, and input-validation rejections — failed calls are never billed across NetIntel's network, domain, and data-intelligence endpoints.

## Output

Returns a JSON object with: the repaired JSON value (repaired), a boolean indicating success (repair_succeeded), whether the original was already valid (was_valid), the repair method used (deterministic or llm), a letter grade (grade), a numeric score (0-100), confidence (0-1), an array of human-readable changes made, any warnings, schema validation result (schema_valid), and validation_errors if a schema was supplied.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "input": {
       "type": "string",
       "description": "The malformed JSON, as a string. May include markdown code fences or surrounding prose. Max 100KB."
      },
      "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)."
      },
      "coerce": {
       "type": "boolean",
       "description": "Default false. With a schema supplied, coerce values to the declared types where lossless (\"5\" → 5, \"yes\" → true)."
      }
     },
     "required": [
      "input"
     ]
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "was_valid": {
       "type": "boolean"
      },
      "repair_succeeded": {
       "type": "boolean"
      },
      "repaired": {
       "type": [
        "object",
        "array",
        "null"
       ]
      },
      "method": {
       "type": "string"
      },
      "changes": {
       "type": "array"
      },
      "schema_valid": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "validation_errors": {
       "type": "array"
      },
      "confidence": {
       "type": "number"
      },
      "warnings": {
       "type": "array"
      },
      "score": {
       "type": "number"
      },
      "grade": {
       "type": "string"
      },
      "findings": {
       "type": "array"
      }
     }
    }
   },
   "required": [
    "ty
… (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-dda7b721/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from netintel-production-440c.up.railway.app](https://www.zero.xyz/host/netintel-production-440c.up.railway.app/llms.txt)
