API Documentation

Complete reference for the Image Optimizer API with examples in multiple programming languages

Your API Key

Click "Customize" to enter your API key and personalize all code examples.

Navigation

Authentication

The Image Optimizer API uses API key authentication. Include your API key in the X-API-Key header with every request.

X-API-Key: api_live_your_key_here

Get your API key by registering here.

Base URL

https://image-optimizer.app/api/v1

Endpoints

Process Image

POST/api/v1/process

Upload and process a single image with specified optimization options.

Parameters

file
RequiredFile

Image file to process

options
OptionalJSON string

Processing options object

Examples

cURL
curl -X POST \
  -H "X-API-Key: api_live_your_key_here" \
  -F "file=@image.jpg" \
  -F 'options={"format":"webp","quality":80,"preset":"llm-optimized"}' \
  https://image-optimizer.app/api/v1/process

Interactive Playground

Test the API directly from your browser. All requests will count towards your usage quota.

API Playground Unavailable

The interactive API playground is only available for logged-in users with valid API keys.

Get API Key

Built-in Presets

llm-optimizedChatGPT, Claude, and other LLM prompts

Optimized for AI/LLM processing with maximum token efficiency

{ "format": "webp", "quality": 75, "maxDimension": 1024, "compressionLevel": 6, "stripMetadata": true }
balancedGeneral web use and documentation

Good quality with reasonable file sizes for general use

{ "format": "jpeg", "quality": 85, "maxDimension": 1536, "compressionLevel": 5, "progressive": true }
high-qualityProfessional presentations and archival

Minimal compression with maximum quality preservation

{ "format": "png", "quality": 95, "maxDimension": 2048, "compressionLevel": 3, "stripMetadata": false }
apple-optimizediPhone photos, iCloud sharing, Apple devices

Native Apple ecosystem compatibility with HEIC format

{ "format": "heic", "quality": 85, "maxDimension": 1920, "compressionLevel": 6, "stripMetadata": true }

Error Codes

400

Bad Request

Invalid parameters, unsupported file type, or file too large

401

Unauthorized

Invalid or missing API key

403

Forbidden

API key inactive or account suspended

413

Payload Too Large

File exceeds tier limit

429

Rate Limited

Too many requests, check rate limit headers

500

Internal Error

Server processing error

Rate Limits

Rate limits are enforced per minute based on your subscription tier. Free tier also has daily limits:

Free5 requests/minute + 10 requests/day
Starter30 requests/minute
Pro100 requests/minute
Enterprise300 requests/minute

Rate Limit Headers

X-RateLimit-Remaining - Requests remaining in current window
X-RateLimit-Reset - Unix timestamp when rate limit resets
Retry-After - Seconds to wait before retrying (on 429 responses)