{"uid":"cap_QZb_muKTQpD3kgr1IAgWd","slug":"json-repair-api-5ca2bd15","name":"JSON Repair API","description":"Automated 8-gate pre-flight readiness auditor for x402 v2, Dexter gas floor, IETF MPP, MCP Streamable HTTP, A2A v0.3.0 agent cards, OASF records, and ERC-8004 identity.","url":"https://preflight.agentdiet.dev/v1/json-repair?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","POST"],"type":"string"},"queryParams":{"type":"object","properties":{"raw_json":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"data":{},"status":"ok","roi_proof":{"compression_ratio_pct":91.4}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.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_VD2aniH8cMiDvDs5nM_cv","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs and normalizes malformed or invalid JSON strings into valid, well-formed JSON objects.","exampleAgentPrompt":"Can you fix this broken JSON for me? It has missing quotes and a trailing comma and I need it to be valid so I can parse it: {name: 'Alice', age: 30,}","exampleUseCases":[{"title":"Fix LLM-generated malformed JSON","prompt":"The AI model returned this JSON response but it's broken and I can't parse it — can you repair it and give me back valid JSON? Here's the raw output: {\"user\": \"bob\", \"score\": 42, \"tags\": [\"admin\", \"beta\",]}"},{"title":"Recover truncated API response","prompt":"My upstream API returned a truncated JSON blob and it's failing validation. Can you repair this partial JSON so it's parseable: {\"id\": 1001, \"items\": [{\"sku\": \"ABC\", \"qty\":"},{"title":"Clean up user-submitted JSON config","prompt":"A user pasted a config file into our form but it has syntax errors — unquoted keys, single quotes instead of double, and a missing closing brace. Can you fix this JSON so it's valid? Here it is: {name: 'my-project', version: '1.0', active: true"}],"resultDescription":"Returns a JSON object with a 'data' field containing the repaired valid JSON, a 'status' field indicating success or failure, and an 'roi_proof' object showing the compression_ratio_pct achieved during repair/normalization (e.g. 91.4%).","failureModes":["Input JSON is so corrupted it cannot be inferred or repaired — returns error status","Missing required 'input' parameter returns schema validation error","Input that is not JSON-like at all (e.g. plain text or binary) may fail to parse","Extremely large or deeply nested JSON may hit payload size limits"],"whenToPreferThis":"Choose this endpoint when you need a fast, cheap ($0.002 USDC) automated fix for malformed, truncated, or syntactically invalid JSON — especially useful for cleaning LLM-generated JSON, recovering partial API responses, or normalizing user-submitted config data. Best when you have a raw string that is JSON-like but fails standard parsers.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-20T18:48:23.078Z","isFirstParty":false,"canonicalSlug":"json-repair-api-5ca2bd15"}