{"endpoint":"POST /api/optimize","auth":"Authorization: Bearer <api key>  (or X-Api-Key header, or ?key=). Optional while ALLOW_ANONYMOUS is on.","body":["multipart/form-data with a `file` field","raw image bytes with an image/* Content-Type","application/json { \"url\": \"https://...\" } for a remote image"],"params":{"w":"max width (px)","h":"max height (px)","fit":"inside (default, never upscales) | contain | cover | fill","format":"webp (default) | avif | jpeg | png","q":"1-100, or auto (default) | auto:eco | auto:best  - auto searches for the lowest quality that keeps the image visually identical","effort":"encoder effort, webp 0-6 (default 5), avif 0-9 (default 4)","strip":"1 (default) drops EXIF/GPS, 0 keeps metadata; colours are always converted to sRGB","lossless":"1 for lossless webp/avif/png","bg":"hex colour used when flattening transparency to jpeg (default ffffff)","upscale":"1 to allow enlarging small images","site":"domain the image belongs to, for usage tracking (else Origin/Referer/reverse DNS of caller)","dry":"1 returns JSON stats instead of the image"},"response":"image bytes; stats in X-Original-Size, X-Optimized-Size, X-Saved-Percent, X-Quality-Used, X-SSIM, X-Input-Dimensions, X-Output-Dimensions, X-Processing-Ms","example":"curl -H 'Authorization: Bearer KEY' -F file=@photo.jpg 'https://image-optimization.4tech-dev.si/api/optimize?w=1600&h=1600&format=webp&q=auto' -o photo.webp"}