> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ninjachat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Video generation

> Veo, Gemini Omni Flash, Kling, and Seedance behind one endpoint. Submit, poll, get an MP4.

<div className="ndoc-brand-strip"><span className="ndoc-brand"><span className="ndoc-brand-mark"><img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/263e7dab/gemini.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Veo</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark"><img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/263e7dab/gemini.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Gemini Omni</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark"><img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/a4857841/kuaishou.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Kling</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark"><img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/86e0e433/bytedance.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Seedance</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark"><img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/thirdparty/logos/providers/dba34592/runway.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Runway</span></span></div>

<div className="ndoc-video-showcase">
  <video controls playsInline preload="none" poster="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/mcp/b7a461f7/kiyo-volcanic-poster.webp" aria-label="Play a cinematic product video created with NinjaChat">
    <source src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/mcp/ed15ef2e/kiyo-volcanic.mp4" type="video/mp4" />
  </video>
</div>

Video is **async**: submit a job, then poll its status — or register a signed webhook in [Developers → Webhooks](https://www.ninjachat.ai/developers/webhooks) and skip the loop. Either way you get an MP4 URL in one to a few minutes.

```mermaid theme={null}
flowchart LR
    A["POST /api/v1/videos"] --> B["video id"]
    B --> C{"GET /videos/{id}<br/>every 5s — free"}
    C -->|processing| C
    C -->|completed| D["video_url (MP4)"]
    C -->|failed| E["Auto-refund"]
```

## Create a video

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  import { NinjaChat } from "@ninjachat/sdk";

  const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
  const job = await client.videos.generate({
    model: "veo-3.1-fast",
    prompt: "A timelapse of a flower blooming, macro lens, soft lighting",
    duration: 6,
    aspect_ratio: "16:9",
  });

  const video = await client.videos.waitFor(job.id);
  console.log(video.video_url);
  ```

  ```python Python SDK theme={null}
  import os
  from ninjachat import NinjaChat

  client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
  job = client.videos.generate(
      model="veo-3.1-fast",
      prompt="A timelapse of a flower blooming, macro lens, soft lighting",
      duration=6,
      aspect_ratio="16:9",
  )

  video = client.videos.wait_for(job["id"])
  print(video["video_url"])
  ```
</CodeGroup>

## Parameters

| Parameter          | Default        | Description                                                                                                                                                     |
| ------------------ | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`           | required       | Camera movement + subject action + style + lighting. Max 4,000 chars.                                                                                           |
| `model`            | `veo-3.1-fast` | Choose from the [model catalog](/models-overview#video-models).                                                                                                 |
| `duration`         | `8`            | Integer seconds. Most models accept 4–15; `gemini-omni-flash` renders 3–10 and bills a 3-second clip as three seconds. Supported durations depend on the model. |
| `aspect_ratio`     | `16:9`         | `16:9` or `9:16`; `1:1` is also supported by Seedance 2 variants and Grok Imagine Video.                                                                        |
| `image_url`        | —              | Public HTTPS image URL to animate.                                                                                                                              |
| `end_image_url`    | —              | Public HTTPS still to end on, for models that support first-and-last-frame generation.                                                                          |
| `reference_images` | —              | Up to 4 public HTTPS image URLs to guide subject/style (Seedance 2 and 2.5).                                                                                    |
| `reference_video`  | —              | Public HTTPS video URL to guide motion/POV framing (Seedance 2 and 2.5). On `seedance-2.5` this shape has its own, higher flat price — see [Pricing](/pricing). |
| `reference_audio`  | —              | Public HTTPS audio URL to use as background music (Seedance 2 and 2.5).                                                                                         |
| `generate_audio`   | `false`        | Generate an audio track for the video (Seedance 2, Seedance 2.5 and Kling 2.6). `gemini-omni-flash` always renders sound.                                       |
| `negative_prompt`  | —              | Describe what to avoid (`kling-video` only).                                                                                                                    |
| `watermark`        | `false`        | Overlay a watermark on the output (Seedance 2 and 2.5).                                                                                                         |

Polling `GET /videos/{id}` is free. Status moves `queued` → `processing` (with `progress`) → `completed` (with `video_url`) or `failed` (auto-refunded).

## Edit or extend a finished clip

Clips made with `gemini-omni-flash` stay revisable. Send the finished clip's `id` back as `video_id` and describe the change in `prompt`; the clip's length and everything you do not mention stay the same. Add `task: "extend"` with a `duration` of 3–10 to append new footage instead — you get the whole lengthened clip back, up to 40 seconds. `model` can be left out; a revision always runs on the model that made the clip.

<CodeGroup>
  ```bash Edit theme={null}
  curl https://www.ninjachat.ai/api/v1/videos \
    -H "Authorization: Bearer $NINJACHAT_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"video_id":"vid_…","prompt":"Make the paper boat bright blue"}'
  ```

  ```bash Extend theme={null}
  curl https://www.ninjachat.ai/api/v1/videos \
    -H "Authorization: Bearer $NINJACHAT_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"video_id":"vid_…","task":"extend","duration":4,"prompt":"The boat drifts under a footbridge"}'
  ```
</CodeGroup>

Revisions have their own flat price on the [rate sheet](/pricing): the source clip is carried as context on top of the seconds rendered. Poll the new job exactly like a fresh generation.

## Which model?

<div className="ndoc-model-grid">
  <a className="ndoc-model-link" href="/api-reference/models/video/veo-3-1-fast"><span className="ndoc-brand-mark">  <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/263e7dab/gemini.svg" alt="" width="28" height="28" loading="lazy" /></span><span><strong>Veo 3.1 Fast</strong><small>Google</small></span><span aria-hidden="true">↗</span></a>
  <a className="ndoc-model-link" href="/api-reference/models/video/gemini-omni-flash"><span className="ndoc-brand-mark">  <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/263e7dab/gemini.svg" alt="" width="28" height="28" loading="lazy" /></span><span><strong>Gemini Omni Flash</strong><small>Google</small></span><span aria-hidden="true">↗</span></a>
  <a className="ndoc-model-link" href="/api-reference/models/video/veo-3-1"><span className="ndoc-brand-mark">  <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/263e7dab/gemini.svg" alt="" width="28" height="28" loading="lazy" /></span><span><strong>Veo 3.1</strong><small>Google</small></span><span aria-hidden="true">↗</span></a>
  <a className="ndoc-model-link" href="/api-reference/models/video/kling-video"><span className="ndoc-brand-mark">  <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/a4857841/kuaishou.svg" alt="" width="28" height="28" loading="lazy" /></span><span><strong>Kling 2.6 Pro</strong><small>Kuaishou</small></span><span aria-hidden="true">↗</span></a>
  <a className="ndoc-model-link" href="/api-reference/models/video/seedance-2"><span className="ndoc-brand-mark">  <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/86e0e433/bytedance.svg" alt="" width="28" height="28" loading="lazy" /></span><span><strong>Seedance 2.0</strong><small>ByteDance</small></span><span aria-hidden="true">↗</span></a>
  <a className="ndoc-model-link" href="/api-reference/models/video/seedance-2-5"><span className="ndoc-brand-mark">  <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/86e0e433/bytedance.svg" alt="" width="28" height="28" loading="lazy" /></span><span><strong>Seedance 2.5</strong><small>ByteDance</small></span><span aria-hidden="true">↗</span></a>
</div>

[Explore all video models and pricing →](/models-overview#video-models)

## Prompting for motion

| Weak        | Strong                                                                                                               |
| ----------- | -------------------------------------------------------------------------------------------------------------------- |
| `mountains` | `Drone shot slowly ascending over a misty mountain valley at golden hour, camera reveals a river below, cinematic`   |
| `ocean`     | `Underwater camera glides through a coral reef, bioluminescent creatures pulse with light, slow motion, documentary` |

The formula: **camera movement + subject action + style + lighting**.

<Tip>
  Agents can run this whole flow conversationally — "animate the second one" — via the [MCP server](/mcp/tools).
</Tip>
