{"slug":"netintel-dev-json-repair-51e7c9","title":"Repair malformed JSON into valid JSON — fixes code fences, trailing commas, sing","host":"netintel.dev","method":"POST","resource":"https://netintel.dev/json/repair","category":"code","description":"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 c","price_listed":0.02,"price_asked":0.02,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":927,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"input":"```json\n{'name': 'acme', 'ports': [80, 443,],}\n```"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"allow_llm":{"description":"Default true. When false, deterministic-only: if the tokenizer cannot fix the input, repair_succeeded is false (still a 200).","type":"boolean"},"coerce":{"description":"Default false. With a schema supplied, coerce values to the declared types where lossless (\"5\" → 5, \"yes\" → true).","type":"boolean"},"input":{"description":"The malformed JSON, as a string. May include markdown code fences or surrounding prose. Max 100KB.","type":"string"},"schema":{"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.","type":"object"}},"required":["input"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"changes":{"type":"array"},"confidence":{"type":"number"},"findings":{"type":"array"},"grade":{"type":"string"},"method":{"type":"string"},"repair_succeeded":{"type":"boolean"},"repaired":{"type":["object","array","null"]},"schema_valid":{"type":["boolean","null"]},"score":{"type":"number"},"validation_errors":{"type":"array"},"warnings":{"type":"array"},"was_valid":{"type":"boolean"}},"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.02,"price_match":true,"latency_ms":927,"error":null}],"description_full":"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.","last_updated":"2026-09-19T20:40:06.098Z","schemes":["exact"]}