Documentation

Images API

The Images API allows you to serve and transform images on-the-fly. You can resize, crop, apply effects, and optimize images for different use cases.

Serve image

Access and serve an image, with optional transformations applied on-the-fly.

Endpoint

bash
GET /file/:path

Path parameters

ParameterTypeDescription
pathStringThe path to the image file

Query parameters

ParameterTypeDescription
formatStringjpeg, png, webp, avif, gif, tiff, bmp, or auto. Overrides the URL extension. Auto lets Get Pronto choose an efficient output format; bmp returns the original without conversion.
wIntegerWidth in pixels (1-5000)
hIntegerHeight in pixels (1-5000)
fitStringResize mode: cover, contain, fill, inside, outside
qInteger | 'auto'Quality (1-100), or auto to choose per image; defaults to 80 when encoding
blurNumberBlur radius (0.3-1000)
sharpBooleanApply sharpening
grayBooleanConvert to grayscale
rotIntegerRotation angle (-360 to 360)
borderStringFormat: 'width_hexcolor' (e.g., '5_FF0000')
cropStringFormat: 'x,y,width,height'

Example request

bash
curl "https://api.getpronto.io/v1/file/user-123/image.jpg?w=800&h=600&fit=cover&format=auto&q=auto"

Returns image bytes with the appropriate Content-Type. This delivery URL is public and requires no API key. Start with your uploaded file's secureUrl and preserve its full path.

Generate transform URL

Generate a public image URL with specified transformations. This management endpoint requires a secret API key; loading the generated URL does not require authentication.

Endpoint

bash
POST /file/:id/transform-url

Path parameters

ParameterTypeDescription
idStringThe unique identifier of the image

Request body parameters

ParameterTypeDescription
wIntegerWidth in pixels (1-5000)
hIntegerHeight in pixels (1-5000)
fitStringResize mode: cover, contain, fill, inside, outside
qInteger | 'auto'Quality (1-100), or auto to choose per image; defaults to 80 when encoding
blurNumberBlur radius (0.3-1000)
sharpBooleanApply sharpening
grayBooleanConvert to grayscale
rotIntegerRotation angle (-360 to 360)
borderStringFormat: 'width_hexcolor' (e.g., '5_FF0000')
cropStringFormat: 'x,y,width,height'
formatStringjpeg, png, webp, avif, gif, tiff, bmp, or auto. Auto lets Get Pronto choose an efficient output format; bmp returns the original without conversion.

Example request

bash
curl -X POST https://api.getpronto.io/v1/file/123e4567-e89b-12d3-a456-426614174000/transform-url \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "w": 800,
    "h": 600,
    "fit": "cover",
    "q": 90,
    "format": "webp"
  }'

Response

json
{
  "url": "https://api.getpronto.io/v1/file/user-123/image.webp?w=800&h=600&fit=cover&q=90&format=webp",
  "originalFile": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "filename": "image.jpg",
    "mimetype": "image/jpeg"
  },
  "transformations": {
    "w": 800,
    "h": 600,
    "fit": "cover",
    "q": 90,
    "format": "webp"
  }
}

Transformation options

The following transformations can be applied to images either via URL parameters or through the transform URL endpoint:

Resize

ParameterTypeDescription
w, hIntegerTarget dimensions (1-5000px). Images are not enlarged beyond their source dimensions. Supply one dimension to preserve the aspect ratio; w=auto and h=auto are not supported.
fitStringHow image fits: cover (default), contain, fill, inside, outside

Example: w=800&h=600&fit=cover

Quality

ParameterTypeDescription
qInteger | 'auto'Output quality (1-100), or 'auto' to pick a level per image

Example: q=auto

Format

ParameterTypeDescription
formatStringOverrides the URL extension. Auto lets Get Pronto choose an efficient output format; SVG and BMP originals are passed through. The result does not vary by browser.

Example: format=auto

Effects

ParameterTypeDescription
blurNumberGaussian blur (0.3-1000)
sharpBooleanSharpen the image
grayBooleanConvert to grayscale

Example: blur=5&sharp=true&gray=true

Rotation & Cropping

ParameterTypeDescription
rotIntegerRotation angle (-360 to 360)
cropStringCrop coordinates (x,y,width,height)

Example: rot=90&crop=100,100,500,500

Note: Transformations use a fixed server pipeline. Changing the order of query parameters does not change the processing order. Do not rely on parameter order to control cropping or resizing.

Automatic options and responsive sizing

text
https://api.getpronto.io/v1/file/user-123/image.jpg?w=800&format=auto&q=auto

Keep the original extension when using format=auto. Automatic quality chooses a format-specific starting quality and adjusts it for simple graphics or transparency. It does not target a file size. Both automatic options are opt-in.

For responsive sizing, provide several width URLs in srcsetand describe your layout with sizes. The browser chooses a candidate. Use the SDK's imageProps helper or copy responsive HTML from the dashboard's transform builder. Adjust the copied sizes and alt text for your page. Each requested width can create a separate transformation; generating URLs alone does not process images.

See image defaults and fallback behaviour for SVG/BMP delivery, animation, transparency and quota handling.

Next steps

Continue exploring our documentation with these related topics: