Send one or more image files to this endpoint to compress and optimize them. You can control output format, quality, dimensions, watermarking, and AI features such as alt text generation and SEO filename renaming. The endpoint processes all files in a batch and returns a signed download URL for each optimized image.Documentation Index
Fetch the complete documentation index at: https://docs.fluximage.io/llms.txt
Use this file to discover all available pages before exploring further.
Watermarking and AI features (auto alt text and SEO rename) require a paid plan. Attempting to use these features on a free plan returns a
403 error.Request
Method:POSTURL:
https://fluximage.app/api/compressContent-Type:
multipart/form-dataAuthorization:
Bearer flx_live_your_key_here
Parameters
Core
Image file to optimize. Repeat this field to include multiple files in a single request. Maximum 20 files per batch; each file must not exceed 20 MB.
Output format. Accepted values:
webp, avif, jpg, png.Compression quality, from
40 to 100. Higher values produce larger files with better fidelity. Applies to webp, avif, and jpg outputs; PNG uses lossless compression regardless of this value.Maximum output width in pixels. The image is scaled down proportionally if it exceeds this value. Images smaller than this value are not enlarged.
Maximum output height in pixels. The image is scaled down proportionally if it exceeds this value. Images smaller than this value are not enlarged.
Custom identifier used to group results from the same session. If omitted, the API generates a random identifier automatically.
Watermark
PNG image to overlay as a watermark on every processed file. Requires a paid plan. If you are on the free plan, this field is ignored.
Watermark width as a percentage of the base image width. Accepted range:
5–50.Watermark opacity from
0 (fully transparent) to 100 (fully opaque).Position of the watermark on the image. Accepted values:
| Value | Position |
|---|---|
TL | Top left |
TC | Top center |
TR | Top right |
ML | Middle left |
MC | Middle center |
MR | Middle right |
BL | Bottom left |
BC | Bottom center |
BR | Bottom right (default) |
AI features
When
true, the API uses AI to generate an SEO-optimized alt text string for each image. Requires a paid plan and available AI credits. Each image consumes one AI credit.When
true, the API uses AI to generate an SEO-friendly filename for each image (lowercase words joined by hyphens). Requires a paid plan and available AI credits. Enabling both autoAltText and autoRenameSEO still consumes only one AI credit per image, not two.Language used for AI-generated alt text and filenames. Accepted values:
English, Español, Català, Français, Deutsch, Italiano, Português, Nederlands, Polski, Русский, 中文, 日本語, 한국어, Arabic, Hindi.A short phrase describing the context of your images, used to improve AI output quality. Example:
"ecommerce store selling sportswear".Keywords to guide AI alt text and filename generation. Example:
"running shoes men".Example request
Response
200 OK
Returns a JSON object with adata array. Each element corresponds to one successfully optimized image.
Response fields
Array of optimized image results, one per successfully processed file.
Error codes
| Status | Error | Description |
|---|---|---|
400 | Maximum 20 images allowed per batch | The request includes more than 20 files. |
400 | File <name> exceeds the 20MB limit | One or more files exceed the 20 MB per-file limit. |
401 | Unauthorized | The API key is missing or invalid. |
403 | (plan limit message) | Your plan’s monthly compression limit has been reached. |
403 | ia_not_available | AI features require a paid plan. Upgrade to Starter or higher. |
403 | no_credits | You have used all your AI credits this month. Purchase a top-up to continue. |
500 | (message) | An unexpected server error occurred. |
403 AI error response shape
When an AI feature is blocked, the response includes botherror and message fields: