Veo 3.1 Lite Serverless API
Generate high-quality AI videos with audio from text or images using Google's most affordable video model.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/veo-3.1-lite"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/input/veo-3.1-lite-input.jpg",
12 "prompt": "The camera slowly pans across a breathtaking aerial view of a misty mountain valley at golden hour, snow-capped peaks glistening, birds flying gracefully through wisps of morning fog",
13 "duration": 8,
14 "resolution": "720p",
15 "aspect_ratio": "16:9",
16 "generate_audio": true
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/veo-3.1-lite"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/input/veo-3.1-lite-input.jpg",
12 "prompt": "The camera slowly pans across a breathtaking aerial view of a misty mountain valley at golden hour, snow-capped peaks glistening, birds flying gracefully through wisps of morning fog",
13 "duration": 8,
14 "resolution": "720p",
15 "aspect_ratio": "16:9",
16 "generate_audio": true
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text)API Endpoint
https://api.segmind.com/v1/veo-3.1-liteParameters
promptrequiredstringDescribe your scene, subject, action, camera movement, and style clearly. Lead with subject and action; add lighting and audio cues for richer outputs.
"The camera slowly pans across a breathtaking aerial view of a misty mountain valley at golden hour, snow-capped peaks glistening, birds flying gracefully through wisps of morning fog"aspect_ratiooptionalstringChoose the video orientation. Use 16:9 for YouTube and web content; select 9:16 for TikTok, Instagram Reels, and YouTube Shorts.
"16:9""16:9""9:16"durationoptionalintegerSet the video length in seconds. Use 4s for ads and social clips, 6s for product demos, 8s for cinematic or storytelling scenes.
8468generate_audiooptionalbooleanEnable synchronized audio generation alongside the video. Set true for social and marketing content; false when adding custom audio in post.
trueimageoptionalstring (uri)Provide a starting image URL to anchor the video's first frame. Ideal for product animations, portrait videos, or scene-based storytelling.
"https://segmind-resources.s3.amazonaws.com/input/veo-3.1-lite-input.jpg"last_frameoptionalstring (uri)Provide an ending image URL to control the video's final frame. Perfect for morphing transitions, product reveals, or story conclusions.
nullreference_imagesoptionalstring (uri)Provide reference image URLs to maintain visual consistency across generations. Useful for brand characters, product shots, or subject identity.
resolutionoptionalstringSet output video resolution. Choose 720p for faster, cost-efficient generation; select 1080p for high-detail, shareable content.
"720p""720p""1080p"Response Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out