{"uid":"cap_jvbkK3avYiIozhXZWQPAG","slug":"vextorium-json-repair-validation-d24e671c","name":"Vextorium JSON Repair & Validation","description":"Repair broken JSON, typical of LLM output: strips ```json fences, comments and surrounding text, trailing commas, single quotes, unquoted keys, Python True/None and unclosed brackets. Returns the object and clean JSON and, if you pass a JSON Schema, whether it validates and why not.","url":"https://api.vextorium.com/v1/json-repair?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"required":["text"],"properties":{"text":{"type":"string"},"schema":{"type":"object","description":"optional JSON Schema"}}},"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","null"],"properties":{"json":{"type":["string","null"]},"object":{"type":["object","null"],"properties":{"age":{"type":["number","null"]},"name":{"type":["string","null"]},"tags":{"type":["array","null"],"items":{"type":["null","string"]}},"asset":{"type":["boolean","null"]}}},"repaired":{"type":["boolean","null"]},"was_already_valid":{"type":["boolean","null"]}}}}}}},"responseSchema":{"type":"json","example":{"json":"{\"name\": \"Ana\", \"edad\": 30, \"activo\": true, \"tags\": [\"a\", \"b\"]}","object":{"age":30,"name":"Ana","tags":["a","b"],"asset":true},"repaired":true,"was_already_valid":false}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5JMnP-3m6tcKarMMY4JvZ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs malformed JSON (LLM output artifacts, fences, comments, trailing commas, unquoted keys, Python literals, unclosed brackets) and optionally validates the result against a JSON Schema","exampleAgentPrompt":"The model returned a JSON blob wrapped in ```json fences with trailing commas and Python True literals — can you repair it and validate it against my schema to make sure all required fields are present?","exampleUseCases":[{"title":"Fixing LLM pipeline JSON output","prompt":"My pipeline keeps getting broken JSON from GPT-4 — it wraps everything in ```json fences and uses trailing commas. Can you repair this text and give me a clean parseable JSON object back?"},{"title":"Schema validation for agent responses","prompt":"I need you to take this raw text my AI assistant returned, strip out any junk, parse it as JSON, and then check whether it matches my schema — which requires a 'name' string, an 'age' number, and a 'tags' array."},{"title":"Cleaning Python-style JSON with None and True","prompt":"This JSON string has Python-style None and True values instead of null and true — can you repair it into valid JSON and tell me whether it was already valid or needed fixing?"}],"resultDescription":"Returns an object with four fields: 'object' (the parsed JavaScript object), 'json' (the cleaned, valid JSON string), 'repaired' (boolean, true if any fixes were applied), and 'was_already_valid' (boolean). If a JSON Schema was provided, also returns whether the repaired object validates against it and the reason if it does not.","failureModes":["Input text is so malformed it cannot be salvaged into any valid JSON structure — endpoint may return an error or null object","Schema provided is itself invalid JSON Schema — validation result may be unreliable","Input contains deeply nested truncated JSON — unclosed bracket repair may produce semantically incorrect output","Empty or whitespace-only input — likely returns null object with repaired=false"],"whenToPreferThis":"Choose this endpoint when you need to robustly parse JSON emitted by LLMs, which frequently includes markdown code fences, Python boolean/null literals, single-quoted strings, unquoted keys, trailing commas, or truncated structures. It is ideal for agentic pipelines where downstream steps require a clean parsed object. Prefer it over custom regex or ad-hoc parsing when you also need schema validation in the same call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T18:55:28.482Z","isFirstParty":false,"canonicalSlug":"vextorium-json-repair-validation-d24e671c"}