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

# Seedance 2.0 Video Generation

> Create video generation tasks using Doubao Seedance 2.0 model with text, image, and video references via JSON API

## Overview

Seedance 2.0 (`doubao-seedance-2`) is a video generation model from Doubao that creates videos through text prompts with optional image and video references. Unlike the Sora models which use `multipart/form-data`, Seedance 2.0 uses `application/json` format and accepts image/video URLs directly.

After creation, use the [query interface](/api-reference/video/result) to get the generation status. Once completed, use the [content endpoint](/api-reference/video/content) to download the video.

### Supported Models

* `doubao-seedance-2`

### Important Notes

<Warning>
  **Asynchronous Processing**

  Video generation is asynchronous. After creating a task, a task ID is returned immediately. Use the [query interface](/api-reference/video/result) to check generation progress and results.
</Warning>

<Warning>
  **Content Policy**

  Generated video content must comply with usage policies. Content that is illegal, violent, pornographic, or infringes on copyrights is prohibited.
</Warning>

<Tip>
  **Resource Management**

  Download generated videos promptly to avoid resource expiration. Check the `expires_at` field in the response to know when the video will expire.
</Tip>

***

## Quick Start

### Basic Example: Text-to-Video

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.wisgate.ai/v1/videos" \
    -H "Authorization: Bearer $WISDOM_GATE_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "A cat walking on the street",
      "model": "doubao-seedance-2",
      "duration": 4,
      "size": "1280x720"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.wisgate.ai/v1/videos"
  headers = {
      "Authorization": "Bearer WISDOM_GATE_KEY",
      "Content-Type": "application/json"
  }
  data = {
      "prompt": "A cat walking on the street",
      "model": "doubao-seedance-2",
      "duration": 4,
      "size": "1280x720"
  }

  response = requests.post(url, headers=headers, json=data)
  result = response.json()
  print(f"Video ID: {result['id']}")
  print(f"Status: {result['status']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wisgate.ai/v1/videos", {
    method: "POST",
    headers: {
      Authorization: "Bearer WISDOM_GATE_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "A cat walking on the street",
      model: "doubao-seedance-2",
      duration: 4,
      size: "1280x720",
    }),
  });

  const result = await response.json();
  console.log(`Video ID: ${result.id}`);
  console.log(`Status: ${result.status}`);
  ```
</CodeGroup>

***

## Parameters

### Request Body (JSON)

| Parameter  | Type           | Required | Description                                                                                       |
| ---------- | -------------- | -------- | ------------------------------------------------------------------------------------------------- |
| `prompt`   | string         | Yes      | Text prompt describing the video to generate                                                      |
| `model`    | string         | Yes      | Must be `doubao-seedance-2`                                                                       |
| `duration` | integer        | No       | Video duration in seconds. Range: 4-15. Default: 4                                                |
| `size`     | string         | No       | Output resolution. Options: `1280x720`, `720x1080`, `1920x1080`, `1080x1920`. Default: `1280x720` |
| `mode`     | string         | No       | Generation mode. Options: `i2v` or `r2v`. See [Mode Details](#mode-details)                       |
| `images`   | array\[string] | No       | Array of image URLs to use as references                                                          |
| `videos`   | array\[string] | No       | Array of video URLs to use as references                                                          |

***

## Mode Details

### i2v Mode (Image-to-Video, First/Last Frame)

When `mode` is set to `i2v` and `images` is provided:

* The **first image** in the array is used as the **first frame** (required)
* The **second image** (if provided) is used as the **last frame** (optional)
* The generated video will transition from the first frame to the last frame

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.wisgate.ai/v1/videos" \
    -H "Authorization: Bearer $WISDOM_GATE_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "A smooth transition from day to night in a city skyline",
      "model": "doubao-seedance-2",
      "duration": 6,
      "size": "1280x720",
      "mode": "i2v",
      "images": [
        "https://example.com/first-frame.jpg",
        "https://example.com/last-frame.jpg"
      ]
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.wisgate.ai/v1/videos"
  headers = {
      "Authorization": "Bearer WISDOM_GATE_KEY",
      "Content-Type": "application/json"
  }
  data = {
      "prompt": "A smooth transition from day to night in a city skyline",
      "model": "doubao-seedance-2",
      "duration": 6,
      "size": "1280x720",
      "mode": "i2v",
      "images": [
          "https://example.com/first-frame.jpg",
          "https://example.com/last-frame.jpg"
      ]
  }

  response = requests.post(url, headers=headers, json=data)
  result = response.json()
  print(f"Video ID: {result['id']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wisgate.ai/v1/videos", {
    method: "POST",
    headers: {
      Authorization: "Bearer WISDOM_GATE_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "A smooth transition from day to night in a city skyline",
      model: "doubao-seedance-2",
      duration: 6,
      size: "1280x720",
      mode: "i2v",
      images: [
        "https://example.com/first-frame.jpg",
        "https://example.com/last-frame.jpg",
      ],
    }),
  });

  const result = await response.json();
  console.log(`Video ID: ${result.id}`);
  ```
</CodeGroup>

### r2v Mode (Reference-to-Video)

When `mode` is set to `r2v`, all provided images and videos are used as references to guide the video generation. The model combines the visual information from all references to create the output video.

<Note>
  Each image and video file must be smaller than **4MB**.
