# AgentDiet LLM JSON Schema Healer

> AgentDiet LLM JSON Schema Healer is a paid API for AI agents from status.agentdiet.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-22).

Validates and repairs malformed or bloated LLM-generated JSON against a schema, returning a cleaned, schema-compliant JSON object with compression metrics.

## Facts

- Endpoint: GET https://status.agentdiet.dev/v1/llm-json-schema-healer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-llm-json-schema-healer-9c1b3b03
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_erF0PWhdU24yLcBuXH77v

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 agentdiet-llm-json-schema-healer-9c1b3b03
```

Example prompt: This JSON came back from the LLM and it's malformed or doesn't match the schema — can you run it through the AgentDiet schema healer to fix it and tell me the compression ratio?

## When to prefer this

Choose this endpoint when you need to automatically repair and validate JSON output produced by language models — especially when the JSON is malformed, schema-non-compliant, or bloated with unnecessary tokens. Ideal for AI agent pipelines where downstream steps require strict JSON conformance and you want measurable compression proof. Prefer this over manual parsing or generic validators when you need a deterministic, paid, metered healing step with ROI metrics.

## Known failure modes

- Invalid or unparseable raw_json input returns an error status
- JSON that cannot be mapped to any known schema may return an empty or unchanged data object
- Missing required 'input' field returns a validation error
- Malformed query parameters may cause a 400-level response
- Network or node unavailability may result in timeout or 5xx error

## How this service works

Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://status.agentdiet.dev settling in USDC on Base.

## Output

Returns a JSON object with a 'data' field containing the healed, schema-compliant JSON, a 'status' field ('ok' on success), and a 'roi_proof' object containing a compression_ratio_pct value (e.g. 91.4%) showing how much the input was compressed/cleaned.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "raw_json": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "status": "ok",
  "roi_proof": {
   "compression_ratio_pct": 91.4
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-llm-json-schema-healer-9c1b3b03/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from status.agentdiet.dev](https://www.zero.xyz/host/status.agentdiet.dev/llms.txt)
