Skip to main content
The Convertly SDK wraps multipart uploads, media tool source URLs, async job polling, and file transfers.
CDN vs API: This SDK is for the media REST API (convert, compress, trim, jobs, etc.). For on-the-fly image delivery (resize, WebP/AVIF, smart crop, Next.js loader), use @convertly-sh/image and configure an origin source or Convertly Storage file id first.

Create a client

For staging or a custom API origin, pass a baseUrl:
You can also provide a custom fetch implementation for testing or middleware:

Convert a file

Accepted file inputs for conversion and compression: Blob, ArrayBuffer, Uint8Array, or Buffer. The synchronous media.convert and media.compress helpers send multipart file bytes to /api/convert and /api/compress. Remote HTTP(S) sourceUrl inputs are supported by media tools, signed transforms, and transfer jobs. Keep API keys on your server, worker, or trusted automation. For browser apps, call your own backend first and let that backend call Convertly. Create either a full-access key or a restricted key in Settings → API. Restricted keys use explicit capabilities: files:read, files:write, media:run, workflows:run, webhooks:manage, cdn:manage, and streaming:manage. Existing keys remain full-access until you replace them with restricted credentials.

Conversion options

API-key conversion requests do not save files by default. Set saveToStorage: true only when your app needs Convertly to keep a durable stored-file record. For raster-to-SVG conversion, color is preserved by default. Set mono: true only for monochrome tracing:

Compress a file

Compression options

Compression follows the same storage rule as conversion: results are returned immediately unless you opt in with saveToStorage: true.

Media tools

All media tools accept the same file input pattern (file, sourceUrl, or string URL) and support async: true for long-running operations.

Background removal

Thumbnails and poster frames

Watermark

The same method accepts PDF input and watermarks every page without flattening the underlying document. Watermark requests count as one Media API operation and do not consume Forma AI units.

PDF tools

Metadata and inspection

Signed transforms

Generate a time-limited signed URL for on-the-fly image transforms without uploading:

Full tool list

  • thumbnail
  • pdfPreview
  • imageToPdf
  • stripMetadata
  • posterFrame
  • extractAudio
  • watermark
  • inspect
  • trim
  • gif
  • storyboard
  • videoFrames
  • transform
  • removeBackground
  • signedTransform
  • transfer

Transfer and download files

Download a remote file through Convertly, optionally extracting archives:
Single-file transfers to destination: "convertly-storage" are queued by default and return a jobId. Poll with convertly.jobs.get(jobId) or wait with convertly.jobs.wait(jobId) to read the stored-file result.

Async jobs

Long-running operations (video conversion, bulk processing, etc.) return a job you can poll.

Queue a video trim

Job management

Convertly Storage

List, upload, update, and delete files and folders in Convertly Storage. API keys with storage disabled return 403; use a workspace API key or a WordPress site token with isolated storage when needed.

List files and folders

Pass folderId: null or parentId: null for workspace root.

Upload files

The SDK picks a strategy automatically: multipart for files under 8 MiB, presigned direct-to-storage above that threshold.
Force a strategy when you need explicit control:

Presigned upload sessions

For resumable or custom upload flows, use the lower-level session API:

Update and delete

Video stream lifecycle

Create streams from stored videos, then manage metadata, captions, chapters, posters, and thumbnail candidates.
Embed playback with @convertly-sh/player — the SDK covers server-side stream management, not the browser player UI.

Error handling

The SDK throws ConvertlyError on non-2xx responses. The error includes the HTTP status and parsed response body:

Method reference

Raw REST API examples remain available in the API Reference for teams that prefer direct HTTP calls.

Other languages

Convertly ships first-party SDKs for JavaScript/TypeScript and PHP. For Python, Go, Ruby, Java, or .NET, use the REST API with your HTTP client of choice.
  • OpenAPI spec: openapi.json (also wired into the Mintlify API Reference)
  • Generate clients with OpenAPI Generator or your platform’s codegen tooling
  • Webhooks, workflows, and CDN configuration remain REST-first — see the API Reference
Last modified on July 28, 2026