# 24K Labs JSON Repair

> 24K Labs JSON Repair is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-13).

Repairs malformed or truncated JSON (trailing commas, unquoted keys, cut-off LLM output) into valid, parseable JSON.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/json-repair
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-json-repair-0252264d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pbyuKtpbW-cilgeLNFFAg

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 24k-labs-json-repair-0252264d -d '<json body>'
```

Example prompt: This JSON string from our LLM pipeline is broken — it has trailing commas and an unquoted key — can you repair it into valid, parseable JSON? Here it is: {name: "Alice", scores: [10, 20,]}

## When to prefer this

Choose this endpoint when you have JSON that is almost valid but contains common syntax issues like trailing commas, unquoted keys, or LLM-generated truncation, and you need a fast, cheap ($0.008/call) automated fix without writing custom parser logic. Prefer it over manual string manipulation or regex patching when the JSON structure is complex or the errors are varied.

## Known failure modes

- Input is too severely malformed or ambiguous to repair deterministically
- Input is not JSON-like at all (e.g. plain text or XML) — may return an error or unexpected output
- Truncation is too deep to infer the intended structure
- API returns 4xx for missing or malformed request body
- Network timeout or service unavailability (5xx)

## How this service works

Fix malformed or truncated JSON (trailing commas, unquoted keys, cut-off LLM output) into valid, parseable JSON.

## Output

A valid, parseable JSON string that has been repaired from the malformed input, with syntax errors such as trailing commas, unquoted keys, and truncated structures corrected.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "json": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "repaired": {
   "name": "Bob"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-json-repair-0252264d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
