# x402 AI JSON Repair API

> x402 AI JSON Repair API is a paid API for AI agents from x402-ai-peach.vercel.app, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Repairs and fixes malformed JSON strings using an LLM chat interface, paid via x402 micropayments at $0.05 USDC per call

## Facts

- Endpoint: POST https://x402-ai-peach.vercel.app/api/json-repair
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-ai-json-repair-api-15f5f9a9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_V43nOtbs-Nfdw4i-5Xwn0

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 x402-ai-json-repair-api-15f5f9a9 -d '<json body>'
```

Example prompt: Fix this broken JSON for me — it has missing quotes and a trailing comma and won't parse: {name: 'Alice', age: 30,}

## When to prefer this

Choose this endpoint when you need a pay-per-use, no-subscription JSON repair service with micropayment billing via x402/USDC, especially useful for AI agents that autonomously process data pipelines and need to fix malformed JSON on the fly without committing to a monthly plan

## Known failure modes

- Invalid or missing messages array returns an error
- Severely corrupted JSON beyond LLM repair may return best-effort but still-invalid output
- Insufficient USDC balance causes payment failure via x402 protocol
- Token limit too low may truncate the repaired JSON response
- Network timeout on the Vercel deployment may cause 504 errors

## How this service works

Paid AI API endpoints via x402 micropayments

## Output

A JSON object containing a response ID and a choices array, where the first choice includes a message with the repaired, valid JSON string as its content

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "messages"
 ],
 "properties": {
  "stream": {
   "type": "boolean",
   "description": "Stream response"
  },
  "messages": {
   "type": "array",
   "description": "Chat messages array"
  },
  "max_tokens": {
   "type": "integer",
   "description": "Max tokens"
  },
  "temperature": {
   "type": "number",
   "description": "Temperature"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "Response ID"
  },
  "choices": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "message": {
      "type": "object",
      "properties": {
       "role": {
        "type": "string"
       },
       "content": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-ai-json-repair-api-15f5f9a9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-ai-peach.vercel.app](https://www.zero.xyz/host/x402-ai-peach.vercel.app/llms.txt)
