{"uid":"cap_9MK46H5na5Wll8XNKi3yz","slug":"animica-json-repair-api-bdbabe69","name":"Animica JSON Repair API","description":"Hand over malformed model output and a JSON Schema; get back JSON that provably satisfies it. Tries a pure-parse fast path FIRST and returns immediately when the input is already valid — you are not charged a model call for text that merely looked broken. Otherwise a small model repairs it and the result is validated in code before it is returned. Priced per call. For high-volume use, buy prepaid credits (POST /x402/credits/buy) and send X-Animica-Credits on each request — no settlement, no gas, no per-call payment round trip. Paying in ANM on the animica:1 lane is also ~25% cheaper because we sponsor no gas there.","url":"https://animica.dev/x402/json/repair","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"input":{"type":"string","description":"the malformed / fenced / prose-wrapped JSON"},"schema":{"type":"object","description":"JSON Schema the repaired value must satisfy"}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001794","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.001794/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001794","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001794","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_eGKskLwOhdo49ghHcRlQp","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001794","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs malformed, fenced, or prose-wrapped JSON strings and validates them against a provided JSON Schema","exampleAgentPrompt":"This JSON from the LLM response has markdown fences and is missing a closing bracket — can you repair it and make sure it matches this schema: {\"type\":\"object\",\"required\":[\"name\",\"age\"]}? Here's the broken JSON: ```{\"name\": \"Alice\", \"age\": 30```","exampleUseCases":[{"title":"Fixing LLM-generated JSON output","prompt":"The AI just returned this JSON wrapped in a markdown code block with a syntax error — can you repair it and validate it against this schema: {\"type\":\"object\",\"required\":[\"title\",\"score\"],\"properties\":{\"title\":{\"type\":\"string\"},\"score\":{\"type\":\"number\"}}}? Here's the raw output: ```json\\n{\"title\": \"Review\", score: 8.5\\n```"},{"title":"Cleaning prose-wrapped API response","prompt":"I got back a response that has JSON buried inside a paragraph of text — something like 'The result is {\"status\": \"ok\", \"count\": 42} as expected.' Can you extract and repair the JSON and confirm it satisfies the schema {\"type\":\"object\",\"required\":[\"status\",\"count\"]}?"},{"title":"Schema-conformant data repair pipeline","prompt":"I'm ingesting user-submitted JSON that sometimes arrives malformed with missing fields or extra commas — can you repair this string '{\"user_id\": 101,, \"email\": \"bob@example.com\"}' and make sure it conforms to the schema {\"type\":\"object\",\"required\":[\"user_id\",\"email\"],\"properties\":{\"user_id\":{\"type\":\"integer\"},\"email\":{\"type\":\"string\"}}}?"}],"resultDescription":"Returns a JSON object containing: `data` (the repaired and schema-validated JSON value), `method` (either 'parsed' if fixed syntactically or 'model_repaired' if an AI model was used), `model` (the model used if any), and `attempts` (number of repair attempts made).","failureModes":["Input JSON is so malformed that even model-based repair cannot produce schema-conformant output","Provided JSON Schema is invalid or unsatisfiable, causing all repair attempts to fail","Input string contains no JSON-like content at all","Schema constraints are too strict and the repaired JSON cannot satisfy them within allowed attempts","Network timeout or service error during model-based repair step"],"whenToPreferThis":"Use this endpoint when you need to programmatically fix malformed JSON — especially output from LLMs that wraps JSON in markdown fences, prose, or contains syntax errors — and you need the result validated against a specific JSON Schema. It is particularly valuable in agentic pipelines where LLM outputs must be reliably parsed. Prefer this over manual regex-based parsing or custom repair logic when schema conformance is required and robustness matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:48:55.779Z","isFirstParty":false}