UploadKit
API Reference

Image Transformations API

Generate stable public or expiring signed edge transformation URLs for UploadKit Cloud images.

POST /api/v1/transforms/image

Creates a CDN URL for an image variant using the project API key. Delivery can be an expiring signed URL or a stable public URL.

The endpoint allows 120 requests per minute per API key. Reuse returned URLs and avoid generating them on every browser request.

This endpoint requires a paid plan, a live (uk_live_) key, and UploadKit Cloud storage. It cannot transform BYOS files.

curl -X POST "https://api.uploadkit.dev/api/v1/transforms/image" \
  -H "Authorization: Bearer uk_live_xxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "project/imageUploader/id/photo.jpg",
    "width": 800,
    "height": 600,
    "fit": "cover",
    "quality": 80,
    "format": "auto",
    "delivery": "public"
  }'

Request body

FieldTypeRequiredDescription
keystringYesStorage key returned after upload.
widthintegerConditionalWidth from 1–4096. Width or height is required.
heightintegerConditionalHeight from 1–4096. Width or height is required.
fitstringNoscale-down, contain, cover, crop, or pad.
qualityintegerNoOutput quality from 1–100. Default 85.
formatstringNoauto, avif, webp, jpeg, or png.
deliverystringNosigned (default, expires) or public (stable URL).

Response

{
  "url": "https://cdn.uploadkit.dev/p/<signature>/w_800,h_600,fit_cover,q_80,f_auto/project/imageUploader/id/photo.jpg",
  "expiresAt": null,
  "delivery": "public",
  "transform": { "width": 800, "height": 600, "fit": "cover", "quality": 80, "format": "auto" },
  "usage": { "period": "2026-07", "used": 143, "limit": 5000, "units": 3, "counted": true }
}

usage.counted is false when that exact variant already exists in the current period. usage.units is 1 for an explicit format and 3 for auto.

Public URLs use /p/, never expire, and are suitable for permanent frontend use. Signed URLs use /t/ and return an ISO timestamp in expiresAt. Both paths are protected against modification: changing the file key or transform options invalidates the URL.

Transformation recipes are readable and canonical: w_<width>,h_<height>,fit_<mode>,q_<quality>,f_<format>. Width or height is omitted when it was not requested. The HMAC signature covers the exact recipe, so editing parameters directly returns 403; request a new URL instead.

Errors

CodeHTTPCause
IMAGE_TRANSFORMS_REQUIRE_PAID_PLAN403Account is on Free.
IMAGE_TRANSFORMS_REQUIRE_LIVE_KEY403A test key was used.
NOT_FOUND404File is missing or belongs to another project.
UNSUPPORTED_TRANSFORM_TYPE415File is not an image.
IMAGE_TRANSFORM_LIMIT_EXCEEDED429Monthly quota is exhausted.
VALIDATION_ERROR400Invalid options.

On this page