1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const axios = require('axios');
const FormData = require('form-data');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/veo-3.1";
const reqBody = {
"prompt": "A woman is giving a keynote presentation at a tech conference, wearing a sleek white blazer with the Veo 3.1 logo subtly embroidered, highlighted by ambient blue stage lighting. She is on a modern conference stage with geometric patterns and LED screens behind her, discussing how Veo 3.1 can integrate reference images to enhance AI-generated video content. The Veo 3.1 logo is also displayed prominently on a large digital screen behind her",
"duration": 8,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true,
"negative_prompt": "no black and white, no sharp angles"
};
(async function() {
try {
const formData = new FormData();
// Append regular fields
for (const key in reqBody) {
if (reqBody.hasOwnProperty(key)) {
formData.append(key, reqBody[key]);
}
}
// Convert and append images as Base64 if necessary
const response = await axios.post(url, formData, {
headers: {
'x-api-key': api_key,
...formData.getHeaders()
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
})();Sets a random seed for consistency. Useful for repeated generations.
Start generation from this image. Ideal for specific starting visuals.
Describe the video content. Use clear, concise language for best results.
Choose the video length: short is 4s, medium 6s, long 8s.
Allowed values:
End video with this image. Useful for specific concluding visuals.
Set video quality: 720p for standard, 1080p for high resolution.
Allowed values:
Choose aspect ratio: 16:9 for landscape, 9:16 for portrait mode.
Allowed values:
Enable audio generation. Recommended for videos requiring sound.
Exclude elements from video. Useful for refining details.
Use reference images for consistency. Essential for maintaining subject style.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Edited by Segmind Team on October 22, 2025.
Veo 3.1 is a next-generation AI model that creates dynamic videos with synchronized audio from static images. Developed by Google DeepMind, it renders videos with a high degree of realism and precise creative control, the options that empower developers and content creators to create professional-quality visual output effortlessly.
How is Veo 3.1 different from other video generation models? Veo 3.1's integrated audio generation, precise frame control, and a holistic video generation with synchronized audio make it a sophisticated model when compared to other options.
What's the optimal way to use reference images? Reference images produce the precise results when they clearly show the subject and style you want to include in the video. Furthermore, supplementing multiple references can guide the model to give you the desired outcome.
Can I control the video's style consistency? Yes, using a combination of reference images, specific prompts, and seed values ensures a consistent style control across multiple generations.
How do I achieve the best video quality? To get the best video quality, select 1080p resolution, provide clear reference images, and detailed prompts. For complex scenes, longer video durations will ensure smooth transitions.
Can I generate videos without audio? Yes, the generate_audio parameter can be turned off when you want a video without any audio.
