# Tarnak x402 Toolkit — JSON Repair API

> Tarnak x402 Toolkit — JSON Repair API is a paid API for AI agents from api.capousd-student-tools.me, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

Repairs malformed JSON text by auto-detecting and fixing syntax errors (trailing commas, missing quotes, etc.) and returns the corrected value along with a list of applied fixes.

## Facts

- Endpoint: POST https://api.capousd-student-tools.me/v1/repair?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tarnak-x402-toolkit-json-repair-api-8a287ad8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cww8mFkjvJJTf9T7rdmbs

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 tarnak-x402-toolkit-json-repair-api-8a287ad8 -d '<json body>'
```

Example prompt: Can you repair this broken JSON for me? It has trailing commas and won't parse: {"name": "Alice", "age": 30,}

## When to prefer this

Use this endpoint when you have a JSON string that fails to parse due to common syntax issues like trailing commas, unquoted keys, or minor formatting errors, especially from LLM outputs or user-submitted data. It is keyless and pay-per-call via x402/USDC, making it ideal for AI agents that need lightweight, no-signup JSON cleanup without maintaining API credentials.

## Known failure modes

- JSON is too malformed to recover — returns ok:false with an error message
- Input is not JSON at all (e.g. plain text or binary) — returns error
- Empty input or missing 'json' field — returns validation error
- Payment failure via x402 — 402 response if USDC payment not provided correctly

## How this service works

Keyless pay-per-call APIs for AI agents on Base: token risk verdict, rug/honeypot report, gas estimate, URL-to-markdown and more. x402 v2, USDC, no API key or signup. 10 free verdicts per IP per day.

## Output

Returns a JSON object with: 'ok' boolean indicating success, 'error' string or null, 'value' containing the parsed and repaired JSON value, 'applied' array listing the names of repairs that were applied (e.g. 'removed_trailing_comma'), and 'repaired' boolean indicating whether any fixes were needed.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "error": null,
  "value": {
   "a": 1
  },
  "applied": [
   "removed_trailing_comma"
  ],
  "repaired": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tarnak-x402-toolkit-json-repair-api-8a287ad8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.capousd-student-tools.me](https://www.zero.xyz/host/api.capousd-student-tools.me/llms.txt)
