Video Generation

Text-to-Video

Generate a short AI video from a text prompt. Specify resolution, aspect ratio, duration, and whether to synthesise audio.

Video generation is asynchronous. The API returns a video URL once rendering is complete. Typical generation time is 30–120 seconds depending on resolution and duration.

Python

python
import requests

BASE_URL = "https://api.oneinfer.ai"
token = requests.post(
    f"{BASE_URL}/v1/ula/oauth-authentication?api_key=YOUR_API_KEY"
).json()["access_token"]

response = requests.post(
    f"{BASE_URL}/v1/ula/generate-video",
    headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
    json={
        "model": "wan2.1-t2v-turbo",
        "prompt": "A time-lapse of clouds over a mountain range, cinematic, 4K",
        "resolution": "720p",
        "aspect_ratio": "landscape",
        "duration": 5,
        "generate_audio": False,
        "camera_fixed": False,
        "service_tier": "default",
    },
    timeout=180,
)

data = response.json()["data"]
print("Video URL:", data["videos"][0]["url"])