๐Ÿ—œ๏ธ

Image Compress API

Compress images programmatically with quality control. Supports JPEG, PNG, WebP, AVIF with optional auto-resize. Perfect for AI agents processing images before storing or sending.

API Docs $0.001 / request

About this tool

Compress and optimize images via a simple API call. Pass an image URL or base64, set the quality level (1โ€“100), choose output format (JPEG, PNG, WebP, AVIF), and optionally cap the width. Returns the compressed image as base64 with original/compressed sizes and reduction percentage.

Quick Start

curl -X POST https://api.iteratools.com/image/compress \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "image_url": "https://example.com/photo.jpg", "quality": 75, "format": "webp", "max_width": 1280 }'

Response

{ "ok": true, "image_base64": "data:image/webp;base64,...", "original_size": 512000, "compressed_size": 89600, "reduction_pct": 82.5, "format": "webp", "width": 1280, "height": 720 }

Parameters

Field Type Description
image_url string Public HTTPS URL of the image (or use image_base64)
image_base64 string Base64 data URL (data:image/jpeg;base64,...)
quality integer Compression quality 1โ€“100 (default: 80)
format string Output format: jpeg, png, webp, avif (default: keep original)
max_width integer Max width in pixels; resizes if wider (keeps aspect ratio)

Pricing

$0.001 per request via x402 micropayment on Base (USDC).

Full Documentation Browse All Tools