Docs
What runs where, and what is coming next.
How swapfile.io works
The converter and metadata cleaner run entirely in your browser using the File API and canvas. Your file is read into memory on your device, processed there and downloaded from there. For formats a browser cannot decode (like HEIC outside Safari), a server-side pipeline is coming; those jobs will be deleted from storage within one hour.
Data flow
API
Convert files from your own code with a REST API. It runs the same server pipeline as the site: you register an upload, send the bytes, start a conversion job, then download the result — all authenticated with an API key.
Create an API key in your account
Authentication
Every request carries your key in the Authorization header (Bearer), or an X-API-Key header. Treat it like a password — it spends your account's conversion quota.
curl https://api.swapfile.io/v1/jobs/{id} \
-H "Authorization: Bearer sf_live_..."Converting a file
# 1 · register the upload → presigned URL curl -X POST https://api.swapfile.io/v1/uploads \ -H "Authorization: Bearer sf_live_..." \ -H "Content-Type: application/json" \ -d '{"size": 48213}' → {"file_id":"9f2c…","upload_url":"https://…"} # 2 · send the raw bytes to that URL curl -X PUT --upload-file photo.heic "$UPLOAD_URL" # 3 · start the conversion curl -X POST https://api.swapfile.io/v1/jobs \ -H "Authorization: Bearer sf_live_..." \ -H "Content-Type: application/json" \ -d '{"file_id":"9f2c…","operation":"convert:jpeg","params":{"quality":"82"}}' → 202 {"id":"7ab1…","status":"queued"} # 4 · poll until done, then download curl https://api.swapfile.io/v1/jobs/7ab1… \ -H "Authorization: Bearer sf_live_..." → {"status":"done","download_url":"https://…"}
Endpoints
/v1/uploadsRegister an upload; returns a presigned PUT URL.{upload_url}Send the raw file bytes (max 100 MB)./v1/jobsStart a conversion job for an uploaded file./v1/jobs/{id}Job status; includes download_url once done./v1/jobs/{id}Delete the file and job immediately.Operations
Pass one of these as the operation. Accepted inputs include JPEG, PNG, WebP, GIF, BMP, HEIC, AVIF and TIFF.
convert:jpeg→ JPEG · params: quality (1–100)convert:png→ PNG (lossless)convert:webp→ WebP · params: quality (1–100)Limits
- 100 MB max upload
- 30 conversions / day (free)
- 60 requests / minute per key
- Files auto-deleted within 1 hour
Errors
Failures return RFC 9457 problem+json with a stable code field — for example unauthorized, unsupported_format, file_too_large, quota_exceeded or rate_limited.
Verify it yourself
Open your browser's developer tools, watch the network tab and convert a file. You will see no request carrying your file.