Veo 3.1 (First-Last-Image-to-Video)
The model generates realistic 8-second 720p and 1080p videos with detailed visuals and audio, offering multiple styles and even dialogue support. It also allows specifying the first and last frames of the video.
Setup your API Key
If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.
How to Make a Call
API Schemas
Create a video generation task and send it to the server
You can generate a video using this API.
The text description of the scene, subject, or action to generate in the video.
URL of the input image to animate. Should be 720p or higher resolution.
A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video.
The aspect ratio of the generated video.
The length of the output video in seconds.
8Possible values: 1080pPossible values: Whether to generate audio for the video.
trueProvider routing override. google runs native Google with no fallback; fal runs the fal.ai mirror; auto (default) uses the Google -> fal.ai fallback chain. Case-insensitive.
autoThe ID of the generated video.
60ac7c34-3224-4b14-8e7d-0aa0db708325The current status of the generation task.
completedPossible values: curl -L \
--request POST \
--url 'https://api.aimlapi.com/v2/video/generations' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "google/veo-3.1-first-last-image-to-video",
"prompt": "A woman looks into the camera, breathes in, then exclaims energetically, ’Hello world!’",
"image_url": "https://storage.googleapis.com/falserverless/example_inputs/veo31-flf2v-input-1.jpeg",
"last_image_url": "https://storage.googleapis.com/falserverless/example_inputs/veo31-flf2v-input-2.jpeg"
}'{
"id": "60ac7c34-3224-4b14-8e7d-0aa0db708325",
"status": "completed",
"video": {
"url": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
},
"error": {
"name": "text",
"message": "text"
},
"meta": {
"usage": {
"credits_used": 120000
}
}
}Fetch the video
After sending a request for video generation, this task is added to the queue. This endpoint lets you check the status of a video generation task using its id, obtained from the endpoint described above.
If the video generation task status is completed, the response will include the final result — with the generated video URL and additional metadata.
Bearer key
<REPLACE_WITH_YOUR_GENERATION_ID>The ID of the generated video.
60ac7c34-3224-4b14-8e7d-0aa0db708325The current status of the generation task.
completedPossible values: curl -L \
--request GET \
--url 'https://api.aimlapi.com/v2/video/generations?generation_id=<REPLACE_WITH_YOUR_GENERATION_ID>' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>'{
"id": "60ac7c34-3224-4b14-8e7d-0aa0db708325",
"status": "completed",
"video": {
"url": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
},
"error": {
"name": "text",
"message": "text"
},
"meta": {
"usage": {
"credits_used": 120000
}
}
}Full Example: Generating and Retrieving the Video From the Server
Low-res GIF preview:

Last updated
Was this helpful?