Skip to content
Fourohtwo

Turns messy LLM output into valid JSON

verifylite.hydratinghealingtouch.workers.dev/sanitize-json

Turns messy LLM output into valid JSON: strips Markdown code fences and surrounding prose, fixes trailing commas, single quotes, unquoted keys, comments, Python True/None, cut-off brackets, and stringified JSON. Optionally validates the result against a JSON Schema (draft 4 to 2020-12) and lists each error with its location. Returns the parsed data, the JSON text, and what was changed. Not charged

BaseArcPolygonUnchecked
POSThttps://verifylite.hydratinghealingtouch.workers.dev/sanitize-json

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://verifylite.hydratinghealingtouch.workers.dev/sanitize-json", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"schema":{"properties":{"age":{"type":"integer"},"name":{"type":"string"}},"required":["name","age"],"type":"object"},"text":"```json\n{'name': 'Ada', 'age': 36,}\n```"}),
});
console.log(await res.json());

Example input

{
  "schema": {
    "properties": {
      "age": {
        "type": "integer"
      },
      "name": {
        "type": "string"
      }
    },
    "required": [
      "name",
      "age"
    ],
    "type": "object"
  },
  "text": "```json\n{'name': 'Ada', 'age': 36,}\n```"
}

More from VerifyLite