
# cputools

The CPU work your agent shouldn't host itself. One call, fractions of a cent, no server to babysit.

```bash
curl -X POST https://api.relaystation.ai/v1/pdf/merge \
  -H 'X-Payment: <base64 EIP-3009 auth>' \
  -H 'Idempotency-Key: merge-invoices-20260605' \
  -H 'Content-Type: application/json' \
  -d '{"files":[{"inline":"<base64 pdf>"},{"inline":"<base64 pdf>"}]}'
```

## What it is

cputools is a pay-per-call utility API by Relaystation. The suite is **86 operations across nine categories** — plus a **pipeline runtime** that composes them — behind one endpoint: PDF (19 ops, incl. encrypt/decrypt/compress/render/OCR, **HTML→PDF generation**, **Office→PDF conversion** (docx/xlsx/pptx → PDF), and extract-images/diff/bookmarks/attachments), CSV (convert/dedupe/select), image (13 ops: resize/convert/compress/rotate/metadata/crop/blur/sharpen/grayscale/exif-strip/dominant-color/composite/contact-sheet), codes (qr/barcode generate + qr-decode + color-convert), utils (hash/hmac/base64/uuid/jwt-decode/jwt-verify), generate (og-image/mock-data/invoice/chart/qr-logo/favicon/placeholder/identicon), archive (zip/unzip/gzip), **data** — the ETL transform layer: filter, sort, group-by, join, union, profile, cast, pivot, schema-infer, validate, diff, derive, fillna, dropna, rename, slice, explode, sample, **Excel in/out** (from-xlsx/to-xlsx), and **sql** (full SQL over your file on a sandboxed DuckDB) — and **text** (case/slugify/diff/count/regex-extract/template/markdown-to-html/html-to-text/sanitize-html). Your agent sends a file and an x402 payment, gets back a result, and never created an account. Pay per call with x402 or top up with a card via Stripe — one Relaystation balance funds cputools and every other Relaystation product. No subscription, no minimum.

These are the tools you could self-host — they're built on open-source [pdf-lib](https://pdf-lib.js.org/), [pdf.js](https://mozilla.github.io/pdf.js/), [qpdf](https://qpdf.sourceforge.io/), [poppler](https://poppler.freedesktop.org/), [Tesseract](https://tesseract-ocr.github.io/), [Papaparse](https://www.papaparse.com/), [sharp](https://sharp.pixelplumbing.com/), [jose](https://github.com/panva/jose), [satori](https://github.com/vercel/satori), [faker](https://fakerjs.dev/), [fflate](https://github.com/101arrowz/fflate), [DuckDB](https://duckdb.org/), and [LibreOffice](https://www.libreoffice.org/) (via [Gotenberg](https://gotenberg.dev/)), plus Node's built-in `crypto`. We just run them so you don't have to: no Lambda layer to wrangle, no native binary to compile into your image, no cold-start tax on your own infrastructure. One HTTPS call, a result back, done.

cputools is now a **transform platform**, not just a catalog: the data category and the pipeline runtime compose into ETL chains in a single call. Document rendering is live at both ends — HTML→PDF (Chromium) and Office→PDF (LibreOffice) — and media tenants are the next frontier.

## The lodestone

The whole product is one HTTPS call:

1. Your agent `POST`s to `https://api.relaystation.ai/v1/<category>/<op>` with the tool's payload.
2. The payload carries the file inline (base64, ≤ 4 MB) — or a storage reference (`{"inputKey":"..."}`) for larger files.
3. An `X-Payment` header carries the x402 (EIP-3009) authorization; an `Idempotency-Key` header makes the call safe to retry.
4. cputools runs the transform and returns a JSON envelope: the result inline (base64) when small, or `{ outputKey, outputUrl }` (a presigned GET) when large.

No account, no signup step, no deposit-then-withdraw. The wallet that signs the payment is the identity, so your transaction history is there if you come back. Or use a `Bearer rs_live_*` API key if you'd rather fund from a prepaid balance.

An `outputKey` chains: pass it as the next op's `inputKey` and run multi-step transforms without re-uploading — the full I/O model (inline / scratch / baton) is the canonical [persistence tiers](/docs/persistence-tiers) page.

## The tools, one endpoint

