Video Generation
Generate videos from text descriptions or animate images using Google Veo 3.1 Fast via the Rebyte data proxy.
Authentication
IMPORTANT: All API requests require authentication. Get your auth token and API URL by running:
AUTH_TOKEN=$(/home/user/.local/bin/rebyte-auth)
API_URL=$(python3 -c "import json; print(json.load(open('/home/user/.rebyte.ai/auth.json'))['sandbox']['relay_url'])")
Include the token in all API requests as a Bearer token, and use $API_URL as the base for all API endpoints.
Model
| Model |
ID |
Audio |
Notes |
| Veo 3.1 Fast |
veo-3.1-fast |
Yes (native) |
Default. Cost-efficient, up to 1080p. |
Note: Video generation is a long-running operation. It typically takes 30–120 seconds to complete. Do not set short timeouts.
Text-to-Video
curl -X POST "$API_URL/api/data/video/generate" \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A slow-motion close-up of espresso being poured into a cup, steam rising, warm golden window light, shallow depth of field, cinematic",
"aspectRatio": "16:9",
"duration": 8
}'
Image-to-Video
Animate a still image by providing it as base64.
curl -X POST "$API_URL/api/data/video/generate" \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The flower slowly blooms in timelapse, petals unfolding",
"image": "<base64-encoded-image>",
"imageMimeType": "image/png",
"duration": 8
}'
Parameters
| Name |
Type |
Required |
Default |
Values |
Description |
prompt |
string |
Yes |
— |
— |
Text description of the video |
image |
string |
No |
— |
— |
Base64-encoded source image (for image-to-video) |
imageMimeType |
string |
No |
image/png |
image/png, image/jpeg, image/webp |
MIME type of source image |
resolution |
string |
No |
720p |
720p, 1080p |
Video resolution. 1080p requires duration: 8 |
aspectRatio |
string |
No |
16:9 |
16:9, 9:16 |
Landscape or portrait |
duration |
number |
No |
8 |
4, 6, 8 |
Seconds. Only 4, 6, or 8. 1080p requires 8 |
Response
{
"video": {
"url": "https://api.rebyte.ai/api/public/artifacts/<workspaceId>/veo-1712345678-a1b2c3d4.mp4",
"mimeType": "video/mp4",
"model": "veo-3.1-fast-generate-preview",
"resolution": "720p",
"aspectRatio": "16:9",
"duration": 8
}
}
The video URL is already publicly downloadable — the relay has stored the video in the workspace's artifact store on your behalf. You can:
Share directly: embed video.url in HTML, markdown, or chat. No auth required.
Download locally if you need the bytes (e.g. to pass to ffmpeg or re-upload elsewhere):
curl -L -o output.mp4 "<video-url>"
You do not need to re-upload the video to the Artifact Store — it's already there.
Writing Effective Video Prompts
Good video prompts describe motion and time, not just a static scene. Include:
- Subject and action: What is happening, who/what is moving
- Camera work: Pan, tilt, zoom, tracking shot, drone shot, static, handheld
- Scene setting: Location, time of day, weather, environment
- Style: Cinematic, documentary, slow motion, timelapse, animation
- Mood and atmosphere: Lighting, color grading, emotional tone
- Temporal flow: What happens first, then next
Prompt Examples
Simple:
A drone shot slowly flying over a misty mountain range at sunrise
Cinematic:
A slow-motion close-up of a coffee cup being filled with espresso, steam rising, warm golden light from a nearby window, shallow depth of field, cinematic color grading
Action:
A tracking shot following a cyclist riding through autumn leaves on a tree-lined path, golden hour lighting, leaves swirling in their wake
Abstract:
Flowing liquid mercury forming geometric shapes in zero gravity, reflecting prismatic light, smooth transitions between forms, dark background, studio lighting
Narrative:
A time-lapse of a flower blooming in a garden, starting from a tight bud to full bloom, morning dew evaporating, soft natural lighting, macro lens perspective
Camera Movement Keywords
| Keyword |
Effect |
| Static |
Fixed camera, no movement |
| Pan |
Horizontal rotation (left/right) |
| Tilt |
Vertical rotation (up/down) |
| Zoom in/out |
Moving closer or further |
| Tracking/dolly |
Camera moves alongside subject |
| Drone/aerial |
Overhead or elevated perspective |
| Handheld |
Slight natural camera shake |
| Orbit |
Camera circles around subject |
| Crane |
Vertical camera movement (rising/lowering) |
Style Keywords
| Keyword |
Effect |
| Cinematic |
Film-quality, 24fps feel, color graded |
| Documentary |
Natural, observational |
| Slow motion |
Time-stretched action |
| Timelapse |
Compressed time |
| Hyperlapse |
Moving timelapse |
| Animation |
Animated/cartoon style |
| Vintage/retro |
Film grain, muted colors |
| Noir |
High contrast, dramatic shadows |
Using with Python
import subprocess
import requests
import base64
import json
from pathlib import Path
AUTH_TOKEN = subprocess.check_output(["/home/user/.local/bin/rebyte-auth"]).decode().strip()
with open('/home/user/.rebyte.ai/auth.json') as f:
API_URL = json.load(f)['sandbox']['relay_url']
HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}
def generate_video(prompt, image_path=None, aspect_ratio="16:9", resolution="720p", duration=8):
payload = {"prompt": prompt, "aspectRatio": aspect_ratio, "resolution": resolution, "duration": duration}
if image_path:
payload["image"] = base64.b64encode(Path(image_path).read_bytes()).decode()
ext = Path(image_path).suffix.lower()
payload["imageMimeType"] = {'.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp'}.get(ext, 'image/png')
return requests.post(f"{API_URL}/api/data/video/generate", headers=HEADERS, json=payload, timeout=300).json()
def save_video(result, filepath):
if "video" not in result:
print(f"Error: {result.get('error', 'Unknown error')}"); return
# video.url is a public relay URL — no auth header needed.
resp = requests.get(result["video"]["url"])
resp.raise_for_status()
Path(filepath).write_bytes(resp.content)
print(f"Saved to {filepath}")
result = generate_video("A drone shot over a misty mountain range at sunrise, cinematic")
save_video(result, "mountains.mp4")
Error Handling
| Error |
Cause |
Fix |
durationSeconds is out of bound |
Invalid duration value |
Use exactly 4, 6, or 8 |
Veo generation failed |
Content safety filter |
Rephrase the prompt |
Veo operation timed out |
Generation took >6 min |
Simpler prompt or shorter duration |
Important Notes
- Generation time: 30–120 seconds. The API call blocks until ready.
- Audio: Veo 3.1 generates native audio matching the scene.
- Video URL: Public relay URL — share directly, no auth needed. Already stored in the workspace artifact store.
- SynthID: All generated videos include invisible watermarking.
- Duration: Only 4, 6, or 8 seconds. No arbitrary values.
- Aspect ratio: Only 16:9 (landscape) or 9:16 (portrait).
- Shorter durations tend to produce higher quality results.
- Be specific about camera movement — it dramatically changes the result.
1---2name: video-generation3description: Generate videos from text prompts or images using Google Veo via Rebyte data API. Use for text-to-video generation or image-to-video animation. Triggers include "generate video", "create video", "make a video", "animate", "video of", "text to video", "image to video", "video generation".4---56# Video Generation78Generate videos from text descriptions or animate images using Google Veo 3.1 Fast via the Rebyte data proxy.910## Authentication1112**IMPORTANT:** All API requests require authentication. Get your auth token and API URL by running:1314```bash15AUTH_TOKEN=$(/home/user/.local/bin/rebyte-auth)16API_URL=$(python3 -c "import json; print(json.load(open('/home/user/.rebyte.ai/auth.json'))['sandbox']['relay_url'])")17```1819Include the token in all API requests as a Bearer token, and use `$API_URL` as the base for all API endpoints.2021## Model2223| Model | ID | Audio | Notes |24|-------|-----|-------|-------|25| **Veo 3.1 Fast** | `veo-3.1-fast` | Yes (native) | Default. Cost-efficient, up to 1080p. |2627**Note:** Video generation is a long-running operation. It typically takes 30–120 seconds to complete. Do not set short timeouts.2829---3031## Text-to-Video3233```bash34curl -X POST "$API_URL/api/data/video/generate" \35 -H "Authorization: Bearer $AUTH_TOKEN" \36 -H "Content-Type: application/json" \37 -d '{38 "prompt": "A slow-motion close-up of espresso being poured into a cup, steam rising, warm golden window light, shallow depth of field, cinematic",39 "aspectRatio": "16:9",40 "duration": 841 }'42```4344## Image-to-Video4546Animate a still image by providing it as base64.4748```bash49curl -X POST "$API_URL/api/data/video/generate" \50 -H "Authorization: Bearer $AUTH_TOKEN" \51 -H "Content-Type: application/json" \52 -d '{53 "prompt": "The flower slowly blooms in timelapse, petals unfolding",54 "image": "<base64-encoded-image>",55 "imageMimeType": "image/png",56 "duration": 857 }'58```5960---6162## Parameters6364| Name | Type | Required | Default | Values | Description |65|------|------|----------|---------|--------|-------------|66| `prompt` | string | **Yes** | — | — | Text description of the video |67| `image` | string | No | — | — | Base64-encoded source image (for image-to-video) |68| `imageMimeType` | string | No | `image/png` | `image/png`, `image/jpeg`, `image/webp` | MIME type of source image |69| `resolution` | string | No | `720p` | `720p`, `1080p` | Video resolution. **1080p requires `duration: 8`** |70| `aspectRatio` | string | No | `16:9` | `16:9`, `9:16` | Landscape or portrait |71| `duration` | number | No | `8` | `4`, `6`, `8` | Seconds. **Only 4, 6, or 8.** 1080p requires 8 |7273---7475## Response7677```json78{79 "video": {80 "url": "https://api.rebyte.ai/api/public/artifacts/<workspaceId>/veo-1712345678-a1b2c3d4.mp4",81 "mimeType": "video/mp4",82 "model": "veo-3.1-fast-generate-preview",83 "resolution": "720p",84 "aspectRatio": "16:9",85 "duration": 886 }87}88```8990The video URL is already publicly downloadable — the relay has stored the video in the workspace's artifact store on your behalf. You can:9192- **Share directly**: embed `video.url` in HTML, markdown, or chat. No auth required.93- **Download locally** if you need the bytes (e.g. to pass to ffmpeg or re-upload elsewhere):9495 ```bash96 curl -L -o output.mp4 "<video-url>"97 ```9899You do **not** need to re-upload the video to the Artifact Store — it's already there.100101---102103## Writing Effective Video Prompts104105Good video prompts describe **motion and time**, not just a static scene. Include:106107- **Subject and action**: What is happening, who/what is moving108- **Camera work**: Pan, tilt, zoom, tracking shot, drone shot, static, handheld109- **Scene setting**: Location, time of day, weather, environment110- **Style**: Cinematic, documentary, slow motion, timelapse, animation111- **Mood and atmosphere**: Lighting, color grading, emotional tone112- **Temporal flow**: What happens first, then next113114### Prompt Examples115116**Simple:**117> A drone shot slowly flying over a misty mountain range at sunrise118119**Cinematic:**120> A slow-motion close-up of a coffee cup being filled with espresso, steam rising, warm golden light from a nearby window, shallow depth of field, cinematic color grading121122**Action:**123> A tracking shot following a cyclist riding through autumn leaves on a tree-lined path, golden hour lighting, leaves swirling in their wake124125**Abstract:**126> Flowing liquid mercury forming geometric shapes in zero gravity, reflecting prismatic light, smooth transitions between forms, dark background, studio lighting127128**Narrative:**129> A time-lapse of a flower blooming in a garden, starting from a tight bud to full bloom, morning dew evaporating, soft natural lighting, macro lens perspective130131### Camera Movement Keywords132133| Keyword | Effect |134|---------|--------|135| Static | Fixed camera, no movement |136| Pan | Horizontal rotation (left/right) |137| Tilt | Vertical rotation (up/down) |138| Zoom in/out | Moving closer or further |139| Tracking/dolly | Camera moves alongside subject |140| Drone/aerial | Overhead or elevated perspective |141| Handheld | Slight natural camera shake |142| Orbit | Camera circles around subject |143| Crane | Vertical camera movement (rising/lowering) |144145### Style Keywords146147| Keyword | Effect |148|---------|--------|149| Cinematic | Film-quality, 24fps feel, color graded |150| Documentary | Natural, observational |151| Slow motion | Time-stretched action |152| Timelapse | Compressed time |153| Hyperlapse | Moving timelapse |154| Animation | Animated/cartoon style |155| Vintage/retro | Film grain, muted colors |156| Noir | High contrast, dramatic shadows |157158---159160## Using with Python161162```python163import subprocess164import requests165import base64166import json167from pathlib import Path168169AUTH_TOKEN = subprocess.check_output(["/home/user/.local/bin/rebyte-auth"]).decode().strip()170with open('/home/user/.rebyte.ai/auth.json') as f:171 API_URL = json.load(f)['sandbox']['relay_url']172173HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}174175def generate_video(prompt, image_path=None, aspect_ratio="16:9", resolution="720p", duration=8):176 payload = {"prompt": prompt, "aspectRatio": aspect_ratio, "resolution": resolution, "duration": duration}177 if image_path:178 payload["image"] = base64.b64encode(Path(image_path).read_bytes()).decode()179 ext = Path(image_path).suffix.lower()180 payload["imageMimeType"] = {'.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp'}.get(ext, 'image/png')181 return requests.post(f"{API_URL}/api/data/video/generate", headers=HEADERS, json=payload, timeout=300).json()182183def save_video(result, filepath):184 if "video" not in result:185 print(f"Error: {result.get('error', 'Unknown error')}"); return186 # video.url is a public relay URL — no auth header needed.187 resp = requests.get(result["video"]["url"])188 resp.raise_for_status()189 Path(filepath).write_bytes(resp.content)190 print(f"Saved to {filepath}")191192result = generate_video("A drone shot over a misty mountain range at sunrise, cinematic")193save_video(result, "mountains.mp4")194```195196---197198## Error Handling199200| Error | Cause | Fix |201|-------|-------|-----|202| `durationSeconds is out of bound` | Invalid duration value | Use exactly 4, 6, or 8 |203| `Veo generation failed` | Content safety filter | Rephrase the prompt |204| `Veo operation timed out` | Generation took >6 min | Simpler prompt or shorter duration |205206---207208## Important Notes209210- **Generation time**: 30–120 seconds. The API call blocks until ready.211- **Audio**: Veo 3.1 generates native audio matching the scene.212- **Video URL**: Public relay URL — share directly, no auth needed. Already stored in the workspace artifact store.213- **SynthID**: All generated videos include invisible watermarking.214- **Duration**: Only 4, 6, or 8 seconds. No arbitrary values.215- **Aspect ratio**: Only 16:9 (landscape) or 9:16 (portrait).216- **Shorter durations** tend to produce higher quality results.217- Be specific about camera movement — it dramatically changes the result.