ImageResizer API
One JSON endpoint that resizes, compresses, crops, rotates and converts images. Point it at an image URL, say what you want, and it returns a link to the result.
Agent friendly
JSON in, JSON out, image by URL. No multipart uploads.
Links, not blobs
Results come back as a URL that lives for one hour.
Same engine
Identical pipeline to the web tools, so sizes match.
Authentication
Create a key on your dashboard and send it as a bearer token. The key is shown once when you create it and is not recoverable afterwards, so store it somewhere before you close the page.
Authorization: Bearer irk_live_YOUR_KEYAPI calls draw on the same daily quota and file size ceiling as your plan on the website. Free is 10 images a day at 10MB, Pro is 100 a day at 50MB, and Ultra is unlimited at 200MB. The API also caps each key at 60 requests a minute.
Your first call
Getting a photo under 100KB, which is the request this API gets more than any other. Set targetKB and let the server find the quality that fits, rather than guessing at a quality number and checking the result yourself.
curl -X POST https://imageresizer.org/api/v1/images \
-H "Authorization: Bearer irk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/photo.jpg",
"operation": "compress",
"format": "jpg",
"targetKB": 100
}'The response:
{
"url": "https://imageresizer.org/api/v1/results/8Kf2...",
"expiresAt": "2026-09-20T15:04:05.000Z",
"format": "jpg",
"contentType": "image/jpeg",
"bytes": 98213,
"width": 2016,
"height": 1512,
"source": {
"bytes": 2481234,
"width": 4032,
"height": 3024,
"format": "jpeg"
},
"target": {
"requestedBytes": 102400,
"met": true,
"quality": 74,
"scale": 0.5
},
"plan": "PRO"
}When you set a target, check target.met. If it is false, the size was not reachable even heavily downscaled, and you got the smallest file the image could produce instead of an error.
More examples
An exact social banner
fit: "cover" fills the frame and centre-crops the overflow, so a portrait photo becomes a proper 1200x630 banner instead of a squashed one.
{
"imageUrl": "https://example.com/photo.jpg",
"operation": "resize",
"width": 1200,
"height": 630,
"fit": "cover"
}HEIC to JPG
Format conversion with no resizing. Dimensions are untouched.
{
"imageUrl": "https://example.com/photo.heic",
"operation": "convert",
"format": "jpg"
}Parameters
imageUrlstringPublic http(s) URL of the source image. Use this when you have a link. Private, loopback and link-local addresses are rejected.
imageBase64stringThe image as base64, with or without a data: prefix. Use only when there is no URL. Cannot be combined with imageUrl. Base64 is about a third larger than the file it encodes, and the request body is capped at 200MB, so anything over roughly 150MB has to come in as a URL.
operationstringresize, compress, convert, crop or rotate. Defaults to resize.
formatstringjpg, png, webp, avif, gif, tiff, bmp, or same to keep the source format. Defaults to same.
qualityinteger1 to 100, defaults to 90. Ignored when targetKB or targetBytes is set.
width / heightintegerTarget dimensions, up to 10000px.
fitstringinside scales proportionally inside the box (default). cover fills the box exactly and centre-crops the overflow. fill stretches to the box.
percentagenumberScale to a percentage of the original, 1 to 400, instead of width and height.
targetKBnumberTarget file size in KB. The API searches for the highest quality that fits. Applies to jpg, webp and avif output.
targetBytesintegerThe same target, in bytes.
rotatenumberDegrees clockwise, with operation=rotate.
flipH / flipVbooleanMirror horizontally or vertically.
left / top / cropWidth / cropHeightintegerCrop rectangle, with operation=crop. cropWidth and cropHeight are required.
Errors
Every failure returns a JSON body with a stable code you can branch on and a message written to be read by a person.
{ "error": { "code": "daily_limit_reached", "message": "..." } }401 unauthorized — missing, unknown or revoked key.
400 fetch_failed — the imageUrl could not be fetched, or points somewhere private.
400 unsupported_image — the bytes are not a decodable image.
413 file_too_large — the source exceeds your plan's file size limit.
429 rate_limited — more than 60 requests in a minute on one key.
429 daily_limit_reached — your plan's daily image quota is used up.
Using this with an AI agent
The API publishes an OpenAPI 3.1 description, which is what an agent needs in order to write its own client against it without anyone hand-writing an integration:
https://imageresizer.org/api/v1/openapi.jsonAny agent platform that can read an OpenAPI document and hold an API key can work with this endpoint directly, which includes Meta's Muse custom connectors. Give the agent the document URL above and a key from your dashboard. Results come back as links, which is what makes this usable in a chat: the agent can hand the user a URL instead of trying to move megabytes of base64 around.
This is a REST API, not an MCP server. MCP clients speak their own protocol and cannot call it directly without a bridge that translates the OpenAPI document above into MCP tools.
Result links
A processed image stays at its URL for one hour and then it is deleted. The link carries 32 bytes of randomness and needs no API key to open, so it can be given to someone who does not have one. Treat it as a secret anyway: anyone holding the link can open the image until it expires.