# JSON Repair API

> JSON Repair API is a paid API for AI agents from agent-utility-network.frosty-sound-4560.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Takes malformed or broken JSON text as input and returns a repaired, valid JSON object.

## Facts

- Endpoint: POST https://agent-utility-network.frosty-sound-4560.workers.dev/v1/paid/json-repair
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-repair-api-fd583a57
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fV6fCS7DzQkPtMwjwxVhn

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 json-repair-api-fd583a57 -d '<json body>'
```

Example prompt: This JSON string I got back is broken and won't parse — can you repair it and give me back valid JSON? Here it is: {hello: 'world', missing_bracket: true

## When to prefer this

Use this endpoint when you have a specific malformed JSON string that needs to be repaired programmatically — especially useful in agentic pipelines where LLMs or external APIs return syntactically invalid JSON that needs to be sanitized before further processing. Prefer this over manual string manipulation when the malformation type is unknown or complex.

## Known failure modes

- Input is so severely malformed that no valid JSON can be inferred — may return an error or best-effort partial repair
- Non-JSON input (e.g. plain text, XML, CSV) may not be repairable
- Empty input string returns an error
- Ambiguous malformation where multiple valid repairs exist may produce unexpected results

## How this service works

Quality-scored paid utility APIs for AI agents over x402 on Base USDC.

## Output

Returns a JSON object with a `result.repaired` field containing the corrected, fully valid JSON structure parsed from the malformed input text.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "description": "Malformed JSON text to repair."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "repaired": {
    "hello": "world"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-repair-api-fd583a57/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-utility-network.frosty-sound-4560.workers.dev](https://www.zero.xyz/host/agent-utility-network.frosty-sound-4560.workers.dev/llms.txt)
