Skip to main content
Which video model? Start with veo-3.1-fast (3.00,goodbalance).Userunwaygen4.5(3.00, good balance). Use `runway-gen4.5` (5.00) or veo-3.1 (5.00)forhighestquality.Useseedance2(5.00) for highest quality. Use `seedance-2` (3.00) for the longest clips (up to 15s). Compare all →
Video generation is async: submit a job → poll for status → get an MP4 URL.

Complete example (copy, paste, run)

import os, time, requests

API = "https://ninjachat.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['NINJACHAT_API_KEY']}"}

# 1. Submit
r = requests.post(f"{API}/api/v1/video", headers=HEADERS, json={
    "model": "google-veo-2",
    "prompt": "A timelapse of a flower blooming, macro lens, soft lighting",
    "duration": 5,
    "aspect_ratio": "16:9"
})
r.raise_for_status()
job = r.json()
request_id = job["request_id"]
print(f"Submitted: {request_id} (cost: {job['cost']['this_request']})")

# 2. Poll every 10 seconds
while True:
    s = requests.get(f"{API}/api/v1/video/status",
        headers=HEADERS, params={"request_id": request_id}).json()

    if s["status"] == "completed":
        print(f"Done! {s['result']['video_url']}")
        break
    if s["status"] == "failed":
        print(f"Failed: {s.get('error')} (you were NOT charged)")
        break

    print(f"  {s.get('progress', 0)}%...")
    time.sleep(10)
Not ready to write code? Try this in the API Playground →

Submit a request

POST https://ninjachat.ai/api/v1/video
ParameterTypeRequiredDefaultDescription
promptstringYesDescribe the video. Include camera movement, action, style. Max 4,000 chars.
modelstringNoseedance-2Model ID. See table below.
durationintegerNo8Length in seconds. Range depends on model.
aspect_ratiostringNo16:916:9 or 9:16. Ignored by Seedance 2.
image_urlstringNoAnimate this image. Must be public HTTPS URL.

Submit response example

{
  "request_id": "gemini:abc123def456",
  "model": "google-veo-2",
  "cost": { "this_request": "$3.00" },
  "balance": "$37.00"
}

Poll for status

GET https://ninjachat.ai/api/v1/video/status?request_id={request_id}
Polling is free — no credits, no rate limit.

Status: processing

{ "status": "processing", "progress": 45 }

Status: completed

{
  "status": "completed",
  "result": { "video_url": "https://cdn.ninjachat.ai/videos/abc123.mp4" }
}

Status: failed

{ "status": "failed", "error": "Video generation failed" }
Failed jobs are not charged — credits refunded automatically.

Available models

ModelIDDurationSpeedBest for
Seedance 2seedance-25–15s~1-2 minUnrestricted content, longest clips
Kling Videokling-video5–10s~3-4 minMotion quality, coherence
Google Veo 2google-veo-25–8s~40s$3.00 — Fastest + high quality
Veo 3.1veo-3.14, 6, 8s~3-5 min$5.00 — Best quality
Veo 3.1 Fastveo-3.1-fast4, 6, 8s~1-2 min$3.00 — Speed-optimized
Veo 3 Fastgoogle-veo-3-fast4, 6, 8s~1-2 min$3.00 — Budget Veo
Runway Gen-4.5runway-gen4.55 or 10s~1-3 min$5.00 — Runway flagship, cinematic
Runway Gen-4 Turborunway-gen4-turbo5 or 10s~30-60s$3.00 — Fast image-to-video (requires image_url)

Duration limits

ModelAllowed
seedance-25 to 15 (any integer)
kling-video5 to 10 (any integer)
google-veo-25, 6, or 8
veo-3.14, 6, or 8 only
veo-3.1-fast4, 6, or 8 only
google-veo-3-fast4, 6, or 8 only
runway-gen4.55 or 10 only
runway-gen4-turbo5 or 10 only

Image-to-video

Animate a still image:
r = requests.post(f"{API}/api/v1/video", headers=HEADERS, json={
    "model": "veo-3.1",
    "prompt": "Camera slowly pulls back, clouds drift across the sky",
    "duration": 6,
    "image_url": "https://example.com/landscape.jpg"
})
# Then poll as shown above

Prompt writing tips

WeakStrong
mountainsDrone shot slowly ascending over a misty mountain valley at golden hour, camera reveals a river below, cinematic
oceanUnderwater camera glides through a coral reef, bioluminescent creatures pulse with light, slow motion, nature documentary
Include: camera movement + subject action + style + lighting