Veo 3.1

This guide shows how to generate images using Veo 3.1 model via the Leonardo.AI REST API.

This guide shows how to generate images using Veo 3.1 model via the Leonardo.AI REST API.

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-image-to-video\
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data'{
       "prompt": "<YOUR_PROMPT>",
       "imageId" : "<IMAGE_ID_OF_START_FRAME>",
       "imageType": "UPLOADED",
       "endFrameImage":{
           "id" : "<IMAGE_ID_OF_END_FRAME>",
           "type": "UPLOADED"
       },
       "resolution": "RESOLUTION_1080",
       "duration":8,
       "height":1080,
       "width":1920,
       "model": "VEO3_1"
     }'

Recipe

API Request Endpoint, Headers, Parameters

Endpoint

https://cloud.leonardo.ai/api/rest/v1/generations-image-to-video

Headers

--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"

Body Parameters

ParameterTypeDefinition
durationnumberSpecifies the length of the generated video in seconds. Set to 4, 6, or 8.
endFrameImageobjectDefines the ending frame for start-and-end-frame video generation. Must include an image id and type. Only applicable when generating videos using both start and end frames. Requires specifying start frame (imageId, imageType).
heightnumberSets the height of the output video in pixels.
imageIdstringIdentifier of the image used as the starting frame for image-to-video generation. The image must exist as an uploaded or previously generated asset.
imageTypestringSpecifies the source type of the start frame image. Set to UPLOADED or GENERATED.
isPublicbooleanControls whether the generated video is public or private. Set to true to make the generation public, or false to keep it private.
modelstringSelects the Veo model used for generation. Set to VEO3_1, and VEO3_1FAST.
promptstringText description that guides the content, style, and motion of the generated video.
resolutionstringDefines the output resolution preset. Set to RESOLUTION_720 and RESOLUTION_1080.
widthnumberSets the width of the output video in pixels.

Default Height and Width

When specifying resolution, please note the following defaults.

Veo3.1 720p generates at an aspect ratio of 16:9 at dimensions 1280x720.

Veo3.1 720p generates at an aspect ratio of 9:16 at dimensions 720x1280.

Veo3.1 1080p generates at an aspect ratio of 16:9 at dimensions 1920x1080.

Veo3.1 1080p generates at an aspect ratio of 9:16 at dimensions 1080x1920.

height and width dimensions specified outside of this will not be accepted.

Please note uploaded images will be cropped to fit those dimensions.