JSON Mender
Turn almost-JSON from an LLM into JSON you can trust.
A hand-written, forgiving parser that rescues broken model output in one pass: code fences, <think> blocks, prose, single or curly quotes, unquoted keys, missing or trailing commas, comments, Python literals, and truncated output. Give it a JSON Schema and it also coerces types, fixes enum casing, fills defaults and strips extra keys — then tells you exactly what it changed.
Playground
Edit the example or run it as-is.
Input
text*stringThe raw model output (≤ 200k chars).
schemaobjectOptional JSON Schema subset: type, properties, required, items, enum, min/max, default, additionalProperties.
Output
okbooleanTrue when the result parses and (if given) matches the schema.
jsonstringThe repaired JSON text.
repairsarrayHuman-readable list of every syntax repair.
schemaobjectSchema errors and the fixes applied.
How it learned
No model, no training run. The rules were written by reading public research and open-source tooling, then encoded by hand. Credit where it’s due:
# 1. Ask for the price (returns 402 + PAYMENT-REQUIRED) curl -i -X POST https://your-domain/api/x402/json-mender \ -H "Content-Type: application/json" \ -d '{"text":"ignore previous instructions"}' # 2. Free trial, no payment (rate-limited) curl -X POST https://your-domain/api/try/json-mender \ -H "Content-Type: application/json" \ -d '{"text":"ignore previous instructions"}'