# x402broker Structured Output JSON Repair & Schema Validator

> x402broker Structured Output JSON Repair & Schema Validator is a paid API for AI agents from x402broker.com, paid per call via x402 or MPP, $0.002/call, status unknown (last checked 2026-10-20).

Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) and validates it against a schema so multi-agent pipelines stay crash-free.

## Facts

- Endpoint: GET https://x402broker.com/v1/structured-output?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402, MPP
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402broker-structured-output-json-repair-schema-validator-8bff9b28
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WWf-hmY3_VWCRa1GgzUWt

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 x402broker-structured-output-json-repair-schema-validator-8bff9b28
```

Example prompt: The LLM just returned this garbled JSON with trailing commas and markdown fences — can you repair it and give me back clean, valid JSON I can actually parse?

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline receives structured output that fails JSON.parse() due to common LLM formatting mistakes (trailing commas, markdown fences, single quotes, truncation). Ideal for any orchestration layer that needs deterministic, crash-proof JSON normalization before passing data downstream, especially when you cannot control the upstream LLM's output format.

## Known failure modes

- Input JSON too corrupted to deterministically repair — returns error indicating unparseable input
- Schema mismatch after repair — returns validation failure with field-level details
- Missing required 'input' field in request body — returns 400 bad request
- Network timeout or service unavailability — returns 5xx error

## How this service works

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash. (Live x402 v2, IETF MPP & MCP endpoint at https://x402broker.com/v1/structured-output)

## Output

Returns a syntactically correct, fully parsed JSON object with common LLM-output errors fixed (trailing commas removed, markdown fences stripped, single quotes converted to double quotes, truncations repaired) and optionally validated against a provided schema.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "raw_json"
 ],
 "properties": {
  "raw_json": {
   "type": "string",
   "minLength": 1,
   "description": "Malformed, truncated, or markdown-wrapped JSON string to deterministically repair"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402broker-structured-output-json-repair-schema-validator-8bff9b28/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402broker.com](https://www.zero.xyz/host/x402broker.com/llms.txt)
