JSON Repair API - fix broken LLM JSON, validate schema
json_repair_validateYour model returned almost-JSON? Send the raw text, get valid JSON back plus the list of every fix. No extra key or account needed. Handles ```json fences and chatty text around the JSON, trailing or missing commas, single and smart quotes, unquoted keys, comments, Python True/None, NaN, raw newlines in strings and output cut off mid-string (closed cleanly). Optional JSON Schema (draft 2020-12/2019-09/07) check with exact error paths, plus safe coercion ("42" -> 42, "true" -> true, value -> [value]). Nothing stored, ~1-25 ms. For AI agents, LLM apps, n8n/Make flows and backend payload checks. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/json-repair-validate.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"json": "Sure! Here it is:\n```json\n{'name': 'Ada', tags: [\"math\", \"code\",], active: True, // note\n \"bio\": \"First programmer, see http://x.com//ada\", \"born\": \"1815\"",
"schema": {
"type": "object",
"required": [
"name",
"born"
],
"properties": {
"born": {
"type": "integer"
},
"name": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"name": "json_repair_validate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | No | The broken JSON text (or the whole model answer with prose around it), max 1,000,000 chars | |
| coerce | No | With a schema: cast obvious type mismatches ("12" -> 12, "true" -> true, value -> [value]) and list each cast as a fix | |
| schema | No | Optional JSON Schema to validate the repaired data against (object or JSON string; remote $ref not fetched) | |
| extract | No | Which JSON block to take when the text holds several: first, largest or all | first |