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

# Video generation (Seedance)

> POST /seedance/v1/videos/generations — Seedance-standard video generation

Generate video with Seedance models, compatible with the [seevio.ai](https://seevio.ai/api-docs) standard API. It uses an **asynchronous task** flow: submit to get a task ID, poll until done, then download the video.

## Submit a task

```bash theme={null}
curl https://openp.ai/seedance/v1/videos/generations \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2-0-fast",
    "input": {
      "prompt": "A golden retriever running on a beach at sunset, cinematic",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "720p"
    }
  }'
```

### Parameters

| Field   | Type   | Required | Description                         |
| ------- | ------ | :------: | ----------------------------------- |
| `model` | string |     ✅    | See the model list below            |
| `input` | object |     ✅    | Generation parameters, fields below |

### input fields

| Field             | Type    |   Required  | Description                                                                                                        |
| ----------------- | ------- | :---------: | ------------------------------------------------------------------------------------------------------------------ |
| `prompt`          | string  |      ✅      | Video description                                                                                                  |
| `generation_type` | string  |             | Generation mode: `text-to-video` (default) / `image-to-video` / `reference-to-video`                               |
| `image_urls`      | array   | Conditional | Image URLs. Image-to-video: 1 image (first frame) or 2 (first + last frames); reference-to-video: reference images |
| `video_urls`      | array   |             | Reference video URLs (reference-to-video only)                                                                     |
| `audio_urls`      | array   |             | Reference audio URLs (reference-to-video only)                                                                     |
| `duration`        | integer |             | Duration (seconds), default 5                                                                                      |
| `aspect_ratio`    | string  |             | `16:9` / `4:3` / `1:1` / `3:4` / `9:16` / `21:9` / `adaptive` (default)                                            |
| `resolution`      | string  |             | `480p` / `720p` (default) / `1080p`                                                                                |
| `generate_audio`  | boolean |             | Generate an audio track, default `true`                                                                            |
| `negative_prompt` | string  |             | Negative prompt                                                                                                    |

Media URLs can be publicly reachable http(s) URLs or data URLs (`data:image/png;base64,...`).

### Model list

`seedance-2-5` / `seedance-2-0` / `seedance-2-0-fast` / `seedance-2-0-mini` / `seedance-2-0-mini-enhanced` / `seedance-2-0-mini-enhanced` / `seedance-1-5-pro`

## Generation modes

### Image-to-video (first frame)

Pass 1 image in `image_urls` as the first frame:

```bash theme={null}
curl https://openp.ai/seedance/v1/videos/generations \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2-5",
    "input": {
      "prompt": "the subject turns toward camera, soft studio motion",
      "generation_type": "image-to-video",
      "image_urls": ["https://your.cdn.com/first-frame.jpg"],
      "duration": 5,
      "resolution": "720p"
    }
  }'
```

Media can also be inlined as data URLs (`data:<mime>;base64,...`), handy for uploading local assets without hosting them first. Image:

```json theme={null}
{
  "model": "seedance-2-0-fast",
  "input": {
    "prompt": "gentle ocean waves under a warm sunset sky, cinematic",
    "generation_type": "image-to-video",
    "image_urls": ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD..."],
    "duration": 4,
    "resolution": "480p"
  }
}
```

Reference videos and audios work the same way (MIME types like `video/mp4`, `audio/mpeg`):

```json theme={null}
{
  "model": "seedance-2-5",
  "input": {
    "prompt": "the character from image 1 performs the motion from the video with the reference voice",
    "generation_type": "reference-to-video",
    "image_urls": ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD..."],
    "video_urls": ["data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb20..."],
    "audio_urls": ["data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4..."],
    "duration": 8
  }
}
```

<Note>Inlined video/audio inflates the request body (base64 grows \~33%); each asset is capped at 100 MB. For large or reusable assets, prefer public URLs.</Note>

### Image-to-video (first + last frames)

Pass 2 images in `image_urls`; the model interpolates between the first and last frames:

```json theme={null}
{
  "model": "seedance-2-5",
  "input": {
    "prompt": "smooth camera push-in from the first frame to the last",
    "generation_type": "image-to-video",
    "image_urls": [
      "https://your.cdn.com/first-frame.jpg",
      "https://your.cdn.com/last-frame.jpg"
    ],
    "duration": 5
  }
}
```

### Reference-to-video (image + video)

Lock the subject with a reference image and replicate camera motion from a reference video:

```json theme={null}
{
  "model": "seedance-2-5",
  "input": {
    "prompt": "use the product from image 1 and the camera motion from the reference video",
    "generation_type": "reference-to-video",
    "image_urls": ["https://your.cdn.com/product.jpg"],
    "video_urls": ["https://your.cdn.com/camera-motion.mp4"],
    "duration": 8,
    "resolution": "720p"
  }
}
```

### Reference-to-video (image + audio)

Make the subject speak or sing along to a reference audio:

```json theme={null}
{
  "model": "seedance-2-5",
  "input": {
    "prompt": "the woman from image 1 sings the reference song on stage",
    "generation_type": "reference-to-video",
    "image_urls": ["https://your.cdn.com/singer.jpg"],
    "audio_urls": ["https://your.cdn.com/song.mp3"],
    "duration": 10
  }
}
```

### Reference-to-video (image + video + audio)

All three material types can be combined:

```json theme={null}
{
  "model": "seedance-2-5",
  "input": {
    "prompt": "the character from image 1 performs the motion from the video with the reference voice",
    "generation_type": "reference-to-video",
    "image_urls": ["https://your.cdn.com/character.jpg"],
    "video_urls": ["https://your.cdn.com/motion.mp4"],
    "audio_urls": ["https://your.cdn.com/voice.mp3"],
    "duration": 8
  }
}
```

### Reference-to-video (audio only)

`seedance-2-5` accepts audio as the only reference; the `seedance-2-0` family requires at least one image or video alongside audio:

```json theme={null}
{
  "model": "seedance-2-5",
  "input": {
    "prompt": "a music video visualizer following the rhythm of the reference track",
    "generation_type": "reference-to-video",
    "audio_urls": ["https://your.cdn.com/track.mp3"],
    "duration": 10
  }
}
```

### Material limits

| Model                 | Images | Videos                           | Audios                           | Total |
| --------------------- | ------ | -------------------------------- | -------------------------------- | ----- |
| `seedance-2-5`        | ≤ 30   | ≤ 10, each 2-30s, combined ≤ 30s | ≤ 10, each 2-30s, combined ≤ 30s | ≤ 50  |
| `seedance-2-0` family | ≤ 9    | ≤ 3, combined ≤ 15s              | ≤ 3, combined ≤ 15s              | —     |

## Response (task created)

```json theme={null}
{
  "taskId": "task_id",
  "credits": 28
}
```

`taskId` is the task ID; `credits` is the estimated charge.

## Query task status

```bash theme={null}
curl https://openp.ai/seedance/v1/tasks/task_id \
  -H "Authorization: Bearer $OPENPAI_API_KEY"
```

```json theme={null}
{
  "id": "task_id",
  "status": "completed",
  "created_at": 1786176476,
  "model": "seedance-2-0-fast",
  "billing_status": "charged",
  "credits": 28,
  "data": {
    "results": [
      "https://openp.ai/seedance/v1/videos/generations/task_id.mp4"
    ],
    "processing_time": 104
  }
}
```

| Field                  | Description                                                 |
| ---------------------- | ----------------------------------------------------------- |
| `status`               | `queued` / `generating` / `completed` / `failed`            |
| `billing_status`       | `reserved` (pre-charged) / `charged` / `refunded`           |
| `credits`              | Actual charge                                               |
| `failed_reason`        | Failure reason (only when `failed`; no `data` in that case) |
| `data.results`         | Video download URLs (only when `completed`)                 |
| `data.processing_time` | Generation time (seconds)                                   |

## Download the video

```bash theme={null}
curl -L https://openp.ai/seedance/v1/videos/generations/task_id.mp4 \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -o video.mp4
```

Returns a `video/mp4` byte stream.

## Polling advice

* Wait 5-10 seconds before the first poll.
* Poll every 10-30 seconds.
* Tasks typically finish in 1-3 minutes.
* On failure, `failed_reason` explains why.

## Billing

Billed as **model unit price × seconds**, pre-charged at submit and settled on completion. Failed tasks are refunded automatically (`billing_status` becomes `refunded`).
