Docs

Official SDKs

Use an official SDK when you want typed helpers, file encoding, job polling, and webhook verification without assembling HTTP yourself. REST remains the source of truth for field names. Agents should load RELAYPDF_API_KEY from the env file written by relaypdf setup — do not ask a human to paste a key.

Use an official SDK when you want typed helpers, file encoding, job polling, and webhook verification without assembling HTTP yourself. Core helpers cover: PDFs, images, templates, convert, PDF tools, barcodes, zip, jobs, files, account, and health.

FIVE LANGUAGES / ONE DOCUMENT API

Published packages for generation, native document processing, file handling, and billing controls. Choose your language to get started.

Java

v0.1.3

com.relaypdf:relaypdf

<dependency>
  <groupId>com.relaypdf</groupId>
  <artifactId>relaypdf</artifactId>
  <version>0.1.3</version>
</dependency>

Packages

Node is TypeScript-first with zero runtime dependencies. Python is a small stdlib client. PHP uses ext-curl. C# targets net8.0. Java 17 uses HttpClient and Jackson. Package READMEs are the full client reference.

Default base URL is https://api.relaypdf.com. Pass baseUrl / base_url for local (http://localhost:8787).

Request JSON field names match REST exactly (html, printBackground, sourceFilename, callbackUrl). Method names are camelCase in Node, PHP, and Java; snake_case in Python; PascalCase in C#.

LanguagePackageInstall
Node.js / TypeScript@relaypdf/sdknpm install @relaypdf/sdk
Pythonrelaypdfpip install relaypdf
PHPrelaypdf/relaypdfcomposer require relaypdf/relaypdf
C# / .NETRelayPDFdotnet add package RelayPDF
Javacom.relaypdf:relaypdfMaven com.relaypdf:relaypdf
CLI + MCP@relaypdf/clinpx @relaypdf/cli setup
n8nn8n-nodes-relaypdfCommunity Nodes → n8n-nodes-relaypdf

Document platform package versions

These published releases include native document processing, file upload/delete, billing usage and limits, and per-request retry/spending-cap options. Use the language guide for exact method names. Older installed packages may lack these helpers.

CLI + MCP: @relaypdf/cli 0.1.9. n8n: n8n-nodes-relaypdf 0.1.5; n8n Cloud verification remains separate from npm publication.

LanguagePackageReleaseRegistry
Node.js / TypeScript@relaypdf/sdk0.1.7npm
Pythonrelaypdf0.1.6PyPI
PHPrelaypdf/relaypdf0.1.2Packagist
C# / .NETRelayPDF0.1.2NuGet
Javacom.relaypdf:relaypdf0.1.3Maven Central

Authentication

HTTP Bearer. Create a key in Dashboard → API keys or run npx @relaypdf/cli setup and approve in the browser. The SDK sends Authorization: Bearer <key>. Missing apiKey / api_key throws TypeError before any request. Not JWT.

Rate limiting

Trial wallets 20/min, funded or auto-reload 60/min, burst 5/10s. HTTP 429 includes Retry-After. Rate-limited calls are not billed.

Wallet millicents

1 millicent = $0.001. GET /v1/account wallet.balanceMillicents ÷ 1000 = dollars. $5.00 trial = 5000 millicents. $0.002 + 8× provider token cost plus rendering AI generate; see the accepted quote for exact microdollars. Failed jobs are never billed.

Get a key without pasting it

Do not ask a human to paste an API key into chat. Run the CLI device flow and approve in the browser.

CLI
npx @relaypdf/cli setup
# writes RELAYPDF_API_KEY to your env file with mode 0600

Response modes

Every generating method accepts response: "binary" | "url" | "async", same as REST.

  • • binary (default) — file bytes, plus save() / Save() helpers
  • • url — JSON with a public 24-hour download
  • • async — 202 job; poll jobs.wait / jobs.get or set callbackUrl

Surface map

Each helper is one HTTP call. The SDK does not retry failed requests.

SDKREST
pdf.fromHtml / fromUrl / fromMarkdown / fromTemplate / createPOST /v1/pdf
templates.list / create / get / update / publishGET/POST/PATCH /v1/templates
images.fromHtml / fromUrlPOST /v1/images
pdf.merge / extract / protect / bookmarks / raster / fromImages / stamp / rotate / deletePages / compress / info / text / unlock / formFields / formFillPOST /v1/pdf/*
barcodes.create / qrPOST /v1/barcodes
zip.createPOST /v1/zip
convert.create / fromHtml / fromPath / wkhtmlPOST /v1/convert
jobs.get / jobs.waitGET /v1/jobs/:id
files.upload / delete / downloadPOST /v1/files; DELETE/GET /v1/files/:id
process / ProcessAsyncNative document processing endpoints
billingUsage / billing_usage / BillingUsageAsyncGET /v1/billing/usage
billingLimits / billing_limits / BillingLimitsAsyncGET/PATCH /v1/billing/limits
accountGET /v1/account
healthGET /health
verifyWebhook / verify_webhookRelayPDF-Signature

Document platform release support

The release adds ocr, pdfa, crop, resize, repair, optimize, attachments, extract-images, redact, compress, image-convert, and email processing. Every official SDK exposes process / ProcessAsync plus files.upload, files.delete, billingUsage / billing_usage, and billingLimits / billing_limits. Availability requires the matching released package. Older published versions may not contain these methods.

See /docs/files, /docs/billing, and each operation guide for field names and limits.

For safe retries, use URL or async output with Idempotency-Key. Per-request caps use X-RelayPDF-Max-Charge-Microdollars (integer millionths of USD). Billing APIs preserve microdollar precision; legacy account millicent fields are not the complete precise balance.