# Relaystation Data Sort

> Relaystation Data Sort is a paid API for AI agents from api.relaystation.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Sort rows in a dataset by one or more columns, ascending or descending, billed at $0.0002/MB via x402

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/data/sort
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/relaystation-data-sort-88d3a88a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XCGmOPA_L3MEvC0ULGCok

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 relaystation-data-sort-88d3a88a -d '<json body>'
```

Example prompt: Sort these rows by the 'revenue' column in descending order, then by 'region' ascending — it's about 50KB of JSON data.

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-MB sort operation on tabular data without spinning up a full database or compute environment. It is ideal for agent workflows that need to reorder data on the fly before passing it downstream (e.g., to a spreadsheet exporter or ranking step). The per-MB pricing makes it cost-effective for small-to-medium datasets compared to provisioning compute infrastructure.

## Known failure modes

- Invalid column name specified — column not found in dataset returns an error
- Malformed or unparseable input data returns a parsing error
- Payload too large or unsupported data format
- Missing sort direction defaults or errors depending on API behavior
- Insufficient x402 payment balance causes request rejection

## How this service works

$0.0002/MB. Sort rows by one or more columns, ascending or descending. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

Returns the input rows reordered according to the specified sort columns and directions. The response is the same data structure as the input but with rows in the new sort order. Billing is $0.0002/MB with a 1¢ minimum, and any remainder auto-credits to your account.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "file": {
       "type": "object",
       "description": "cputools input-source: { inline: <base64 ≤ 4 MiB> } or { inputKey: <scratch key from /v1/cputools/upload-url, ≤ 50 MB> }."
      },
      "by": {
       "type": "array",
       "minItems": 1,
       "items": {
        "type": "object",
        "required": [
         "column"
        ],
        "properties": {
         "column": {
          "type": "string"
         },
         "dir": {
          "type": "string",
          "enum": [
           "asc",
           "desc"
          ]
         },
         "type": {
          "type": "string",
          "enum": [
           "string",
           "number"
          ],
          "description": "Force the compare type; default value-typed."
         }
        }
       }
      },
      "from": {
       "type": "string",
       "enum": [
        "csv",
        "tsv",
        "json",
        "ndjson"
       ],
       "description": "A tabular file format: csv, tsv, json (array of objects), or ndjson."
      },
      "to": {
       "type": "string",
       "enum": [
        "csv",
        "tsv",
        "json",
        "ndjson"
       ],
       "description": "A tabular file format: csv, tsv, json (array of objects), or ndjson."
      }
     }
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/relaystation-data-sort-88d3a88a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.relaystation.ai](https://www.zero.xyz/host/api.relaystation.ai/llms.txt)
