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
baseUrl:
fetch implementation for testing or middleware:
Convert a file
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
PDF tools
Metadata and inspection
Signed transforms
Generate a time-limited signed URL for on-the-fly image transforms without uploading:Full tool list
thumbnailpdfPreviewimageToPdfstripMetadataposterFrameextractAudiowatermarkinspecttrimgifstoryboardvideoFramestransformremoveBackgroundsignedTransformtransfer
Transfer and download files
Download a remote file through Convertly, optionally extracting archives: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 return403; use a workspace API key or a WordPress site token with isolated storage when needed.
List files and folders
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.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.@convertly-sh/player — the SDK covers server-side stream management, not the browser player UI.
Error handling
The SDK throwsConvertlyError 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