JSON-Patcher API

Seamlessly repair incomplete or broken JSON data streams from LLMs in real-time, delivering a perfectly valid structure.

True Real-Time Streaming
Stop waiting for the entire LLM response. This API instantly repairs and streams valid JSON chunks as they arrive, enabling real-time typing effects for your users without breaking the frontend.
🛡️
Robust Error Recovery
Forget about missing quotes, trailing commas, or unexpected markdown fences. The API automatically detects and cleans up syntax errors, noise, and even truncated prefixes to guarantee valid JSON output.
🧠
Smart Contextual Defaulting
Prevent application crashes caused by missing values in lists or objects. The API intelligently analyzes key names to inject the most natural default values on the fly.

See It In Action

Before: Broken & Truncated
```json
id": 123, "tags": ["c", "cpp"
After: Repaired Output
{"id": 123, "tags": ["c", "cpp"]}

Automatically removes markdown noise, fixes missing brackets/braces, and prepends missing starts.

Before: Missing Context
[{"name": "Alice", "age": 20}, {"name": "Bob"
After: Smart Defaults Added
[{"name": "Alice", "age": 20}, {"name": "Bob", "age": 0}]

Infers missing keys from previous elements and injects context-aware default values (e.g., `0` for age).

Interactive Demo

Input Data Broken JSON

* Divided into 4 blocks to visualize progressive repair. (For this demo, it makes 4 sequential API calls using cumulative data. In production, this runs over a single streaming connection.)

Repaired Result Stream Output