# AISkills402 CSV Repair

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

Fixes malformed CSV text — open quotes, stray quotes, short rows, Markdown tables, or fenced data — and returns a clean, parseable CSV string with row/column counts.

## Facts

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

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-csv-repair-1a1d8065 -d '<json body>'
```

Example prompt: This CSV won't parse because of open quotes and mismatched rows — can you fix it and give me a clean, valid CSV with LF line endings? Here's the raw text: 'id,amount,note
7,"1,250,ok
8,40,"Bolt 5" long
9,12,'

## When to prefer this

Choose this endpoint when you have text that was intended to be CSV but fails to parse due to quote errors, row-length mismatches, Markdown formatting, or fence blocks, and you need a clean, immediately usable CSV string back. It is purpose-built for CSV repair specifically — prefer it over general-purpose LLM calls when you need deterministic, schema-validated CSV output with row/column metadata and an on-chain payment receipt. If your data is YAML rather than CSV, use the sibling YAML Repair endpoint instead.

## Known failure modes

- Input text is too short (minLength:1 violation) or exceeds 60,000 characters — returns validation error
- Input is not recognizably tabular data at all and cannot be repaired — may return a refusal in the 'refusal' field
- Network or payment settlement failure — receipt may show settled:false
- Ambiguous delimiter that cannot be confidently detected — repaired CSV may use wrong separator
- Malformed JSON request body — returns HTTP 400

## How this service works

CSV Repair API: turns CSV a parser rejects into valid CSV without changing any cell - fixes quotes, pads short rows, unwraps Markdown tables, chat text and fences; 1,250 and 007 stay as written. $0.004 USDC per call, no account, no language model: a too-long row, an ambiguous row or prose with no table gets a paid CANNOT REPAIR verdict. POST JSON {input} up to 60 000 chars; free example at https://api.aiskills402.com/v1/run/csv-repair/example

## Output

A JSON object containing: a 'csv' field with the fully repaired, parseable CSV string; 'rows' and 'columns' integer counts; the detected 'delimiter'; a 'replay' boolean; an 'input_sha256' hash of the request; and a 'receipt' object with the on-chain settlement transaction hash confirming the x402 USDC payment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "maxLength": 60000,
   "minLength": 1,
   "description": "Text that was meant to be a CSV table and does not parse: open quotes, stray quotes, short rows, a Markdown table, chat text or a fence around the data."
  },
  "line_endings": {
   "enum": [
    "lf",
    "crlf"
   ],
   "default": "lf",
   "description": "Line break between rows in the output; breaks inside cells are kept as written."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "skill": "csv-repair",
  "engine": "1.0.0",
  "replay": false,
  "result": {
   "csv": "id,amount,note\n7,\"1,250\",ok\n8,40,\"Bolt 5\"\" long\"\n9,12,",
   "rows": 4,
   "columns": 3,
   "delimiter": ","
  },
  "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-csv-repair-1a1d8065/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)
