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. Every official client covers the full public API: PDFs, images, templates, convert, PDF tools, barcodes, zip, jobs, files, account, and health.

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 Central: com.relaypdf:relaypdf
CLI + MCP@relaypdf/clinpx @relaypdf/cli setup
n8nn8n-nodes-relaypdfCommunity Nodes → n8n-nodes-relaypdf

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.05 AI generate = 50 millicents. 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.downloadGET /v1/files/:id
accountGET /v1/account
healthGET /health
verifyWebhook / verify_webhookRelayPDF-Signature