Veo 3.1 Lite Serverless API
Affordable text-to-video with audio, powered by Google.
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 scene, subject, action, camera movement, and style.
"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_ratiooptionalstringVideo orientation. 16:9 for YouTube, 9:16 for Reels.
"16:9""16:9""9:16"durationoptionalintegerVideo length in seconds. 4s for ads, 8s for cinematic.
8468generate_audiooptionalbooleanEnable synchronized audio generation alongside the video.
trueimageoptionalstring (uri)Starting image URL anchoring the video's first frame.
"https://segmind-resources.s3.amazonaws.com/input/veo-3.1-lite-input.jpg"last_frameoptionalstring (uri)Ending image URL to control the video's final frame.
nullreference_imagesoptionalstring (uri)Reference image URLs for visual consistency across generations.
resolutionoptionalstringOutput resolution. 720p faster; 1080p for high-detail 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