API documentation

A single endpoint that accepts an image and returns a smaller one.

Authentication

Every request must include your API key as a header. Get a key by signing up.

Authorization: Bearer YOUR_API_KEY

X-API-Key: YOUR_API_KEY is also accepted.

POST /api/v1/compress

Multipart upload. Field name must be image. Accepted formats: JPG, PNG.

Response: the compressed image bytes, with size info in headers.

Response headers returned by the compress endpoint
HeaderDescription
X-Original-SizeOriginal file size in bytes.
X-Compressed-SizeCompressed file size in bytes.
X-Bytes-SavedDifference (always ≥ 0).
X-Skipped1 if no compression was applied (e.g. already optimised).
X-QualityFinal JPG quality value the SSIM search settled on (1–100). Omitted for PNG.

Examples

cURL


      

Node.js


      

Python


    

Limits