Veo 3.1 (Reference-to-Video)
Model id: google/veo-3.1-reference-to-video. Veo 3.1 creates videos guided by reference images for consistent character and scene appearance.
The model generates realistic 8-second 720p and 1080p videos with detailed visuals and audio, offering multiple styles and even dialogue support. It also supports multiple reference images for video generation.
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.
The length of the output video in seconds.
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-reference-to-video",
"prompt": "A graceful ballerina dancing outside a circus tent on green grass, with colorful wildflowers swaying around her as she twirls and poses in the meadow.",
"image_urls": [
"https://storage.googleapis.com/falserverless/example_inputs/veo31-r2v-input-1.png",
"https://storage.googleapis.com/falserverless/example_inputs/veo31-r2v-input-2.png",
"https://storage.googleapis.com/falserverless/example_inputs/veo31-r2v-input-3.png"
]
}'{
"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?