Video
Video generation
Make videos with Seedance from a prompt, from a first frame (and optionally a last one), or from up to 9 reference images. Videos take a few minutes, so you start one and check back.
/v1/videosStart, poll, download
import os, time, requestsAPI = "https://api.zurelay.com/v1"HEADERS = {"Authorization": f"Bearer {os.environ['ZURELAY_API_KEY']}"}# 1. Start the videoresponse = requests.post(f"{API}/videos", headers=HEADERS, json={ "model": "seedance-2.0", "prompt": "A paper boat drifting down a rain-soaked street at night, neon reflections, slow dolly shot", "seconds": 5, "resolution": "720p", "aspect_ratio": "16:9",})response.raise_for_status() # a 4xx says what to fixjob = response.json()# 2. Poll until it's done (usually 2 to 6 minutes)while job["status"] in ("queued", "in_progress"): time.sleep(10) job = requests.get(f"{API}/videos/{job['id']}", headers=HEADERS).json()if job["status"] == "failed": raise SystemExit(job["error"]["message"])# 3. Download the MP4video = requests.get(f"{API}/videos/{job['id']}/content", headers=HEADERS)open("boat.mp4", "wb").write(video.content)Parameters
modelstringrequired- A video model ID.
promptstring- What happens, up to 8,000 characters. Required unless you give a first frame or reference images.
secondsinteger- Length, within the model’s range (see the table). Default 5.
resolutionstring480p,720por1080p, as the model offers. Default 720p.aspect_ratiostring16:9,9:16,1:1,4:3,3:4,21:9, oradaptive(the first frame’s shape; the default when you give one). Otherwise the default is16:9.sizestring- Instead of resolution and ratio: pixels like
1280x720. generate_audioboolean- Sound and speech made with the video. Default
true. (audioworks too.) seedinteger- The same seed and settings give similar results.
first_framestring- An image the video starts on: a link or a data URL.
last_framestring- An image it ends on. Needs a first frame.
reference_imagesarray- Up to 9 images of characters, products, places or a style to use. Not with frames.
Starting from images
First and last frame
Animate a still: the video opens exactly on first_frame. Add last_frame and it lands on that image, so you control both ends of the shot.
{ "model": "seedance-2.0", "first_frame": "https://example.com/storefront-day.jpg", "last_frame": "https://example.com/storefront-night.jpg", "prompt": "Time passes from afternoon to night; lights come on inside the shop.", "seconds": 6, "resolution": "720p"}Reference images
Give up to 9 images and mention them in the prompt by order (@Image1, @Image2…): the people, products and places in them appear in the video.
{ "model": "seedance-2.5", "reference_images": [ "https://example.com/chef.jpg", "https://example.com/kitchen.jpg", "https://example.com/dish.jpg" ], "prompt": "The chef from @Image1 plates the dish from @Image3 in the kitchen from @Image2, close-up, warm light.", "seconds": 8, "resolution": "720p", "aspect_ratio": "9:16"}Rules for images
- PNG, JPEG or WebP, as a public
httpslink or a data URL, up to 10 MB. - 300 to 6000 pixels on each side, and no wider or taller than 5:2. Data URLs outside these are refused up front with a message saying why. Links are read when the video starts: one that isn’t a usable image fails the video with
invalid_image, free of charge. - Frames or reference images, not both in one request. Reference videos and audio aren’t supported.
- Requests are JSON: images go in as links or data URLs, not as multipart uploads.
The video object
{ "id": "video_abc123", "object": "video", "model": "seedance-2.0", "status": "completed", "progress": 100, "created_at": 1790870400, "completed_at": 1790870562, "expires_at": 1793462400, "seconds": 5, "resolution": "720p", "aspect_ratio": "16:9", "size": "1280x720", "generate_audio": true, "url": "https://...signed link...", "url_expires_at": 1790956962, "cost": 1.035, "error": null}Other endpoints
Paying for video
A video costs its price per second (by resolution) times its length. When you start one, its price is set aside from your balance; it’s charged when the video is done, and released if it fails. A failed video is free.
Questions, or something missing? Ask support in your dashboard or email support@zurelay.com.