</Note>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.wisgate.ai/v1/videos" \
    -H "Authorization: Bearer $WISDOM_GATE_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "Referring to Figures 1 to 2, design a fade-in and fade-out animation with smooth line flow and flowing light and shadow in the background.",
      "model": "doubao-seedance-2",
      "duration": 4,
      "size": "1280x720",
      "mode": "r2v",
      "images": [
        "https://example.com/reference1.jpg",
        "https://example.com/reference2.jpg"
      ],
      "videos": [
        "https://example.com/reference-video.mp4"
      ]
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.wisgate.ai/v1/videos"
  headers = {
      "Authorization": "Bearer WISDOM_GATE_KEY",
      "Content-Type": "application/json"
  }
  data = {
      "prompt": "Referring to Figures 1 to 2, design a fade-in and fade-out animation with smooth line flow and flowing light and shadow in the background.",
      "model": "doubao-seedance-2",
      "duration": 4,
      "size": "1280x720",
      "mode": "r2v",
      "images": [
          "https://example.com/reference1.jpg",
          "https://example.com/reference2.jpg"
      ],
      "videos": [
          "https://example.com/reference-video.mp4"
      ]
  }

  response = requests.post(url, headers=headers, json=data)
  result = response.json()
  print(f"Video ID: {result['id']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wisgate.ai/v1/videos", {
    method: "POST",
    headers: {
      Authorization: "Bearer WISDOM_GATE_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt:
        "Referring to Figures 1 to 2, design a fade-in and fade-out animation with smooth line flow and flowing light and shadow in the background.",
      model: "doubao-seedance-2",
      duration: 4,
      size: "1280x720",
      mode: "r2v",
      images: [
        "https://example.com/reference1.jpg",
        "https://example.com/reference2.jpg",
      ],
      videos: ["https://example.com/reference-video.mp4"],
    }),
  });

  const result = await response.json();
  console.log(`Video ID: ${result.id}`);
  ```
</CodeGroup>

***

## Complete Workflow

### Step 1: Create Video Task

```python theme={null}
import requests

url = "https://api.wisgate.ai/v1/videos"
headers = {
    "Authorization": "Bearer WISDOM_GATE_KEY",
    "Content-Type": "application/json"
}
data = {
    "prompt": "A cat walking on the street",
    "model": "doubao-seedance-2",
    "duration": 5,
    "size": "1280x720"
}

response = requests.post(url, headers=headers, json=data)
result = response.json()
video_id = result["id"]
print(f"Created video task: {video_id}")
```

### Step 2: Poll for Status & Download

Use the [query interface](/api-reference/video/result) with the returned `id`. When status is `completed`, the video download URL is available in `meta_data.url`:

```python theme={null}
import time

status_url = f"https://api.wisgate.ai/v1/videos/{video_id}"

while True:
    response = requests.get(status_url, headers={"Authorization": "Bearer WISDOM_GATE_KEY"})
    result = response.json()
    status = result["status"]
    progress = result.get("progress", 0)
    print(f"Status: {status}, Progress: {progress}%")

    if status == "completed":
        video_url = result["meta_data"]["url"]
        print(f"Video URL: {video_url}")

        # Download the video
        video_response = requests.get(video_url, stream=True)
        with open("generated_video.mp4", "wb") as f:
            for chunk in video_response.iter_content(chunk_size=8192):
                f.write(chunk)
        print("Video downloaded successfully!")
        break
    elif status == "failed":
        print(f"Error: {result.get('error')}")
        break

    time.sleep(10)
```

***

## Supported Resolutions

| Size        | Orientation | Description           |
| ----------- | ----------- | --------------------- |
| `1280x720`  | Landscape   | Standard HD (default) |
| `720x1080`  | Portrait    | Vertical format       |
| `1920x1080` | Landscape   | Full HD               |
| `1080x1920` | Portrait    | Vertical Full HD      |

***

## Best Practices

### 1. Prompt Optimization

Use specific, detailed descriptions including scene, action, and style:

**Good prompt:**

```
A cinematic aerial shot of golden wheat fields swaying in the wind at sunset, with warm light casting long shadows, 4K quality
```

**Poor prompt:**

```
wheat field
```

### 2. Duration Selection

Choose appropriate duration based on content complexity:

* **4-6 seconds**: Best for simple scenes, fastest generation
* **7-10 seconds**: Good for moderate complexity scenes
* **11-15 seconds**: For complex scenes with multiple elements

### 3. Reference Quality

When using images or videos as references:

* Ensure URLs are publicly accessible
* Keep each file under 4MB
* Use high-quality, clear references for best results
* In `i2v` mode, ensure the first and last frame images are consistent in style and resolution

### 4. Mode Selection

* Use **i2v** when you want precise control over the starting (and optionally ending) frame of the video
* Use **r2v** when you want the model to use multiple references as style/content guidance

***

## FAQ

### How is Seedance 2.0 different from Sora models?

Seedance 2.0 uses `application/json` format and accepts image/video URLs directly, while Sora models use `multipart/form-data` with file uploads. Seedance 2.0 also supports unique features like first/last frame control (`i2v` mode) and multi-reference generation (`r2v` mode).

### What file size limits apply to references?

Each image and video used as reference must be smaller than **4MB**.

### How many images/videos can I provide?

In `i2v` mode, you can provide up to 2 images (first frame required, last frame optional). In `r2v` mode, you can provide multiple images and videos as references.

### Can I use Seedance 2.0 without any images or videos?

Yes. If no `mode`, `images`, or `videos` are provided, the model generates video from the text prompt only (text-to-video).

***
