Video Generation
Video Generation
Generate cinematic AI videos from text prompts — or from reference images — using models like Sora 2, Veo 3.1, Kling V3, Seedance 2.0, and many more. All generation is asynchronous: submit a job, then poll for the result.
Video generation is async. Unlike images, video generation is not transparent: you will receive a
task_id immediately and must poll GET /v1/videos/tasks/{task_id} until status is completed. Generation typically takes 30 seconds to 5 minutes depending on the model and duration.Endpoints
POST
https://api.belugapi.com/v1/videos/generations
Async
Submit a video generation job. Returns a task_id immediately.
GET
https://api.belugapi.com/v1/videos/tasks/{task_id}
Poll task status. When status === "completed", the response includes a video URL.
Request parameters — POST /v1/videos/generations
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | required | Video model ID — see table below. |
| prompt | string | required | Text description of the video to generate. |
| duration | integer | optional | Duration in seconds (model-dependent; e.g. 5 or 10). |
| resolution | string | optional | 720p or 1080p (model-dependent). |
| aspect_ratio | string | optional | 16:9, 9:16, 1:1, etc. |
| audio | boolean | optional | Include synchronized audio (model-dependent). Default: false. |
| image_url | string | optional | Reference image URL for image-to-video models. |
Step 1 — Submit the job
import requests response = requests.post( "https://api.belugapi.com/v1/videos/generations", headers={ "Authorization": "Bearer bapi_your_key_here", "Content-Type": "application/json", }, json={ "model": "sora-2-preview", "prompt": "A cinematic shot of a beluga whale leaping out of arctic water at golden hour", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "audio": True, } ) task_id = response.json()["task_id"] print("Task submitted:", task_id)
const res = await fetch("https://api.belugapi.com/v1/videos/generations", { method: "POST", headers: { "Authorization": "Bearer bapi_your_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ model: "sora-2-preview", prompt: "A cinematic shot of a beluga whale leaping out of arctic water at golden hour", duration: 5, resolution: "1080p", aspect_ratio: "16:9", audio: true, }), }); const { task_id } = await res.json(); console.log("Task submitted:", task_id);
curl https://api.belugapi.com/v1/videos/generations \ -H "Authorization: Bearer bapi_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "model": "sora-2-preview", "prompt": "A cinematic shot of a beluga whale leaping out of arctic water at golden hour", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "audio": true }'
Submit response
{
"task_id": "vtask_abc123xyz",
"status": "pending"
}
Step 2 — Poll until complete
Keep polling GET /v1/videos/tasks/{task_id} until status is completed or failed.
import time, requests headers = {"Authorization": "Bearer bapi_your_key_here"} while True: poll = requests.get( f"https://api.belugapi.com/v1/videos/tasks/{task_id}", headers=headers, ) data = poll.json() status = data.get("status") if status == "completed": video_url = data["result"]["video_url"] print("Done!", video_url) break elif status == "failed": print("Failed:", data.get("error")) break else: print(f"Status: {status} — waiting 5s…") time.sleep(5)
const wait = (ms) => new Promise(r => setTimeout(r, ms)); while (true) { const poll = await fetch(`https://api.belugapi.com/v1/videos/tasks/${task_id}`, { headers: { "Authorization": "Bearer bapi_your_key_here" }, }); const data = await poll.json(); if (data.status === "completed") { console.log("Done!", data.result?.video_url); break; } else if (data.status === "failed") { console.error("Failed:", data.error); break; } console.log(`Status: ${data.status} — waiting 5s…`); await wait(5000); }
# Poll the task (repeat until status=completed) curl https://api.belugapi.com/v1/videos/tasks/vtask_abc123xyz \ -H "Authorization: Bearer bapi_your_key_here"
Completed task response
{
"task_id": "vtask_abc123xyz",
"status": "completed",
"result": {
"video_url": "https://cdn.example.com/videos/output-abc123.mp4",
"duration_seconds": 5
}
}
Task statuses
| Status | Meaning |
|---|---|
| pending | Job is queued, not yet started. |
| processing | Video is being generated. |
| completed | Done — check result.video_url. |
| failed | Generation failed — check error field. |
| cancelled | Job was cancelled. |
Veo 3.1 (Google)
response = requests.post( "https://api.belugapi.com/v1/videos/generations", headers={"Authorization": "Bearer bapi_your_key_here", "Content-Type": "application/json"}, json={ "model": "veo-3-1", "prompt": "Timelapse of a flower blooming in a sun-lit meadow, cinematic 4K", "duration": 8, "resolution": "4K", } )
curl https://api.belugapi.com/v1/videos/generations \ -H "Authorization: Bearer bapi_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "model": "veo-3-1", "prompt": "Timelapse of a flower blooming in a sun-lit meadow, cinematic 4K", "duration": 8, "resolution": "4K" }'
Kling V3 (Kuaishou)
response = requests.post( "https://api.belugapi.com/v1/videos/generations", headers={"Authorization": "Bearer bapi_your_key_here", "Content-Type": "application/json"}, json={ "model": "kling-v3", "prompt": "A drone shot flying over a snow-capped mountain range at sunrise", "duration": 10, "resolution": "1080p", "aspect_ratio": "16:9", } )
curl https://api.belugapi.com/v1/videos/generations \ -H "Authorization: Bearer bapi_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-v3", "prompt": "A drone shot flying over a snow-capped mountain range at sunrise", "duration": 10, "resolution": "1080p", "aspect_ratio": "16:9" }'
Seedance 2.0 (ByteDance)
response = requests.post( "https://api.belugapi.com/v1/videos/generations", headers={"Authorization": "Bearer bapi_your_key_here", "Content-Type": "application/json"}, json={ "model": "doubao-seedance-2.0", "prompt": "A chef preparing sushi in a minimalist Japanese kitchen, slow motion", "duration": 10, } )
curl https://api.belugapi.com/v1/videos/generations \ -H "Authorization: Bearer bapi_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.0", "prompt": "A chef preparing sushi in a minimalist Japanese kitchen, slow motion", "duration": 10 }'
Wan 2.7 (Alibaba)
response = requests.post( "https://api.belugapi.com/v1/videos/generations", headers={"Authorization": "Bearer bapi_your_key_here", "Content-Type": "application/json"}, json={ "model": "wan2.7", "prompt": "Neon-lit cyberpunk street market in a futuristic city, raining", "duration": 15, "resolution": "1080p", "aspect_ratio": "16:9", } )
curl https://api.belugapi.com/v1/videos/generations \ -H "Authorization: Bearer bapi_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7", "prompt": "Neon-lit cyberpunk street market in a futuristic city, raining", "duration": 15, "resolution": "1080p", "aspect_ratio": "16:9" }'
Available video models
| Model ID | Name | Provider | Max duration | Resolutions |
|---|---|---|---|---|
sora-2-preview |
Sora 2 | OpenAI | 25 seconds | 720p, 1080p |
sora-2-vip |
Sora 2 Pro | OpenAI | 25 seconds | 720p, 1080p |
veo3.1-lite |
Veo 3.1 Lite | 8 seconds | 720p, 1080p, 4k | |
veo3.1-fast |
Veo 3.1 Fast | 8 seconds | 720p, 1080p, 4k | |
veo3.1-quality |
Veo 3.1 Quality | 8 seconds | 720p, 1080p, 4k | |
veo-3-1 |
Veo 3.1 | 8+ seconds | 720p, 1080p, 4K | |
kling-v3 |
Kling V3 | Kuaishou | 10-15 seconds | 720p, 1080p |
kling-v3-omni |
Kling V3 Omni | Kuaishou | 10-15 seconds | 720p, 1080p |
kling-video-o1 |
Kling Video O1 | Kuaishou | 10-15 seconds | 720p, 1080p |
minimax-hailuo-2.3 |
MiniMax Hailuo 2.3 | MiniMax | 6-10 seconds | 720p, 1080p |
minimax-hailuo-2.3-fast |
MiniMax Hailuo 2.3 Fast | MiniMax | 6 seconds | 720p |
viduq3-mix |
Vidu Q3 Mix | Vidu | 16 seconds | 720p, 1080p |
viduq3 |
Vidu Q3 | Vidu | 16 seconds | 720p, 1080p |
viduq3-turbo |
Vidu Q3 Turbo | Vidu | 8 seconds | 720p |
viduq3-pro |
Vidu Q3 Pro | Vidu | 16 seconds | 1080p |
wan2.7 |
Wan 2.7 | Alibaba | 15 seconds | 720p, 1080p |
wan2.7-r2v |
Wan 2.7 R2V | Alibaba | 15 seconds | 720p, 1080p |
wan2.7-videoedit |
Wan 2.7 Video Edit | Alibaba | 2-10 seconds | 1080p |
wan2.6-i2v |
Wan 2.6 I2V | Alibaba | 15 seconds | 1080p |
wan2.5-preview |
Wan 2.5 | Alibaba | 10 seconds | 1080p |
happyhorse-1.0 |
HappyHorse 1.0 | Alibaba | 3-15 seconds | 720P, 1080P |
skyreels-v4-fast |
SkyReels V4 Fast | Skywork | 15 seconds | 1080p |
skyreels-v4-std |
SkyReels V4 Standard | Skywork | 15 seconds | 1080p |
doubao-seedance-2.0 |
Seedance 2.0 | ByteDance | 10 seconds | 720p, 1080p |
doubao-seedance-2.0-fast |
Seedance 2.0 Fast | ByteDance | 10 seconds | 480p, 720p |
doubao-seedance-2.0-face |
Seedance 2.0 Face | ByteDance | 10 seconds | 720p, 1080p |
doubao-seedance-2.0-fast-face |
Seedance 2.0 Fast Face | ByteDance | 10 seconds | 720p |