# AISkills402 JSONL Repair

> AISkills402 JSONL Repair is a paid API for AI agents from api.aiskills402.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-14).

Converts malformed or broken JSON Lines (NDJSON) text into valid, one-record-per-line JSONL output using deterministic repair rules — no LLM involved.

## Facts

- Endpoint: POST https://api.aiskills402.com/v1/run/jsonl-repair?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aiskills402-jsonl-repair-daa0fc95
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NXVfQ84RuFnxXD1ac_tVj

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 aiskills402-jsonl-repair-daa0fc95 -d '<json body>'
```

Example prompt: This JSONL output from the pipeline is broken — records got glued together and some have Python-style True/None values. Can you repair it into valid one-record-per-line JSONL? Here's the text: '{"id":1,"ok":True}{"id":2,"ok":None,"price":1.10}'

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSONL repair without involving a language model — it is faster, cheaper, and fully reproducible. Ideal for data pipeline automation where LLM-based repair would introduce non-determinism or cost too much at scale. Best when the malformation is structural (fencing, wrapping, gluing, Python literals, quote issues) rather than semantic content corruption.

## Known failure modes

- CANNOT REPAIR verdict returned for cut-off records that are syntactically unresolvable
- CANNOT REPAIR for repeated/duplicate keys where intent is ambiguous
- CANNOT REPAIR for numbers with ambiguous leading zeros
- Input exceeds 60,000 character limit — request rejected
- Payment failure via x402 protocol — endpoint returns 402 before processing
- Malformed POST body (missing 'input' field) — validation error

## How this service works

JSONL Repair API: turns broken JSON Lines (NDJSON) into one valid record per line - joins, splits, unwraps, drops fences and chat text, fixes quotes, keys, commas, Python literals; numbers copied as written. $0.003 USDC per call, no account, no language model: a cut-off record, repeated key or ambiguous leading zero gets a paid CANNOT REPAIR verdict. POST JSON {input} up to 60 000 chars; free example at https://api.aiskills402.com/v1/run/jsonl-repair/example

## Output

Returns a JSON object with 'ok' true/false, a 'result' object containing the repaired JSONL string (one valid JSON object per line) and the count of records produced, plus a blockchain settlement receipt and the SHA-256 of the input. If the input is too ambiguous or malformed to repair (e.g. cut-off record, repeated keys, ambiguous leading zero), the 'refusal' field explains why and 'ok' is false.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "maxLength": 60000,
   "minLength": 1,
   "description": "Text that was meant to be JSON Lines (NDJSON) and is not: glued, pretty-printed, fenced, array-wrapped or sloppy records."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "skill": "jsonl-repair",
  "engine": "1.0.0",
  "replay": false,
  "result": {
   "jsonl": "{\"id\":1,\"ok\":true}\n{\"id\":2,\"ok\":null,\"price\":1.10}",
   "records": 2
  },
  "receipt": {
   "tx": "0x<settlement transaction>",
   "settled": true
  },
  "refusal": null,
  "input_sha256": "<sha256 of the request>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aiskills402-jsonl-repair-daa0fc95/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.aiskills402.com](https://www.zero.xyz/host/api.aiskills402.com/llms.txt)
