# RelayStation Data Sampler

> RelayStation Data Sampler 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).

Sample rows from a dataset by count or fraction, using random, head, or systematic strategies with a reproducible seed

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/data/sample
- 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-sampler-0f62cf73
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JI1lvrU_Vs18ItUJ3lDMS

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-sampler-0f62cf73 -d '<json body>'
```

Example prompt: Take a random sample of 200 rows from my dataset using a seed of 42 so I can reproduce the results later.

## When to prefer this

Choose this endpoint when you need to quickly reduce a large dataset to a representative or reproducible subset, especially when you need control over sampling strategy (random vs. head vs. systematic) and reproducibility via a seed. Priced per MB at $0.0002 with a 1¢ minimum, it is cost-effective for large datasets. Prefer this over a general-purpose code execution endpoint when you want a managed, low-latency sampling service without setting up infrastructure.

## Known failure modes

- Invalid or missing dataset input returns an error
- Requested sample size larger than dataset returns partial or error
- Unsupported sampling strategy name returns validation error
- Non-numeric or out-of-range fraction (e.g. >1.0) returns error
- Insufficient payment (below 1¢ minimum) blocks the request
- Malformed row data or encoding issues may cause parsing errors

## How this service works

$0.0002/MB. Sample rows — n or fraction; random, head, or systematic; reproducible seed. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

Returns the sampled rows from the input dataset, selected according to the specified strategy (random, head, or systematic), count or fraction, and optional seed for reproducibility. The response includes only the selected subset of rows.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "properties": {
      "n": {
       "type": "integer",
       "minimum": 0,
       "description": "Absolute sample size."
      },
      "to": {
       "enum": [
        "csv",
        "tsv",
        "json",
        "ndjson"
       ],
       "type": "string",
       "description": "A tabular file format: csv, tsv, json (array of objects), or ndjson."
      },
      "file": {
       "type": "object",
       "description": "cputools input-source: { inline: <base64 ≤ 4 MiB> } or { inputKey: <scratch key from /v1/cputools/upload-url, ≤ 50 MB> }."
      },
      "from": {
       "enum": [
        "csv",
        "tsv",
        "json",
        "ndjson"
       ],
       "type": "string",
       "description": "A tabular file format: csv, tsv, json (array of objects), or ndjson."
      },
      "seed": {
       "type": "integer",
       "description": "Reproducible random — same seed + input → identical sample."
      },
      "method": {
       "enum": [
        "random",
        "head",
        "systematic"
       ],
       "type": "string"
      },
      "fraction": {
       "type": "number",
       "maximum": 1,
       "minimum": 0,
       "description": "Fractional sample size."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/relaystation-data-sampler-0f62cf73/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)
