ad-images
Ad Images

Resize Image By Url

Resize an image by URL (no AdImage record required).

Uses Gemini AI to regenerate the image at the target aspect ratio. Useful for images from chat/marketing agent that don't have ad records.

Credits: Consumes 1 credit per resize operation.

post/api/v1/ad-images/resize-by-url

Request

  • Base URL: https://api.trylapis.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.trylapis.com/api/v1/ad-images/resize-by-url
  • Auth: HTTP bearer

Query parameters

client_user_idinteger nullable

Client user ID to view data for

Headers

x-lapis-dev-tokenstring nullable
x-assume-user-idinteger nullable

Request body

image_urlstring required

URL of the source image to resize

target_aspect_ratio'square' | 'portrait' | 'landscape' | '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' required

Supported aspect ratios for ad images.

Response

Successful Response

successboolean required
resized_image_urlstring required

URL of the resized image

source_aspect_ratiostring required

Detected source aspect ratio

target_aspect_ratiostring required

Target aspect ratio

messagestring required

Changes

No recorded changes to this operation across all 1 revision of this API.