# Relaystation OCR Layout

> Relaystation OCR Layout 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).

OCR a document and return full line- and word-level layout coordinates (via AWS Textract) for position-aware text extraction and downstream parsing.

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/doc/ocr-layout
- 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-ocr-layout-da043067
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ICQR1ZBjuZD3ZVcIuKydd

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-ocr-layout-da043067 -d '<json body>'
```

Example prompt: Can you OCR this scanned invoice PDF and give me the text with word-level and line-level position coordinates so I can parse the layout programmatically?

## When to prefer this

Choose this endpoint when you need not just the raw text from a scanned document but also precise word- and line-level spatial coordinates (bounding boxes) — for example, when building a parser that needs to locate fields by position, reconstruct table structures, or map extracted values to their visual location on the page. Prefer this over a plain OCR endpoint any time layout matters for downstream processing.

## Known failure modes

- File too large (>50 MB for inputKey, >4 MiB for inline base64) returns an error
- Unsupported file format or corrupted document may cause OCR failure
- Missing required 'file' body field returns a validation error
- Network or Textract service errors may return a 5xx response
- Insufficient prepaid credit balance may block the call

## How this service works

$0.010/document. OCR a document with line- and word-level layout coordinates (Textract) — position-aware text for downstream parsing. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

A structured response containing all recognized text from the document, organized with line-level and word-level bounding box coordinates (position data) as produced by AWS Textract, enabling downstream layout-aware parsing and field extraction.

## 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> }."
      }
     }
    }
   },
   "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-ocr-layout-da043067/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)