| Category | Ops | Billing | Reference |
|---|---|---|---|
| **PDF** | merge, split, rotate, pages, watermark, form, extract-text, metadata, encrypt, decrypt, compress, render, OCR, from-html, from-office, images, diff, bookmarks, attachments (19) | per page (from-html/from-office + metadata/bookmarks/attachments flat) | [PDF tools →](/docs/pdf-tools) |
| **CSV** | convert, dedupe, select (3) | per MB | [CSV tools →](/docs/csv-tools) |
| **Image** | resize, convert, compress, rotate, metadata, crop, blur, sharpen, grayscale, exif-strip, dominant-color, composite, contact-sheet (13) | per megapixel (metadata/dominant-color flat) | [Image tools →](/docs/image-tools) |
| **Codes** | QR, barcode, qr-decode, color-convert (4) | flat | [QR & barcode →](/docs/qr-tools) |
| **Utils** | hash, hmac, base64, uuid, jwt-decode, jwt-verify (6) | per MB (uuid/jwt flat) | [Utils tools →](/docs/utils-tools) |
| **Generate** | og-image, mock-data, invoice, chart, qr-logo, favicon, placeholder, identicon (8) | flat | [Generate tools →](/docs/generate-tools) |
| **Archive** | zip, unzip, gzip (3) | per MB (input) | [Archive tools →](/docs/archive-tools) |
| **Data** | filter, sort, groupby, join, union, profile, cast, pivot, schema-infer, validate, diff, derive, fillna, dropna, rename, slice, explode, **Excel** from-xlsx/to-xlsx (19); **sql** (sandboxed DuckDB) | per MB (sql tier higher) | [Data tools →](/docs/data-tools) · [SQL →](/docs/data-sql) |
| **Pipeline** | run — compose a chain of transforms in one call | sum of the steps | [Pipeline →](/docs/pipeline) |

Send a file inline (base64, ≤ 4 MB) or by storage reference for larger files (≤ 50 MB); get the result back the same way. A small per-MB egress surcharge applies only to storage-ref outputs (the >4 MB path). The heavy ops (encrypt/decrypt/compress/render/OCR, data **sql**, **HTML→PDF**, and **Office→PDF**) run vendored qpdf, poppler, Tesseract, DuckDB, headless Chromium, and LibreOffice on dedicated engines — same request shape, same per-call billing.

## Pricing

From $0.0002 per call. No subscription, no minimum, no commitment. Pay per call with x402, or top up with a card via Stripe — one Relaystation balance funds cputools and every other Relaystation product. [See full pricing →](/pricing)

## Built on a substrate

The whole suite rides one chassis: payment, idempotency, the inline-vs-storage-ref I/O convention, per-page/per-MB/per-megapixel metering, and the compute-worker pattern were paid for once. Adding a new tool on top is small and bounded — a new operation in an existing category is a few dozen lines of glue; a whole new category is a single in-process module plus its pricing rows. The utils, generate, and archive categories (eleven ops) landed as ~530 and ~440 lines of route code with the shared substrate left byte-identical; the data category added zero dependencies; the `data/sql` engine was DuckDB dropped into the same worker tier as a single vendored binary (no Docker), and the pipeline runtime reused the existing transforms verbatim. That's why the catalog went from 8 PDF ops to 86 across nine categories — plus a composable runtime, HTML→PDF generation, and Office→PDF conversion (LibreOffice via Gotenberg, the first HTTP-upstream engine) — without a rewrite, and why the next tier — media — is an engine-drop away rather than a re-architecture.

## Why pay-per-call wins here

Every PDF-API incumbent except one gates behind a monthly minimum or a credit catalog you have to pre-commit to. cputools is the one an agent can call once, pay a fraction of a cent, and leave — and we undercut even the closest pay-per-call peer by roughly 10×. Compute for in-process PDF ops is nearly free, so the price is a positioning number, not a cost-recovery exercise: dramatically under the incumbents, but still real money, never a subsidized loss-leader. The only real variable cost is egress on large outputs, which is why a small per-MB surcharge rides the storage-ref path and nothing else.

## Next

[PDF tools](/docs/pdf-tools) · [Office tools](/docs/office) · [CSV tools](/docs/csv-tools) · [Image tools](/docs/image-tools) · [QR & barcode](/docs/qr-tools) · [Utils tools](/docs/utils-tools) · [Generate tools](/docs/generate-tools) · [Archive tools](/docs/archive-tools) · [Data tools](/docs/data-tools) · [Data — SQL](/docs/data-sql) · [Pipeline](/docs/pipeline) · [MCP tools](/docs/cputools-mcp-tools) · [Pricing](/pricing) · [API reference](/api-reference) · [x402 wire format](https://relaystation.ai/docs/x402) · [Authentication](https://relaystation.ai/docs/authentication)
