# Relaystation SQL-Large

> Relaystation SQL-Large 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).

Run SELECT SQL queries over large uploaded datasets (CSV/JSON), paying only per byte scanned at $0.01 per 100 MB

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/data/sql-large
- 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-sql-large-cdd0147b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Rpc_PtwUnjrVy2qyLygxZ

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-sql-large-cdd0147b -d '<json body>'
```

Example prompt: Run this SQL on my uploaded sales CSV: SELECT region, SUM(revenue) AS total FROM input WHERE year = 2023 GROUP BY region ORDER BY total DESC — the file is a CSV I just uploaded and I want the grouped totals back.

## When to prefer this

Choose this endpoint when you need to run ad-hoc SQL analytics on large flat files (CSV or JSON up to 50 MB) without provisioning a database, and you want pay-per-scan pricing at $0.01 per 100 MB. Prefer it over in-memory solutions when file size exceeds local memory, and over full warehouse setups when you need one-shot queries without infrastructure overhead.

## Known failure modes

- Non-SELECT SQL (INSERT, UPDATE, DROP) rejected — only SELECT is allowed
- File exceeds 50 MB inline limit — must use scratch upload key from /v1/cputools/upload-url
- Base64 payload exceeds 4 MiB inline limit
- Malformed SQL syntax returns a parse error
- Unsupported file format (only csv and json accepted)
- Referencing a table name other than `input` causes a query error
- Insufficient balance to cover bytes scanned

## How this service works

$0.01 per 100 MB scanned. Run SQL over huge stored datasets — pay only for bytes scanned, ≈100 MB per penny. Warehouse-scale queries without the warehouse. 155 tools, one balance — relaystation.ai

## Output

Returns the rows produced by the SQL SELECT query — structured data matching the projection and filters specified, formatted as JSON records. The response reflects only the columns and rows selected from the uploaded file (named `input` in the SQL).

## 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> }."
      },
      "sql": {
       "type": "string",
       "minLength": 1,
       "maxLength": 20000,
       "description": "SELECT-only; your file is the table named `input`."
      },
      "format": {
       "type": "string",
       "enum": [
        "csv",
        "json"
       ]
      }
     }
    }
   },
   "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-sql-large-cdd0147b/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)
