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.
| Header | Description |
|---|---|
X-Original-Size | Original file size in bytes. |
X-Compressed-Size | Compressed file size in bytes. |
X-Bytes-Saved | Difference (always ≥ 0). |
X-Skipped | 1 if no compression was applied (e.g. already optimised). |
X-Quality | Final JPG quality value the SSIM search settled on (1–100). Omitted for PNG. |
Examples
cURL
Node.js
Python
Limits
- Max file size: 20 MB (configurable per deployment)
- Images larger than 3840 px on either side are downscaled automatically
- Rate limit applies per account (default 20 requests / minute)