/v1/compressBearer keyCompress an image
Re-encode an image at a lower quality, optionally changing format at the same time. Synchronous: the compressed bytes come back in the response body.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
imagerequired | file | multipart/form-data | The source image. JPEG, PNG, WebP or AVIF, 20 MB maximum. |
quality | integer | multipart/form-data | Encoder quality. 75-85 is the usual range.Default: 80 |
format | string (jpeg | png | webp | avif) | multipart/form-data | Output format. Defaults to the input format. |
Responses
- 200
- The transformed image bytes, with a Content-Type of image/*.(image/*)
- 401
- No API key, or a key that is invalid, expired or revoked.(application/json)
- 403
- The key's plan or scopes do not permit this operation.(application/json)
- 413
- The input image is larger than 20 MB.(application/json)
- 422
- The request is missing an image, or a parameter is invalid.(application/json)
- 429
- Rate limit or monthly operation cap exceeded. See Retry-After.(application/json)