Developer API
Compress and convert images programmatically with a simple HTTP API.
Authentication
Create an API key in your dashboard, then send it with the Authorization header on every request.
Authorization: Bearer tc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxCreate your API key
Endpoint
Multipart/form-data request to the compression endpoint:
curl -X POST http://localhost:3000/api/compress \ -H "Authorization: Bearer tc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "file=@image.png" \ -F "format=png" \ -o compressed.png
To convert formats, set format to the target type — the image is converted and compressed in one request (e.g. a PNG input with format=jpeg returns a compressed JPEG).
curl -X POST http://localhost:3000/api/compress \ -H "Authorization: Bearer tc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "file=@photo.png" \ -F "format=jpeg" \ -o photo.jpg
| Parameter | Type | Description |
|---|---|---|
| file | file | The image file to process (PNG, JPEG, WebP or AVIF). |
| format | string | Output format: png, jpeg, webp or avif. Omit to keep the original format (compress only); passing a different format converts the image and compresses it in one step. |
Response
Returns the compressed image directly as binary with the appropriate Content-Type. On error, a JSON payload is returned instead.
HTTP/1.1 200 OK Content-Type: image/png <binary image data>
Rate limits
The free plan includes 50 requests per day. API keys are managed in your dashboard.
