{"uid":"cap_79TwDS9XKkNEb5zIy8J_q","slug":"24k-labs-json-repair-9656dd91","name":"24K Labs JSON Repair","description":"Fix malformed or truncated JSON (trailing commas, unquoted keys, cut-off LLM output) into valid, parseable JSON.","url":"https://api.24klabs.ai/api/v1/json-repair","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"json":{"type":"string"}}},"responseSchema":{"type":"json","example":{"repaired":{"name":"Bob"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.008","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.008/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_0y1lNt8EI7bGkDuhRQxED","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.008","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fixes malformed or truncated JSON (trailing commas, unquoted keys, cut-off LLM output) into valid, parseable JSON.","exampleAgentPrompt":"This JSON from my LLM pipeline is broken — it has trailing commas and an unquoted key — can you repair it so it parses correctly? Here it is: {name: \"Alice\", scores: [10, 20,]}","exampleUseCases":[{"title":"Fix truncated LLM pipeline output","prompt":"My AI model returned this JSON but it got cut off mid-response and won't parse — can you repair it and give me back valid JSON? Here's the broken string: {\"users\": [{\"id\": 1, \"name\": \"Bob\""},{"title":"Clean JSON with trailing commas","prompt":"I have this JSON object with trailing commas that keeps throwing parse errors: {\"color\": \"red\", \"size\": \"large\",} — can you fix it so it's valid?"},{"title":"Repair JSON with unquoted keys","prompt":"This config JSON came back with unquoted keys and it's failing validation: {host: \"localhost\", port: 8080, debug: true} — please fix it into proper valid JSON."}],"resultDescription":"Returns a valid, parseable JSON string with all syntax errors corrected — trailing commas removed, unquoted keys properly quoted, truncated structures closed, and any other malformations resolved.","failureModes":["Input is so severely truncated that the intended structure cannot be inferred — returns best-effort repair or error","Input is not JSON at all (e.g. plain text or XML) — may return an error or unrecognized format response","Ambiguous repair cases where multiple valid completions exist — endpoint picks one heuristically, which may not match original intent","Network or service unavailability returns a 5xx error"],"whenToPreferThis":"Choose this endpoint when you need to recover malformed or truncated JSON programmatically, especially when dealing with LLM-generated output that may be cut off or contain common syntax errors like trailing commas or unquoted keys. Prefer it over manual string manipulation when the JSON structure is complex or the error type is unpredictable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:56:03.867Z","isFirstParty":false}