Video
Video generation
Make videos with Seedance, Omni, Kling, Wan, Veo, Grok, Muse, Vidu, HappyHorse, PixVerse and MiniMax from a prompt, from a first frame (and optionally a last one), or from reference images, videos and audio. 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)Every video model works the same way: change model and the request stays the same. The model guides cover what each one is best at: Seedance, Kling, Wan, Grok Imagine, Omni Flash, MiniMax H3, Veo, Vidu, PixVerse, Muse Video and HappyHorse.
callback_url and the finished video is POSTed to your server, signed, the moment it’s ready. See Callbacks.Parameters
modelstringrequired- A video model ID.
promptstring- What happens, up to 8,000 characters (Kling reads up to 2,500, Vidu reads up to 2,000, HappyHorse reads up to 5,000, PixVerse reads up to 2,048, MiniMax reads up to 7,000). Required unless you give a first frame or reference images.
negative_promptstring- What to keep out of the video, up to 2,500 characters. Kling and PixVerse read it; other models refuse it.
secondsinteger- Length in whole seconds, within the model’s range (see the table). Default 5, or the nearest length the model makes.
resolutionstring- Such as
480p,720p,1080p,2kor4k: each model’s are in the table. Default 720p, or the model’s lowest. 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. Omni, Veo and Muse make 16:9 and 9:16; Kling makes 16:9, 9:16, 1:1 and 21:9; Kling makes 16:9, 9:16 and 1:1; Grok, Vidu, HappyHorse and PixVerse make 16:9, 9:16, 1:1, 4:3 and 3:4.sizestring- Instead of resolution and ratio: pixels like
1280x720. generate_audioboolean- Sound and speech made with the video. Default
true. (audioworks too.) Kling and PixVerse cost less without sound. seedinteger- The same seed and settings give similar results. Kling, Veo, Grok and Muse have no seed and ignore it.
first_framestring- An image the video starts on: a link or a data URL. MiniMax takes none: give the image in reference_images. Muse takes no images at all.
last_framestring- An image it ends on. Needs a first frame. Seedance, Omni, Kling, Wan, Vidu and PixVerse take one.
reference_imagesarray- Images of characters, products, places or a style to use: Seedance up to 9, Omni up to 10, Kling up to 10, Wan up to 10, Grok up to 3, HappyHorse up to 9, MiniMax up to 9; Veo, Muse, Vidu and PixVerse take none. Not with frames.
reference_videosarray- Videos whose look, motion or camera work to use, or a video to edit or extend: MP4 or MOV, as links or data URLs, mentioned in the prompt as
@Video1,@Video2and so on. Seedance 2.5, Seedance 2.0, Gemini Omni 1.2 Flash, Gemini Omni Flash and MiniMax H3 only. Their seconds are billed at part of a second’s price, or not at all on some models; see Reference videos and audio. reference_audioarray- Voice, music or sound to use: MP3 or WAV, as links or data URLs, mentioned as
@Audio1and so on. Seedance 2.5, Seedance 2.0 and MiniMax H3 only, at no extra charge. reference_modestring- With reference videos:
editone,extendone, or make a new video from the references (reference). Defaultauto: the model goes by the prompt. Seedance 2.5 only. callback_urlstring- An https URL to send the finished (or failed) video to, instead of polling. See Callbacks.
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. MiniMax starts from reference images instead. Muse makes video from text only.
{ "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 10 images (Seedance up to 9, Omni up to 10, Kling up to 10, Wan up to 10, Grok up to 3, HappyHorse up to 9, MiniMax up to 9; Veo, Muse, Vidu and PixVerse take none) 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"}Reference videos and audio
Give videos to borrow a person’s look and moves, a camera move or a scene, and audio for a voice, a tune or sound effects. Mention them in the prompt by order, as with images: @Video1, @Audio1. They mix with reference images, but not with a first frame.
{ "model": "seedance-2.5", "reference_images": ["https://example.com/singer.jpg"], "reference_videos": ["https://example.com/dance-moves.mp4"], "reference_audio": ["https://example.com/chorus.mp3"], "prompt": "The singer from @Image1 performs the dance from @Video1 on a rooftop at dusk, singing to @Audio1.", "seconds": 8, "resolution": "720p"}The model reads every second of a reference video, so those seconds are billed too, at part of a second’s price: a 5 s video with a 10 s reference costs its 5 seconds plus 10 reference seconds. Reference audio costs nothing more. Each video object shows the reference seconds billed (reference_seconds).
Editing and extending a video
Set reference_mode to edit to change a reference video (swap a person or object, add or remove something, change the music), or to extend to continue it forward or back. Say what to do in the prompt: “Replace the car in @Video1 with the one in @Image1”, “Continue @Video1 as the dancer leaves the stage”.
- An edit keeps the video’s shape and length, so leave out
aspect_ratioandseconds. It’s priced as long as the longest reference video, which must run 4 to 30 seconds. - An extension keeps the video’s shape;
secondssets how long the new video runs. - Without
reference_modethe model decides from the prompt, and a prompt that reads as an edit withsecondsoraspect_ratioset can fail (failed videos are free).
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 references, not both in one request.
- 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; Kling and PixVerse cost less per second without sound; reference videos add their seconds at part of that price. 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 our support team and we’ll answer by email, usually within a minute.