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
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Storage key returned after upload. |
width | integer | Conditional | Width from 1–4096. Width or height is required. |
height | integer | Conditional | Height from 1–4096. Width or height is required. |
fit | string | No | scale-down, contain, cover, crop, or pad. |
quality | integer | No | Output quality from 1–100. Default 85. |
format | string | No | auto, avif, webp, jpeg, or png. |
delivery | string | No | signed (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
| Code | HTTP | Cause |
|---|---|---|
IMAGE_TRANSFORMS_REQUIRE_PAID_PLAN | 403 | Account is on Free. |
IMAGE_TRANSFORMS_REQUIRE_LIVE_KEY | 403 | A test key was used. |
NOT_FOUND | 404 | File is missing or belongs to another project. |
UNSUPPORTED_TRANSFORM_TYPE | 415 | File is not an image. |
IMAGE_TRANSFORM_LIMIT_EXCEEDED | 429 | Monthly quota is exhausted. |
VALIDATION_ERROR | 400 | Invalid options. |