Veo 3.1 Lite Serverless API

Affordable text-to-video with audio, powered by Google.

~50.40s
$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 scene, subject, action, camera movement, and style.

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

Video orientation. 16:9 for YouTube, 9:16 for Reels.

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

Video length in seconds. 4s for ads, 8s for cinematic.

Default: 8
Allowed values :
468
generate_audiooptional
boolean

Enable synchronized audio generation alongside the video.

Default: true
imageoptional
string (uri)

Starting image URL anchoring the video's first frame.

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

Ending image URL to control the video's final frame.

Default: null
reference_imagesoptional
string (uri)

Reference image URLs for visual consistency across generations.

resolutionoptional
string

Output resolution. 720p faster; 1080p for high-detail 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