# Relaystation JSON Repair

> Relaystation JSON Repair 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).

Fixes malformed JSON (truncated, mis-quoted, trailing commas, etc.) into valid, parseable output using LLM-based repair at low cost

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/llm/json_repair
- 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-json-repair-c0cfd78a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_beXk-O8QHgq3cMjDnE2k7

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-json-repair-c0cfd78a -d '<json body>'
```

Example prompt: This JSON came back malformed from an API call — it has trailing commas and a truncated closing bracket. Can you repair it into valid, parseable JSON? Here it is: {"name": "Alice", "scores": [10, 20, 30,}

## When to prefer this

Choose this endpoint when you need fast, cheap, LLM-quality JSON repair without building your own parsing heuristics. Ideal when downstream pipelines require strictly valid JSON but input comes from unreliable sources like scraped data, LLM completions, or hand-edited configs. At ~1-5% of the cost of frontier models with comparable accuracy, it is preferable over calling GPT-4 or Claude Opus directly for this task.

## Known failure modes

- Input is so corrupted that the intended structure cannot be inferred, resulting in a best-guess repair that may not match original intent
- Non-JSON input (e.g. plain text, XML) may produce unexpected output
- Very large malformed payloads may time out or be truncated
- Payment failure (insufficient USDC balance) returns 402 error before processing begins

## How this service works

Provider cost + 6%, itemized. Fix malformed JSON — truncated, mis-quoted, trailing commas — into valid parseable output. ≈Opus-4.8 accuracy at ~1–5% of its cost. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

Returns a valid, parseable JSON string with all syntax errors corrected — truncations completed, mis-quoted strings fixed, trailing commas removed, and missing brackets/braces added where needed.

## 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": {
      "tier": {
       "enum": [
        "budget",
        "value",
        "best"
       ],
       "type": "string"
      },
      "input": {
       "type": "string",
       "minLength": 1,
       "description": "The text to process (DATA — never interpolated into the instruction)."
      },
      "params": {
       "type": "object",
       "description": "Task-specific params (e.g. targetLanguage), validated against the task's param_schema."
      }
     }
    },
    "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",
     "required": [
      "result",
      "truncated",
      "usage"
     ],
     "properties": {
      "usage": {
       "type": "object",
       "required": [
        "model",
        "inputTokens",
        "outputTokens",
        "providerCostMicros",
        "markupPct",
        "chargedMicros",
        "ceilingMicros"
       ],
       "properties": {
        "model": {
         "type": "string"
        },
        "markupPct": {
         "type": "number"
        },
        "inputTokens": {
         "type": "integer"
        },
        "outputTokens": {
         "type": "integer"
        },
        "ceilingMicros": {
         "type": "integer",
         "description": "The authorized ceiling the 402/hold reserved."
        },
        "chargedMicros": {
         "type": "integer",
         "description": "The actual charged amount (<= ceiling)."
        },
        "providerCostMicros": {
         "type": "integer"
        }
       }
      },
      "result": {
       "type": "string",
       "description": "The task output text (or JSON string for extract/json_repair)."
      },
      "truncated": {
       "type": "boolean",
       "description": "True when the output hit the per-task token ca
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/relaystation-json-repair-c0cfd78a/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)
