{"openapi":"3.0.3","info":{"title":"Image Toolkit API","version":"1.0.0","description":"Convert, compress, resize, watermark and inspect images.\n\nOne endpoint per job, no SDK required. Backed by libvips, so a 4000x3000 JPEG converts to WebP in well under a second. Accepts a multipart upload, a public URL, or base64.","contact":{"url":"https://173-249-18-142.sslip.io"}},"servers":[{"url":"https://173-249-18-142.sslip.io"}],"tags":[{"name":"Image Toolkit API","description":"Convert, compress, resize, watermark and inspect images."}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your Smallapis key. Omit it to use the demo quota."}}},"security":[{"apiKey":[]}],"paths":{"/v1/image/convert":{"post":{"tags":["Image Toolkit API"],"summary":"Convert an image to another format","description":"Re-encodes the input to WebP, AVIF, JPEG, PNG, GIF or TIFF. Animated sources keep their frames for WebP and GIF.","operationId":"v1_image_convert","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to convert (multipart). Alternative to `url` / `base64`.","format":"binary"},"url":{"type":"string","description":"Public URL of the image to fetch instead of uploading."},"format":{"type":"string","description":"Target format: webp, avif, jpeg, png, gif, tiff.","default":"webp"},"quality":{"type":"integer","description":"Encoder quality, 1-100.","default":82},"lossless":{"type":"boolean","description":"Lossless mode for webp and avif.","default":false}}}},"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public URL of the image to fetch instead of uploading."},"format":{"type":"string","description":"Target format: webp, avif, jpeg, png, gif, tiff.","default":"webp"},"quality":{"type":"integer","description":"Encoder quality, 1-100.","default":82},"lossless":{"type":"boolean","description":"Lossless mode for webp and avif.","default":false}}}}}}}},"/v1/image/compress":{"post":{"tags":["Image Toolkit API"],"summary":"Compress an image and report the saving","description":"Re-encodes at a lower quality and returns the smaller file, with `x-saved-percent` in the response headers.","operationId":"v1_image_compress","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to compress.","format":"binary"},"url":{"type":"string","description":"Public URL instead of an upload."},"quality":{"type":"integer","description":"Encoder quality, 1-100.","default":78},"format":{"type":"string","description":"Output format; defaults to the source format."}}}},"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public URL instead of an upload."},"quality":{"type":"integer","description":"Encoder quality, 1-100.","default":78},"format":{"type":"string","description":"Output format; defaults to the source format."}}}}}}}},"/v1/image/resize":{"post":{"tags":["Image Toolkit API"],"summary":"Resize an image","description":"Scales to the given box. Pass one of width/height to keep the aspect ratio.","operationId":"v1_image_resize","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to resize.","format":"binary"},"url":{"type":"string","description":"Public URL instead of an upload."},"width":{"type":"integer","description":"Target width in pixels."},"height":{"type":"integer","description":"Target height in pixels."},"fit":{"type":"string","description":"cover, contain, fill, inside or outside.","default":"inside"},"withoutEnlargement":{"type":"boolean","description":"Never upscale a smaller source.","default":true},"background":{"type":"string","description":"Padding colour used by fit=contain.","default":"#ffffff"}}}},"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public URL instead of an upload."},"width":{"type":"integer","description":"Target width in pixels."},"height":{"type":"integer","description":"Target height in pixels."},"fit":{"type":"string","description":"cover, contain, fill, inside or outside.","default":"inside"},"withoutEnlargement":{"type":"boolean","description":"Never upscale a smaller source.","default":true},"background":{"type":"string","description":"Padding colour used by fit=contain.","default":"#ffffff"}}}}}}}},"/v1/image/crop":{"post":{"tags":["Image Toolkit API"],"summary":"Crop a rectangle out of an image","description":"Crop a rectangle out of an image","operationId":"v1_image_crop","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to crop.","format":"binary"},"left":{"type":"integer","description":"Left offset in pixels.","default":0},"top":{"type":"integer","description":"Top offset in pixels.","default":0},"width":{"type":"integer","description":"Crop width in pixels."},"height":{"type":"integer","description":"Crop height in pixels."}}}},"application/json":{"schema":{"type":"object","properties":{"left":{"type":"integer","description":"Left offset in pixels.","default":0},"top":{"type":"integer","description":"Top offset in pixels.","default":0},"width":{"type":"integer","description":"Crop width in pixels."},"height":{"type":"integer","description":"Crop height in pixels."}}}}}}}},"/v1/image/rotate":{"post":{"tags":["Image Toolkit API"],"summary":"Rotate or flip an image","description":"Rotate or flip an image","operationId":"v1_image_rotate","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to rotate.","format":"binary"},"angle":{"type":"integer","description":"Rotation in degrees.","default":90},"flip":{"type":"boolean","description":"Mirror vertically.","default":false},"flop":{"type":"boolean","description":"Mirror horizontally.","default":false}}}},"application/json":{"schema":{"type":"object","properties":{"angle":{"type":"integer","description":"Rotation in degrees.","default":90},"flip":{"type":"boolean","description":"Mirror vertically.","default":false},"flop":{"type":"boolean","description":"Mirror horizontally.","default":false}}}}}}}},"/v1/image/watermark":{"post":{"tags":["Image Toolkit API"],"summary":"Stamp a text watermark on an image","description":"Stamp a text watermark on an image","operationId":"v1_image_watermark","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to stamp.","format":"binary"},"text":{"type":"string","description":"Caption to draw."},"position":{"type":"string","description":"north, northeast, east, southeast, south, southwest, west, northwest, center.","default":"southeast"},"fontSize":{"type":"integer","description":"Font size in pixels; scales with the image by default."},"opacity":{"type":"number","description":"Fill opacity, 0.05-1.","default":0.45},"color":{"type":"string","description":"Hex colour of the text.","default":"#ffffff"}},"required":["text"]}},"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"Caption to draw."},"position":{"type":"string","description":"north, northeast, east, southeast, south, southwest, west, northwest, center.","default":"southeast"},"fontSize":{"type":"integer","description":"Font size in pixels; scales with the image by default."},"opacity":{"type":"number","description":"Fill opacity, 0.05-1.","default":0.45},"color":{"type":"string","description":"Hex colour of the text.","default":"#ffffff"}},"required":["text"]}}}}}},"/v1/image/strip":{"post":{"tags":["Image Toolkit API"],"summary":"Remove EXIF, GPS and XMP metadata","description":"Returns a visually identical file with every metadata block dropped. `x-had-exif` says whether there was anything to remove.","operationId":"v1_image_strip","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to clean.","format":"binary"},"url":{"type":"string","description":"Public URL instead of an upload."}}}},"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public URL instead of an upload."}}}}}}}},"/v1/image/metadata":{"post":{"tags":["Image Toolkit API"],"summary":"Read image dimensions, format and EXIF presence","description":"Read image dimensions, format and EXIF presence","operationId":"v1_image_metadata","responses":{"200":{"description":"Result payload","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to inspect.","format":"binary"},"url":{"type":"string","description":"Public URL instead of an upload."}}}},"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public URL instead of an upload."}}}}}}}},"/v1/image/palette":{"post":{"tags":["Image Toolkit API"],"summary":"Extract the dominant colours","description":"Extract the dominant colours","operationId":"v1_image_palette","responses":{"200":{"description":"Result payload","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Image to analyse.","format":"binary"},"colors":{"type":"integer","description":"How many colours to return, 1-16.","default":6}}}},"application/json":{"schema":{"type":"object","properties":{"colors":{"type":"integer","description":"How many colours to return, 1-16.","default":6}}}}}}}},"/v1/image/thumbnail":{"post":{"tags":["Image Toolkit API"],"summary":"Produce a square WebP thumbnail","description":"Crops on the most interesting region rather than the centre.","operationId":"v1_image_thumbnail","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source image.","format":"binary"},"size":{"type":"integer","description":"Side length in pixels.","default":320}}}},"application/json":{"schema":{"type":"object","properties":{"size":{"type":"integer","description":"Side length in pixels.","default":320}}}}}}}}}}