UlazAI developer docs
Developer documentation
Google Veo 3.1 Video Generation API
Generate cinematic AI videos with Google's latest Veo 3.1 model - Features frame control, watermarks, and 99% success rate.
β¨ NEW: Veo 3.1 Fast (100 credits) and Quality (250 credits) now available with first & last frame control!
β¨ Veo 3.1 Features
β Two quality modes - Fast (30-45s) & Quality (45-60s)
β 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
β 99% success rate with fallback mode
β Auto translation to English
β Multiple aspect ratios (16:9, 9:16, Auto)
π° Pricing
β‘ Veo 3.1 Fast
100 credits
~$0.92 per video
30-45 second generation
π Veo 3.1 Quality
250 credits
~$2.31 per video
45-60 second generation
π‘οΈ Fallback Mode
+200 credits
Optional add-on
99% success guarantee
/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_fast", // Options: "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: +200 credits for 99% success
"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_fast (100 credits, 30-45s) or veo3 (250 credits, 45-60s, better quality)
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 fallback mode (+200 credits). Automatically uses backup model if content policies trigger. 99% success rate. 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": "30-45 seconds",
"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
If the video is critical and you can't afford failures, enable fallback mode (+200 credits) for 99% success rate.
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