# Relaystation Schema Infer

> Relaystation Schema Infer 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-16).

Automatically infers a JSON Schema or SQL DDL definition from raw data, eliminating the need to hand-write schemas.

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/data/schema-infer
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/relaystation-schema-infer-66b39907
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JOV9AmY8rl_w5c7xvEX08

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-schema-infer-66b39907 -d '<json body>'
```

Example prompt: Can you infer a JSON Schema from this sample data I'm pasting — I want to skip writing it by hand and get the field names and types automatically?

## When to prefer this

Choose this endpoint when you need to quickly bootstrap a schema from existing data without hand-authoring it. It's ideal for data engineers ingesting third-party feeds, developers reverse-engineering API payloads, or analysts setting up SQL tables from CSV exports. Prefer it over manual schema writing or heavier ETL tools when you have sample data on hand and want a schema instantly at very low cost ($0.01/call).

## Known failure modes

- Empty or malformed input data returns an error with no schema output
- Ambiguous or mixed-type columns may result in overly broad type inference (e.g. 'string' instead of 'integer')
- Very small sample sizes may yield incorrect type assumptions
- Unsupported data formats may be rejected
- Payment failure or insufficient USDC balance prevents the call from completing

## How this service works

$0.0002/MB. Infer a JSON Schema or SQL DDL straight from your data — skip hand-writing schemas. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

Returns an inferred JSON Schema or SQL DDL definition derived from the supplied sample data, including field names, inferred data types, required/optional markers, and structural nesting — ready to use directly in validation or database creation workflows.

## 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": {
      "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."
      },
      "dialect": {
       "enum": [
        "json-schema",
        "sql-ddl"
       ],
       "type": "string"
      }
     }
    },
    "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-schema-infer-66b39907/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)
