API Documentation
Pixly's processing engine runs entirely in the browser. Our JavaScript SDK and WebAssembly modules let you embed the same privacy-first image tools directly into your own applications.
Introduction
Pixly's processing engine is built on WebAssembly (WASM) and browser-native APIs (Canvas, Web Workers, OffscreenCanvas). Rather than a traditional REST API, Pixly provides a client-side SDK that runs all image processing in the browser — no server roundtrips, no data uploads, complete privacy.
The SDK is available as an npm package and can also be loaded via CDN. It's compatible with all modern browsers that support WebAssembly and Web Workers.
Authentication
The Pixly SDK is completely free and does not require an API key. All tools — including AI-powered ones — are available without authentication. Simply install the SDK and start processing images.
// Initialize the SDK with your API key import Pixly from '@pixly/sdk'; const pixly = new Pixly({ apiKey: 'px_live_your_api_key_here', workerCount: 4, // number of Web Workers });
Rate Limits
Since processing happens client-side, there are no traditional server-side rate limits. However, the following limits apply to API key validation and model downloads:
- All tools: Unlimited use of every tool, including AI-powered tools. No daily limits or usage caps.
- Model downloads: AI models are cached after first load (~50MB total) for instant subsequent use.
- No API key required: Everything runs client-side with no server validation needed.
API Endpoints (SDK Methods)
All methods accept a File, Blob, or ImageData object and return a Promise<Blob>.
Removes the background from an image using on-device ML (U2Net model). Returns a PNG with transparent background.
const result = await pixly.removeBackground(imageFile, { model: 'u2net', // 'u2net' | 'u2netp' (lite) outputFormat: 'png', outputQuality: 0.92, edgeRefine: true, }); // result is a Blob containing the processed PNG const url = URL.createObjectURL(result);
Upscales an image by 2x or 4x using Real-ESRGAN. Supports photo and anime models.
const result = await pixly.upscale(imageFile, { scale: 4, // 2 or 4 model: 'realesrgan-x4plus', tileMode: 'auto', // splits large images into tiles outputFormat: 'png', });
Compresses an image with smart quality adjustment. Supports JPEG, WebP, and AVIF output.
const result = await pixly.compress(imageFile, { format: 'webp', quality: 80, // 1-100 effort: 4, // encoding effort (1-6, higher = smaller file) keepMetadata: false, });
Converts an image between formats (JPEG, PNG, WebP, AVIF, BMP, GIF).
const result = await pixly.convert(imageFile, { format: 'avif', quality: 85, });
Processes multiple images in parallel using Web Workers. Supports up to 50 images per batch.
const results = await pixly.batchProcess(imageFiles, { operation: 'compress', format: 'webp', quality: 80, onProgress: (index, total) => { console.log(`Processed ${index}/${total}`); }, });
Extracts EXIF metadata, dimensions, color profile, and file size from an image. No API key required.
const meta = await pixly.getMetadata(imageFile); // { width: 1920, height: 1080, format: 'jpeg', // exif: { camera: '...', gps: null, ... }, // colorSpace: 'srgb', size: 245678 }
Error Handling
All SDK methods throw typed errors. Catch them with try/catch or .catch():
try { const result = await pixly.removeBackground(file); } catch (err) { if (err.code === 'PIXLY_INVALID_KEY') { // API key is invalid or expired } else if (err.code === 'PIXLY_MODEL_LOAD_FAILED') { // ML model failed to download or initialize } else if (err.code === 'PIXLY_UNSUPPORTED_FORMAT') { // Image format not supported } else { // Other processing error } }
SDKs & Libraries
The Pixly SDK is available for multiple platforms:
- JavaScript / TypeScript:
npm install @pixly/sdk— Full SDK with all tools - React:
npm install @pixly/react— React hooks and components - Vue:
npm install @pixly/vue— Vue 3 composables - CDN:
https://cdn.pixly.app/sdk/v2/pixly.min.js— UMD bundle
Webhooks
Since Pixly processes images entirely client-side, there are no server-side webhooks. All processing results are returned directly to the calling code. For server-side workflows, consider running the Pixly WASM modules in a Node.js or Deno environment using the @pixly/node package.
Need developer support?
Email us at support@pixly.app with "API" in the subject line.
GitHub: Pixly SDK repository
Response time: Within 24 hours
Start editing for free
Join 2M+ users who process images privately in their browser. 100% free, no signup required.
🔒 No signup required · 100% free · All tools included