Documentation
SmallConvert API
Convert PNG, JPEG, WebP, and AVIF with one straightforward API. Files upload directly to Cloudflare, so they never pass through your application server.
Quickstart
Create a job with the source file metadata and the format you want back. Authentication is optional for the free tier.
curl -X POST https://www.smallconvert.com/api/v1/convert \
-H "content-type: application/json" \
-H "authorization: Bearer $SMALLCONVERT_API_KEY" \
-d '{
"filename": "photo.png",
"bytes": 1842310,
"contentType": "image/png",
"targetFormat": "webp",
"quality": 82
}'How it works
Create
Send metadata and choose an output format.
Upload
PUT the file directly to the returned upload URL.
Complete
Tell SmallConvert the upload has finished.
Download
Poll the job until the download URL is ready.
POST/api/v1/convert
Creates a conversion job and returns the URLs needed to upload, complete, and poll it.
filenamestring · required
Original filename with its extension.
bytesnumber · required
Exact source file size in bytes.
contentTypestring · required
Source image MIME type.
targetFormatstring · required
png, jpeg, webp, or avif.
qualitynumber · optional
Output quality from 1–100.
{
"id": "job_7fq2m4x9",
"status": "uploading",
"upload_url": "https://cdn.smallconvert.cloud/...",
"upload_method": "PUT",
"complete_url": "/api/v1/jobs/job_7fq2m4x9/complete",
"poll_url": "/api/v1/jobs/job_7fq2m4x9"
}POST/api/v1/jobs/:id/complete
Call this after the direct upload succeeds. The image is then queued for conversion.
{
"id": "job_7fq2m4x9",
"status": "queued",
"poll_url": "/api/v1/jobs/job_7fq2m4x9"
}GET/api/v1/jobs/:id
Poll until the status is done. A finished job includes its download URL.
{
"id": "job_7fq2m4x9",
"status": "done",
"source_format": "png",
"target_format": "webp",
"output_bytes": 428416,
"took_ms": 1904,
"download_url": "/api/v1/jobs/job_7fq2m4x9/download"
}Supported formats
image/pngLossless images and transparencyimage/jpegCompact photographyimage/webpEfficient web imagesimage/avifNext-generation compressionErrors
400Malformed or unsupported request.401Invalid or deleted API key.402Monthly conversion quota exhausted.403Missing scope or suspended account.413File exceeds the plan size limit.429Rate limit exceeded.503Conversion service unavailable.Rate limits
Limits use fixed one-hour windows. Anonymous requests are counted by IP; authenticated requests are counted by API key.
x-ratelimit-limit: 2000
x-ratelimit-remaining: 1994
x-ratelimit-reset: 1788400800