Compress image
Endpoints
/v1/compress
Compress an image using file upload, URL, or base64-encoded data. Returns the compressed image binary with metadata in response headers.
POST
Compress image
Authorizations
API key for authentication. Get your key at https://compresto.app/dashboard
Body
Provide either 'image' (base64) or 'url'. If both are provided, 'url' takes priority.
Base64-encoded image (with or without data URI prefix)
Public image URL (https)
Compression quality (1-100)
Required range:
1 <= x <= 100Output format
Available options:
auto, jpeg, png, webp Maximum width in pixels (maintains aspect ratio)
Required range:
x >= 1Maximum height in pixels (maintains aspect ratio)
Required range:
x >= 1Response
Compressed image binary
The response is of type file.

