cputools logo cputools

Office tools

Two office surfaces, one engine (LibreOffice via Gotenberg), output always PDF:

  • POST /v1/office/rescue — best-effort convert an exotic or legacy office format to PDF. The formats LibreOffice can import but you won’t reach through the everyday from-office route: Apple iWork, Visio, Publisher, CorelDRAW, WordPerfect, the legacy MS binaries, and flat ODF.
  • GET /v1/office/formats — the free, no-auth roster of what each office route accepts.

The everyday office formats (docx, xlsx, pptx, odt, ods, odp, rtf, txt, csv) go through POST /v1/pdf/from-office. office/rescue is the premium, honest best-effort surface for the long-tail formats around it.

Fidelity is best-effort. These are exotic, sometimes proprietary, sometimes very old formats. LibreOffice does its best to import them, and you get a clean PDF — but complex layout, fonts, or vector detail may not survive perfectly. The output is always a faithful-as-possible PDF, never a guarantee of pixel parity. And office↔office conversion (e.g. docx↔odt) is not offered — every office route outputs PDF.

Rescue a legacy or exotic document

curl -X POST https://api.relaystation.ai/v1/office/rescue \
  -H 'Authorization: Bearer rs_live_<key>' \
  -H 'Idempotency-Key: rescue-visio-20260612' \
  -H 'Content-Type: application/json' \
  -d '{ "file": { "inline": "<base64 vsdx>" }, "filename": "network-diagram.vsdx" }'

Or on the lodestone path — no account, a signed x402 payment instead of an API key:

curl -X POST https://api.relaystation.ai/v1/office/rescue \
  -H 'X-Payment: <base64 EIP-3009 authorization>' \
  -H 'Idempotency-Key: rescue-visio-20260612' \
  -H 'Content-Type: application/json' \
  -d '{ "file": { "inline": "<base64 vsdx>" }, "filename": "network-diagram.vsdx" }'

The filename is required — its extension is how the format is recognized. Takes the standard input source ({ "inline": "<b64>" } ≤ 4 MB, or { "inputKey": "..." } from POST /v1/cputools/upload-url for larger files) and returns the standard output envelope — a PDF inline when small, a presigned URL when large.

The rescue roster

The default exotic/legacy roster (operator-tunable, so it can flex without a redeploy):

FamilyExtensions
Apple iWorkpages, numbers, key
Visiovsd, vsdx
MS Publisherpub
CorelDRAWcdr
Flat ODFfodt
Legacy MS Office binariesdoc, xls, ppt
WordPerfectwpd

GET /v1/office/formats is always authoritative. Free, read-only, no auth:

curl https://api.relaystation.ai/v1/office/formats

It returns the rescue roster and the everyday from-office roster, each with its output (pdf), plus an honest note that office↔office conversion is not offered:

{
  "rescue": { "inputs": ["pages", "numbers", "key", "vsd", "vsdx", "pub", "cdr", "fodt", "doc", "xls", "ppt", "wpd"], "output": "pdf" },
  "fromOffice": { "inputs": ["docx", "xlsx", "pptx", "odt", "ods", "odp", "rtf", "txt", "csv"], "output": "pdf" },
  "note": "office↔office conversion (e.g. docx↔odt) is not offered; all office routes output PDF."
}

An extension outside the roster returns a free 422 UNSUPPORTED_FORMAT that points you at GET /v1/office/formats.

Export controls (from-office and rescue)

Both POST /v1/pdf/from-office and POST /v1/office/rescue accept an optional options object passed straight to LibreOffice’s PDF export — absent fields take the engine default:

FieldTypeNotes
pageRangesstringa page subset, e.g. "1-5,8"
qualityinteger 1–100JPEG quality for embedded images
losslessImageCompressionbooleanuse lossless image compression
reduceImageResolutionbooleangate for maxImageResolution — must be true for it to apply
maxImageResolutionone of 75, 150, 300, 600, 1200DPI ceiling for embedded images (a closed ladder; other values are rejected)
landscapebooleanforce landscape orientation
curl -X POST https://api.relaystation.ai/v1/pdf/from-office \
  -H 'Authorization: Bearer rs_live_<key>' \
  -H 'Idempotency-Key: print-ready-20260612' \
  -H 'Content-Type: application/json' \
  -d '{ "file": { "inputKey": "<key>" }, "filename": "q3-report.docx",
        "options": { "pageRanges": "1-10", "reduceImageResolution": true, "maxImageResolution": 150, "landscape": true } }'

Billing

RouteUnitPrice
office/rescueper call$0.008 flat
from-officeper call$0.005 flat
office/formatsfree

Rescue is priced a step above the everyday from-office route — it’s heavier, best-effort work. Both are flat per convert (the output page count isn’t known before the conversion runs). Charge-on-attempt — a convert that reaches the engine and succeeds stands; one that can’t be delivered (a corrupt file, an upstream failure) returns 422 CONVERT_FAILED and the charge is reversed: you pay only for a delivered PDF. Every billable call requires an Idempotency-Key; a same-key retry returns the cached result without re-charging.

MCP tools

Callable over MCP at https://api.relaystation.ai/mcp: office_rescue (billable) and office_formats (free, read-only), plus pdf_from_office (the everyday route). Same auth, same prices as the HTTP routes.

Next

Quickstart · Receiving outputs · Persistence tiers · PDF tools · Document conversion · API reference