Developer API

Integrate server-side image compression and format conversion into your app. Optimization runs on ImageOptimizer servers using sharp (not browser WASM). Authenticate with an API key header and send images as multipart form data.

Authentication

Sign in, then create an API key on this page. Pass the key in the x-api-key header on every request. Manage or revoke keys anytime; revoked keys return an authentication error.

POST /api/v1/optimize

Required field: image (file). Optional: format — webp, avif, jpeg, or png (default webp); quality — 1–100 (default 80). A successful response returns the optimized binary with an appropriate Content-Type. Response headers include X-Before-Bytes, X-After-Bytes, and X-Compression-Percent when processing succeeds.

curl -X POST https://www.imageoptimizer.org/api/v1/optimize \
  -H "x-api-key: YOUR_KEY" \
  -F "image=@photo.jpg" \
  -F "format=webp" \
  -F "quality=80" \
  --output optimized.webp

Rate limits and upload size

Daily request caps (UTC): free 5, Starter 75, Pro 400, Agency / Lifetime 3000. Burst per minute: free 5, Starter 15, Pro 30, Agency 90. Maximum upload size: free 8 MB, Starter 15 MB, Pro 40 MB, Agency 80 MB. Exceeding limits returns JSON with rate_limit_exceeded or a file-size error.

Call GET /api/v1/optimize with the same key to read your plan, daily limit, burst, and max file size without uploading an image. Upgrade limits on pricing or explore browser tools for client-side workflows.

Frequently asked questions

How do I authenticate API requests?
Send your secret key in the x-api-key header. Create keys after signing in on this page; each key is shown once when generated. Revoked keys stop working immediately.
What endpoint should I call?
POST https://www.imageoptimizer.org/api/v1/optimize with multipart form fields image (required), format (webp, avif, jpeg, or png), and quality (1–100). The response is the optimized image bytes with Content-Type set to the output format.
What are the rate limits?
Daily request caps depend on your plan: free 5, Starter 75, Pro 400, Agency and Lifetime 3000 per UTC day. Burst limits per minute and max upload size also vary by plan; see the rate limit table on this page or GET /api/v1/optimize with your key.
What errors might I see?
Missing or invalid keys return JSON with an error message and 401. Rate limits return rate_limit_exceeded with 429. Oversized files, missing image field, or invalid multipart requests return 400-level JSON errors. Processing failures may return 422 with an error string.
Where do I upgrade for more API calls?
Compare monthly plans on /pricing. Higher tiers raise daily API limits, burst per minute, and maximum upload size for POST /api/v1/optimize.