How to Build AI Video Generation Into Your API Pipeline

Watermark notice — Every image model on NovAI is served by a Chinese provider (Zhipu AI, ByteDance, Tencent) and burns a visible AI-generated label such as AI生成 into the corner of the output under China’s labelling rules — NovAI cannot switch it off. Video output varies by model: in our 4 August 2026 tests Seedance 2.0 and CogVideoX-Flash showed no visible label, while Hunyuan Video 1.5 is labelled. Text and chat models are not affected. Which models, and what it rules out →

From async task submission to webhook delivery: a practical developer guide with real code.

Why Video Needs a Different Pipeline

Chat completions return in milliseconds. Image generation returns in seconds. Video generation takes 30 seconds to several minutes. Your pipeline needs async task management -- not simple request-response.

The Three-Stage Pipeline

  1. Task Submission -- Submit prompt + references, get task ID
  2. Status Monitoring -- Poll or webhook for pending -> running -> completed
  3. Result Retrieval -- Download the generated video file

Step 1: Submit a Task

import requests
r = requests.post("https://api.aiapi-pro.com/v1/video/generations",
  headers={"Authorization": "Bearer " + KEY},
  json={"model":"doubao-seedance-2.0","prompt":"Sunset drone shot",
        "resolution":"1080p","duration":8})
task_id = r.json()["id"]  # "cgt-20260714183705-5wkf5"

Step 2: Poll or Webhook

import time
while True:
    r = requests.get(f"https://api.aiapi-pro.com/v1/video/generations/{task_id}",
                     headers={"Authorization": "Bearer " + KEY})
    data = r.json()
    if data["status"] in ("completed","failed"): break
    print(f"Progress: {data.get('progress','processing')}")
    time.sleep(5)
if data["status"]=="completed": print(f"Video: {data['video_url']}")

Multi-Modal: Beyond Text Prompts

Seedance 2.0 accepts reference images, videos, and audio in one call for brand-consistent content:

{"model":"doubao-seedance-2.0",
 "content":[
   {"type":"text","text":"First-person fruit tea commercial"},
   {"type":"image_url","image_url":{"url":"https://cdn.example.com/product.jpg"},"role":"reference_image"},
   {"type":"audio_url","audio_url":{"url":"https://cdn.example.com/bgm.mp3"},"role":"reference_audio"}
 ],"resolution":"1080p","duration":10}

Cost Management Tips

Frequently Asked Questions

How do I integrate AI video generation into my API?

Use async task submission: POST to /v1/video/generations with your prompt and parameters, then poll the task status endpoint or set up a webhook for completion notification. NovAI provides OpenAI-compatible endpoints for Seedance 2.0.

How long does AI video generation take?

A 10-second 1080p video typically takes 30-60 seconds to generate via Seedance 2.0. The API returns a task ID immediately, and you poll for status until completion.

Can I use webhooks for AI video generation?

Yes, NovAI supports webhook delivery for video generation tasks. When the video is ready, NovAI sends a POST request to your callback URL with the video URL and metadata.

Related Articles

Related Articles

Start Building with NovAI

20 Chinese AI models -- Chat, Image Gen, Video Gen -- one API, $2 free credit.

Get Free $2Browse Models