# CSV Sort Rows

> CSV Sort Rows is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Sorts CSV rows by a specified column, ascending or descending, and returns the reordered CSV with transformation metadata.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/csv-sort-rows
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/csv-sort-rows-176c0763
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_asl91o4b5mCe58E6o4L9B

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 csv-sort-rows-176c0763 -d '<json body>'
```

Example prompt: Sort this CSV by the 'revenue' column in descending order and give me the reordered rows back.

## When to prefer this

Choose this endpoint when you need a lightweight, stateless, pay-per-call CSV row sorter with a versioned result contract and no external dependencies — especially before handing structured tabular data to a downstream tool that requires a specific row order. Prefer it over general-purpose code execution when you want deterministic, auditable transformations without spinning up a runtime.

## Known failure modes

- Column name not found in CSV header — returns validation error with available column names
- CSV is malformed or exceeds 8192-character limit — returns error with count and position details
- Descending flag is not a boolean — returns schema validation error
- Empty CSV input — returns error indicating no rows to sort

## How this service works

CSV Sort Rows: CSV Sort Rows sorts bounded CSV rows by one column from bounded caller-supplied values without an external provider. Call CSV Sort Rows before an agent hands structured data or a batch plan to a downstream tool with a stricter contract. Returns the bounded transformation or validation finding with counts, normalized values, and a versioned result contract for CSV Sort Rows as versioned deterministic JSON. Price: $0.001 USDC via x402 on Base. First-party, stateless, memory-only ex…

## Output

Returns a versioned deterministic JSON object containing the sorted CSV text, row count, normalized column values, and a result contract version — all computed statelessly in memory with no data retained.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "maxLength": 8192,
   "description": "Text supplied to CSV Sort Rows; used only for this bounded calculation and processed in memory without retention."
  },
  "column": {
   "type": "string",
   "maxLength": 8192,
   "description": "Column supplied to CSV Sort Rows; used only for this bounded calculation and processed in memory without retention."
  },
  "descending": {
   "type": "boolean",
   "description": "Descending supplied to CSV Sort Rows; used only for this bounded calculation and processed in memory without retention."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "csv": "id,name\n1,Ada\n2,Lin",
   "row_count": 2
  },
  "schema": "delx/util-csv-sort-rows/v1",
  "status": "pass",
  "evidence": {
   "retained": false,
   "input_sha256": "cb69489ce0dceef87b94db612016a08b6e5cea76db3556e85ba7b78b5827e73e",
   "external_calls": 0
  },
  "operation": "data_batch:csv_sort_rows"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/csv-sort-rows-176c0763/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
