Skip to content
ImgSquash
FeaturesPricingBlog
Optimize & SquashCompress images to smallest sizeConvert ImagesConvert between image formatsEnhance ImagesResize, sharpen, blur, tintAI UpscaleUpscale images with AI
Sign InTry Free
FeaturesPricingBlog
Tools
Optimize & SquashConvert ImagesEnhance ImagesAI Upscale
Sign InTry Free
Home / Developers

Image optimization API

Outcome-oriented parameters. Tell us the goal — we pick the encoding. Available on the Business plan ($49/mo).

Quick start

curl -X POST https://www.imgsquash.com/api/images/optimize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@photo.jpg" \
  -F "format=avif" \
  -F "quality=75"

Outcome-oriented parameters

Goalformatquality
smallestavif60
balanced (default)avif75
qualitywebp85

Plus: width, height, maintainAspectRatio, preserveMetadata (Pro+), blur/sharpen/tint (Pro+).

Node.js

const fd = new FormData();
fd.append("image", new Blob([await file.arrayBuffer()]), "photo.jpg");
fd.append("format", "avif");
fd.append("quality", "75");
const res = await fetch("https://www.imgsquash.com/api/images/optimize", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.IMGSQUASH_API_KEY },
  body: fd,
});
const pct = res.headers.get("X-Compression-Ratio");

Limits & errors

  • Business: 10,000 optimizations/hour, 100MB/file, 7680×4320 max.
  • 400 invalid type/size — 429 rate limit (respect Retry-After) — 403 tier/dimension limit — 500 processing failure.
  • Response headers: X-Compression-Ratio, X-Original-Size, X-Optimized-Size.
  • Manage keys in Dashboard → API Keys. Machine docs: /llms.txt, /agents.md.

See Business plan · All tools · Benchmark methodology

ImgSquash

Make every image web-ready. Smart Optimize with real savings preview. Secure processing — files auto-deleted, never stored.

Product

  • Optimize
  • All Tools
  • Bulk Compressor
  • AI Upscaler
  • Pricing

Compress

  • WebP Compressor
  • AVIF Compressor
  • JPEG Compressor
  • PNG Compressor

Convert & Edit

  • HEIC Converter
  • PNG to WebP
  • Image Resizer

Developers

  • API Docs
  • Benchmarks
  • llms.txt
  • agents.md

Resources

  • Blog
  • How to Optimize Images
  • AVIF vs WebP vs JPEG
  • FAQ

Company

  • Features
  • Privacy
  • Terms
  • Contact

© 2026 ImgSquash.com. All rights reserved.

Privacy PolicyTerms of Service