Video Generation

Video generation is async. Poll the prediction endpoint until status is success. Videos take 30–120 seconds.

POST https://api.nova.ai/api/v1/model/generatenvideo

Parameters

modelstringrequired

Video model ID, e.g. "kuaishou/kling-16"

promptstringrequired

Text description of the video to generate.

durationinteger

Video length in seconds. Supported values depend on model (5 or 10).

image_urlstring

Starting frame for image-to-video generation.

python
import requests, time

headers = {"Authorization": "Bearer nova-YOUR_API_KEY"}

resp = requests.post(
    "https://api.nova.ai/api/v1/model/generatenvideo",
    headers=headers,
    json={
        "model": "kuaishou/kling-16",
        "prompt": "A camera slowly panning across a misty mountain valley at dawn",
        "duration": 5,
    }
)
prediction_id = resp.json()["id"]

while True:
    result = requests.get(
        f"https://api.nova.ai/api/v1/model/prediction/{prediction_id}",
        headers=headers,
    ).json()
    if result["status"] == "success":
        print(result["results"][0]["data"][0]["outputs"][0]["url"])
        break
    time.sleep(5)