New users get free credits - no credit card required Get started

Flexible Image Compression

Resize and recompress a single image with custom output format, size, and quality.

POST /api/free/compress-image-stream

Use Flexible Image Compression online

Upload, configure, preview and download without an API key.

No sign-in or API key

1. Upload and settings

Use this tool online without an API key. Files are sent only when you run the request.

Image file *
Output format
Size
Custom width
Quality
Complete the required fields to run the tool.POST /api/free-online/compress-image-stream

2. Preview and download

Your result will appear here

Preview, size changes and download controls are shown here

Integrate with the API

Only programmatic calls require an API key. Parameters, responses and errors are documented below.

API endpoint
POST /api/free/compress-image-stream

Online use is keyless. Programmatic calls to this endpoint require an APIAny key.

How it works
  • Use size=custom with width between 1 and 8192.
  • Uses local Sharp processing; no third-party compression key is required.

Response

A successful request returns a image response with the Content-Type described by this page.

Common errors

400
A file or parameter is missing, invalid or outside the documented limit.
401
The API key is missing, invalid or disabled for programmatic API calls.
429
The online or authenticated shared rate limit has been reached.

Parameters and limits

ParameterRequirementDefaultAccepted values
imageImage fileRequiredfile
formatOutput formatOptionalwebporiginal, webp, png, jpg, jpeg
sizeSizeOptionaloriginaloriginal, 500, 1200, custom
widthCustom widthOptionalnumber
qualityQualityOptional80number

API example

Use this authenticated example in code. The online Playground above intentionally does not request or expose your key.

curl -X POST "https://apiany.ai/api/free/compress-image-stream" \
  -H "Authorization: Bearer $API_KEY" \
  -F "image=@input.png" \
  -F "format=webp" \
  -F "size=custom" \
  -F "width=1024" \
  -F "quality=82" \
  --output output.webp

Frequently asked questions

Do I need an API key for Flexible Image Compression?

No key is required in the online Playground. Programmatic requests use Authorization: Bearer or X-API-Key.

What are the limits for Flexible Image Compression?

Online use is limited to 3 requests per minute and 30 per day. Authenticated free accounts receive 5 RPM and paid accounts receive 500 RPM across free APIs.

Which inputs does Flexible Image Compression accept?

Use the required and optional fields in the parameter table. Unsupported formats and out-of-range values are rejected.

What does Flexible Image Compression return?

Successful requests return a image response. Errors use the HTTP status codes listed above.

Source: APIAny free API catalog and live route behavior. Content reviewed 2026-07-17.