{"uid":"cap_bQ8jbSwufCS3Vm1Mh9gSh","slug":"json-repair-validation-api-a5c47ce8","name":"JSON Repair & Validation API","description":"Decision-grade security/due-diligence outcome reports ($20-$100) plus deterministic paid utilities ($0.001+) for software agents and automated workflows.","url":"https://api.bakhour.ca/json/repair","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string"}}},"responseSchema":{"type":"json","example":{"valid":true,"parsed":{"hello":"world"},"repaired":"{\"hello\":\"world\"}"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PmJAWRtQIea9bFEt6l7rR","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Takes malformed or invalid JSON text and repairs it, returning both the validated result and the repaired JSON string.","exampleAgentPrompt":"Can you repair this broken JSON for me so I can parse it? It has some missing quotes and a trailing comma: {hello: 'world', foo: 'bar',}","exampleUseCases":[{"title":"Fix LLM-generated malformed JSON","prompt":"The AI just returned some JSON with unquoted keys and extra commas — can you repair it so I can actually parse it? Here it is: {name: John, age: 30, tags: ['dev', 'ops',]}"},{"title":"Validate API response before processing","prompt":"I got this JSON back from a third-party API and I'm not sure it's well-formed. Can you check if it's valid and fix any issues? The string is: {\"status\":\"ok\",\"data\":{\"id\":42,\"name\":\"Alice\""},{"title":"Clean up user-submitted JSON input","prompt":"A user submitted this JSON config through our form and it seems broken — can you repair it and give me back the corrected version so I can save it? Here it is: {\"timeout\": 30, \"retries\": 3, \"host\": \"localhost\" \"port\": 8080}"}],"resultDescription":"Returns a JSON object with three fields: 'valid' (boolean indicating if the original input was valid JSON), 'parsed' (the parsed JavaScript object from the repaired JSON), and 'repaired' (a string containing the corrected, valid JSON).","failureModes":["Input text is so corrupted that no JSON structure can be inferred — repair may fail or return unexpected results","Non-JSON text passed as input may produce nonsensical repair output","Empty or null text input may result in an error or empty response","Ambiguous malformed JSON may be repaired in an unintended way if multiple interpretations exist"],"whenToPreferThis":"Choose this endpoint when you have a string that is intended to be JSON but fails to parse due to syntax errors — such as unquoted keys, trailing commas, mismatched brackets, missing quotes, or LLM-generated JSON with formatting issues. It is ideal for automated pipelines that need to sanitize untrusted or programmatically generated JSON before further processing. Prefer it over manual string manipulation when the corruption is complex or the structure needs to be preserved.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:50:52.085Z","isFirstParty":false}