Veo 3.1 Lite Serverless API

Generate high-quality AI videos with audio from text or images using Google's most affordable video model.

~45.55s
$0.250 - $1.00 per generation
 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

POSThttps://api.segmind.com/v1/veo-3.1-lite

Parameters

promptrequired
string

Describe your scene, subject, action, camera movement, and style clearly. Lead with subject and action; add lighting and audio cues for richer outputs.

Default: "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_ratiooptional
string

Choose the video orientation. Use 16:9 for YouTube and web content; select 9:16 for TikTok, Instagram Reels, and YouTube Shorts.

Default: "16:9"
Allowed values :
"16:9""9:16"
durationoptional
integer

Set the video length in seconds. Use 4s for ads and social clips, 6s for product demos, 8s for cinematic or storytelling scenes.

Default: 8
Allowed values :
468
generate_audiooptional
boolean

Enable synchronized audio generation alongside the video. Set true for social and marketing content; false when adding custom audio in post.

Default: true
imageoptional
string (uri)

Provide a starting image URL to anchor the video's first frame. Ideal for product animations, portrait videos, or scene-based storytelling.

Default: "https://segmind-resources.s3.amazonaws.com/input/veo-3.1-lite-input.jpg"
last_frameoptional
string (uri)

Provide an ending image URL to control the video's final frame. Perfect for morphing transitions, product reveals, or story conclusions.

Default: null
reference_imagesoptional
string (uri)

Provide reference image URLs to maintain visual consistency across generations. Useful for brand characters, product shots, or subject identity.

resolutionoptional
string

Set output video resolution. Choose 720p for faster, cost-efficient generation; select 1080p for high-detail, shareable content.

Default: "720p"
Allowed values :
"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.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out