UlazAI developer docs
Google Veo 3.1 Video Generation API
Google Veo 3.1 Video Generation API
Generate videos with Veo 3.1 using the supported frame controls and job-status workflow.
✨ NEW: Veo 3.1 Lite, Fast, and Quality are available with first & last frame control.
✨ Veo 3.1 Features
✅ Three model options - Lite, Fast, and Quality
✅ Frame control - Set first & last frame images
✅ Text-to-video and image-to-video
✅ 8-second videos with native audio
✅ Watermark support - Add brand text
✅ Optional fallback mode for a second model attempt
✅ Auto translation to English
✅ Multiple aspect ratios (16:9, 9:16, Auto)
💰 Pricing
💸 Veo 3.1 Lite
40 credits
Best-value mode
Text-to-video + image-to-video
⚡ Veo 3.1 Fast
100 credits
~$0.92 per video
Time varies by queue
💎 Veo 3.1 Quality
220 credits
~$2.31 per video
Time varies by queue
🛡️ Fallback Mode
+200 credits
Optional add-on
Fallback does not guarantee success
/veo31/api/generate/
Generate Veo 3.1 Video
Create an 8-second video with Google Veo 3.1 using text prompts and optional image frames.
Request Body
{
"prompt": "A golden retriever running through a field of flowers at sunset",
"model": "veo3_lite", // Options: "veo3_lite", "veo3_fast", "veo3"
"aspectRatio": "16:9", // Options: "16:9", "9:16", "Auto"
"imageUrls": [], // Optional: Array of 1-2 image URLs
"seeds": 42069, // Optional: 10000-99999 for reproducible results
"watermark": "UlazAI", // Optional: Max 50 characters
"enableFallback": false, // Optional fallback attempt; check current extra credits
"enableTranslation": true // Optional: Auto-translate to English
}
Parameters
prompt * (string)
Text description of the video to generate. Max 5000 characters. Be descriptive about actions, camera movements, and atmosphere.
model * (string)
Model to use: veo3_lite (40 credits), veo3_fast (100 credits), or veo3 (220 credits)
aspectRatio (string)
Video aspect ratio: 16:9 (landscape), 9:16 (portrait), Auto (automatic). Default: 16:9
imageUrls (array)
Optional array of 1-2 image URLs for frame control:
• 1 image: Video centers around this image
• 2 images: Video transitions from first to last frame
Max 10MB per image, JPG/PNG only
seeds (integer)
Optional seed for reproducible results. Range: 10000-99999
watermark (string)
Optional watermark text to overlay on video. Max 50 characters. Great for branding.
enableFallback (boolean)
Enable an optional backup-model attempt. Check the current extra credit cost; fallback does not guarantee completion. Default: false
enableTranslation (boolean)
Auto-translate prompt to English for best results. Supports all languages. Default: true
Success Response (201)
{
"success": true,
"data": {
"task_id": "veo31_abc123def456",
"status": "processing",
"model": "veo3_fast",
"credits_charged": 100,
"credits_remaining": 900,
"estimated_time": "varies by queue",
"message": "Veo 3.1 video generation started successfully"
}
}
Error Response (400)
{
"success": false,
"error": "Insufficient credits. Required: 100, Available: 50"
}
cURL Example - Text-to-Video
curl -X POST https://ulazai.com/veo31/api/generate/ \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A golden retriever running through a field of flowers at sunset, slow motion, cinematic lighting",
"model": "veo3_fast",
"aspectRatio": "16:9",
"watermark": "MyBrand",
"enableTranslation": true
}'
cURL Example - Image-to-Video with Frame Control
curl -X POST https://ulazai.com/veo31/api/generate/ \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The character slowly turns their head and smiles at the camera",
"model": "veo3",
"aspectRatio": "16:9",
"imageUrls": ["https://your-domain.com/start-frame.jpg"],
"seeds": 42069,
"enableFallback": true
}'
Python Example
import requests
import time
API_KEY = "your_api_key_here"
BASE_URL = "https://ulazai.com"
# Generate video
response = requests.post(
f"{BASE_URL}/veo31/api/generate/",
headers={
"Authorization": f"Token {API_KEY}",
"Content-Type": "application/json"
},
json={
"prompt": "A serene mountain lake at sunrise with mist rising from the water",
"model": "veo3_fast",
"aspectRatio": "16:9",
"watermark": "MyBrand"
}
)
data = response.json()
if data["success"]:
task_id = data["data"]["task_id"]
print(f"Task created: {task_id}")
# Poll for completion
while True:
status_response = requests.get(
f"{BASE_URL}/veo31/api/status/{task_id}/",
headers={"Authorization": f"Token {API_KEY}"}
)
status_data = status_response.json()
if status_data["data"]["status"] == "completed":
video_url = status_data["data"]["video_url"]
print(f"Video ready: {video_url}")
break
elif status_data["data"]["status"] == "failed":
print(f"Generation failed: {status_data['data']['error_message']}")
break
time.sleep(5) # Poll every 5 seconds
else:
print(f"Error: {data['error']}")
/veo31/api/status/<task_id>/
Check Generation Status
Check the status of a Veo 3.1 video generation task.
Response - Processing
{
"success": true,
"data": {
"task_id": "veo31_abc123def456",
"status": "processing",
"model": "veo3_fast",
"prompt": "A golden retriever running through flowers",
"credits_charged": 100
}
}
Response - Completed
{
"success": true,
"data": {
"task_id": "veo31_abc123def456",
"status": "completed",
"video_url": "https://cdn.ulazai.com/videos/veo31_abc123.mp4",
"thumbnail_url": "https://cdn.ulazai.com/videos/veo31_abc123_thumb.jpg",
"resolution": "1080p",
"duration": 8,
"aspect_ratio": "16:9",
"fallback_used": false,
"credits_charged": 100
}
}
Response - Failed
{
"success": true,
"data": {
"task_id": "veo31_abc123def456",
"status": "failed",
"error_message": "Content policy violation. Enable fallback mode to retry.",
"credits_refunded": 100
}
}
cURL Example
curl -X GET https://ulazai.com/veo31/api/status/veo31_abc123def456/ \
-H "Authorization: Token YOUR_API_KEY"
/veo31/api/upload-frame/
Upload Frame Image
Upload an image for frame control (first or last frame). Returns a URL to use in the generate endpoint.
Request (multipart/form-data)
Content-Type: multipart/form-data
image: (binary file data)
Parameters
image * (file)
Image file to upload. Max 10MB. Supported formats: JPG, PNG. Recommended resolution: 1920x1080 or higher.
Success Response (200)
{
"success": true,
"url": "https://cdn.ulazai.com/uploads/frame_abc123.jpg",
"message": "Image uploaded successfully"
}
cURL Example
curl -X POST https://ulazai.com/veo31/api/upload-frame/ \
-H "Authorization: Token YOUR_API_KEY" \
-F "image=@/path/to/your/image.jpg"
Status Codes
200 OK - Request successful
201 Created - Generation task created successfully
400 Bad Request - Invalid parameters or insufficient credits
401 Unauthorized - Missing or invalid API key
404 Not Found - Task ID not found
413 Payload Too Large - Image exceeds 10MB limit
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Server error, contact support
Task Status Values
pending - Task created, waiting to start
processing - Video is being generated
completed - Video generation successful, video_url available
failed - Generation failed, credits automatically refunded
💡 Best Practices
Use descriptive prompts
Include details about actions, camera movements, lighting, and atmosphere. Example: "slow motion close-up of water droplets falling, backlit by golden sunset, shallow depth of field"
Enable fallback for important content
For important jobs, consider the optional fallback attempt and still handle failed or rejected generations in your workflow.
Use seeds for consistency
If you need to regenerate similar videos, use the same seed value (10000-99999) for more consistent results.
Frame control for branding
Upload 1 image to center your video around it, or 2 images to create a smooth transition. Perfect for consistent character or product videos.
Poll status efficiently
Poll every 5 seconds for Fast mode, 10 seconds for Quality mode. Don't poll more frequently to avoid rate limits.
📝 Example Prompts
✅ Good Prompt
"A majestic eagle soars over snow-capped mountains at dawn, golden light illuminating its wings, slow motion camera tracking shot from below, cinematic composition"
✅ Good Prompt
"Close-up of a barista pouring latte art, steam rising from the cup, warm cafe lighting, shallow depth of field, macro lens perspective"
❌ Poor Prompt
"eagle flying"
Too vague - missing details about setting, movement, camera angle
Send Veo 3.1 jobs with the current model identifier
Choose the Veo 3.1 mode that matches the required input and quality, then submit the documented fields and retain the returned job ID. Image references and text-only jobs should not be forced through the same payload blindly.
Read the live pricing and duration options before the request. Poll to completion and handle failure or refund states instead of assuming acceptance means delivery.