# Seedance 2.5 Video Generation

Create text-to-video, image-referenced video, video- or audio-referenced video, multi-asset referenced video, strict first-frame video, and strict first-and-last-frame video tasks with `seedance-2-5` or `seedance-2-5-flash`.

Video generation follows an asynchronous workflow:

1. Create a video generation task.
2. Poll task status using the returned task ID.
3. Retrieve the output video URL once the task completes.

## Endpoints & Authentication

Authenticate all requests with a Bearer API key:

```http
Authorization: Bearer YOUR_API_KEY
```

Endpoints:

```http
POST https://vip.brioi.com/v1/videos
GET  https://vip.brioi.com/v1/videos/{task_id}
```

Include the JSON content-type header when creating tasks:

```http
Content-Type: application/json
```

Check `GET /v1/models` for the authoritative list of models available to your account.

## Supported Models

| Model | Positioning | Supported Resolutions | Output Duration | General Asset Limits |
|---|---|---|---|---|
| `seedance-2-5` | Standard quality tier | `480p`, `720p`, `1080p` | `4–30` s | 30 images / 10 videos / 10 audio clips (total ≤ 50) |
| `seedance-2-5-flash` | High-speed tier for previews and batch production | `480p`, `720p` | `4–30` s | 10 images / 5 videos / 5 audio clips (total ≤ 20) |

Models on this page are visible to API keys in the `Seedance 2.0 [按秒]` or `auto` token groups; check `GET /v1/models` for actual availability.

> Default aspect ratio: Seedance 2.5 defaults to `9:16` when `aspect_ratio` is omitted, whereas Seedance 2 defaults to `16:9`. Specify `aspect_ratio` explicitly when migrating between versions.

## Request Format

The platform accepts only the unified reference asset schema: pass all images, videos, and audio clips inside `ref`, without mode fields or top-level media arrays.

### Create Video Task

```http
POST /v1/videos
Content-Type: application/json
```

### Request Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---:|---|---|
| `model` | string | Yes | — | `seedance-2-5` or `seedance-2-5-flash`. |
| `prompt` | string | Yes | — | Video prompt. Reference general assets using literal `@图片N`, `@视频N`, and `@音频N` tags. |
| `duration` | integer | Yes | — | Output video duration; must be an integer from `4` to `30` seconds (`4–30`). If `prompt` mentions a duration in natural language, it must match this value (for example, write `"15 seconds"` when `duration=15`). |
| `resolution` | string | No | `720p` | `seedance-2-5` supports `480p`, `720p`, `1080p`; `seedance-2-5-flash` supports `480p`, `720p`. |
| `aspect_ratio` | string | No | `9:16` | Supports `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`. |
| `ref` | object[] | By scenario | — | Unified reference asset list; omit for text-to-video. |

Omitting `aspect_ratio` defaults to `9:16`; explicitly passing any supported aspect ratio above preserves that ratio.

Do **not** use legacy fields:

- `mode`
- `image` / `images` / `image_urls`
- `video_urls` / `videos`
- `audio_urls` / `audios`
- `size` / `quality`
- `content`
- `n`

### `ref` Object

| Field | Type | Required | Description |
|---|---|---:|---|
| `url` | string | Yes | Publicly readable direct HTTPS media link (no login required). |
| `type` | string | Yes | `image`, `video`, or `audio`. |
| `role` | string | No | Optional for general reference assets; use `first_frame` for strict first frame and `last_frame` for strict last frame. |

General roles must match `type`:

| `type` | Allowed General `role` | When `role` Is Omitted |
|---|---|---|
| `image` | `reference_image` | Treated as a general reference image |
| `video` | `reference_video` | Treated as a general reference video |
| `audio` | `reference_audio` | Treated as general reference audio |

Frame-control roles (`first_frame`, `last_frame`) are valid only when `type=image`.

## Supported Generation Modes

| Request Contents | Generation Mode |
|---|---|
| Omit `ref` | Text-to-video |
| General image, video, or audio assets | Single-asset or multi-asset reference video |
| One `role=first_frame` image | Strict first-frame video |
| One `first_frame` image plus one `last_frame` image | Strict first-and-last-frame video |

A general reference video or audio clip may serve as the sole reference type without requiring an image.

Strict frame rules:

- `first_frame` may be submitted alone.
- `last_frame` cannot be submitted alone—`first_frame` must accompany it.
- At most one `first_frame` and one `last_frame` per request.
- Array order inside `ref` does not matter; `role` determines frame assignment.
- Strict frame requests cannot be mixed with general reference images, videos, or audio.

## Reference Asset Counts

| Asset Type | `seedance-2-5` Allowed Count | `seedance-2-5-flash` Allowed Count |
|---|---:|---:|
| General images | 0–30 | 0–10 |
| General videos | 0–10 | 0–5 |
| General audio clips | 0–10 | 0–5 |
| Total general `ref` items | 1–50 | 1–20 |

The total limit equals the sum of the three per-type limits for the chosen model (`50` for `seedance-2-5`, `20` for `seedance-2-5-flash`). The platform never silently truncates excess assets.

## Asset Requirements

| Type | Formats | Max File Size | Dimensions | Duration |
|---|---|---|---|---|
| Image | JPEG, PNG, WebP, BMP, TIFF, GIF, HEIC, HEIF | < 30 MB | Width and height `300–6000` px; aspect ratio (W/H) `0.4–2.5` | — |
| Video | MP4, MOV | ≤ 200 MB | Width and height `300–6000` px; aspect ratio `0.4–2.5`; total pixels `407,696` (`614×664`) to `8,847,360` (`4096×2160`); frame rate `24–60` FPS | `2–30` s per clip; ≤ 30 s combined across all videos |
| Audio | WAV, MP3 | ≤ 15 MB | — | `2–30` s per clip; ≤ 30 s combined across all audio clips |

Video codecs: MP4 supports H.264/AVC and H.265/HEVC video tracks with AAC or MP3 audio tracks; MOV supports H.264/AVC and H.265/HEVC video tracks with AAC, MP3, or PCM audio tracks.

Asset URLs must be direct HTTPS file links downloadable throughout task processing: no login, cookies, or custom headers; not web pages, preview pages, or login screens; and returning a MIME type matching `type`. Assets violating these constraints fail with a parameter error or terminate with `status: "failed"` and a diagnostic reason in `error.message`.

## Asset Numbering & Reference Tags

General reference assets are numbered sequentially within each media type in the order they appear in `ref`:

```text
1st image → @图片1
2nd image → @图片2

1st video → @视频1
2nd video → @视频2

1st audio → @音频1
2nd audio → @音频2
```

> **Important:** `@图片1`, `@视频1`, and `@音频1` (and `@图片N`, `@视频N`, `@音频N`) are **literal syntax tags parsed by the Seedance backend**. Keep these exact tags unchanged even in English prompts—do **not** translate them to `@image1`, `@video1`, or `@audio1`.

- Do not include asset tags in text-to-video prompts.
- Reference general assets using the corresponding `@图片N`, `@视频N`, or `@音频N` tag.
- Use only the exact standard tags above; do not use variants such as `@参考图N` or `@image1`.
- Do not reference indices that do not exist in `ref`.
- Strict first-frame and first-and-last-frame generation are controlled by `role` and do not require asset tags in `prompt`.

## Request Examples

### Text-to-Video

```json
{
  "model": "seedance-2-5",
  "prompt": "A futuristic city after rain, neon lights reflecting on the wet pavement, slow dolly-in camera movement",
  "duration": 8,
  "resolution": "720p"
}
```

### Square Text-to-Video

```json
{
  "model": "seedance-2-5",
  "prompt": "Overhead shot of a rain-washed city plaza, pedestrians and vehicles moving in an orderly flow within a square frame",
  "duration": 8,
  "resolution": "720p",
  "aspect_ratio": "1:1"
}
```

### General Image Reference

```json
{
  "model": "seedance-2-5",
  "prompt": "Keep the character's face, hairstyle, and outfit consistent with @图片1 as the character turns naturally to look at the camera",
  "duration": 8,
  "resolution": "720p",
  "aspect_ratio": "9:16",
  "ref": [
    {
      "url": "https://example.com/character.png",
      "type": "image"
    }
  ]
}
```

### Combined Image, Video, and Audio Reference

```json
{
  "model": "seedance-2-5",
  "prompt": "Feature the character from @图片1 as the lead, follow the camera movement of @视频1, and generate a vertical video synced to the beat of @音频1",
  "duration": 12,
  "resolution": "720p",
  "aspect_ratio": "9:16",
  "ref": [
    {
      "url": "https://example.com/character.png",
      "type": "image"
    },
    {
      "url": "https://example.com/motion.mp4",
      "type": "video"
    },
    {
      "url": "https://example.com/bgm.mp3",
      "type": "audio"
    }
  ]
}
```

### Strict First and Last Frame

```json
{
  "model": "seedance-2-5",
  "prompt": "Smooth transition from early morning to night as city neon lights illuminate one by one",
  "duration": 8,
  "resolution": "720p",
  "aspect_ratio": "16:9",
  "ref": [
    {
      "url": "https://example.com/morning.png",
      "type": "image",
      "role": "first_frame"
    },
    {
      "url": "https://example.com/night.png",
      "type": "image",
      "role": "last_frame"
    }
  ]
}
```

## Creation Response

A successful submission returns the task ID:

```json
{
  "id": "task_xxxxxxxxxxxxxxxxxxxxxxxx",
  "task_id": "task_xxxxxxxxxxxxxxxxxxxxxxxx",
  "object": "video",
  "model": "seedance-2-5",
  "status": "queued",
  "progress": 0,
  "created_at": 1780682136
}
```

A successful creation response only indicates that the task has entered the queue, not that video generation is complete.

## Polling Task Status

```http
GET /v1/videos/{task_id}
```

```bash
curl "https://vip.brioi.com/v1/videos/task_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Poll every 5–10 seconds.

| Status | Description |
|---|---|
| `queued` | Waiting for processing |
| `in_progress` | Generating video |
| `completed` | Generation succeeded; read `metadata.url` |
| `failed` | Task failed; read `error` |

Treat any status outside the table above as non-terminal and continue polling.

Example completed response:

```json
{
  "id": "task_xxxxxxxxxxxxxxxxxxxxxxxx",
  "object": "video",
  "model": "seedance-2-5",
  "status": "completed",
  "progress": 100,
  "metadata": {
    "url": "https://example.com/result.mp4"
  },
  "result_url": "https://example.com/result.mp4"
}
```

Read `metadata.url` once the task completes; `result_url` carries the same URL as a fallback. Auxiliary fields such as `model` may differ from the requested model ID, and the auxiliary field set may change—do not depend on them. Result URLs expire, and expired tasks may omit the result URL on subsequent polls; download or persist the video immediately upon completion.

## Error Handling

| HTTP Status | Common Causes |
|---:|---|
| `400` | Invalid parameters; querying a nonexistent task also returns `400` with `code` set to `task_not_exist` |
| `401` | Missing or invalid API key |
| `403` | Insufficient balance/quota, or missing model or token-group permission |
| `429` | Rate limit exceeded |
| `503` | Service temporarily unavailable |
| `500` / `502` | Transient server error |

Creation errors typically return:

```json
{
  "error": {
    "message": "Detailed error message (request id: 2026xxxxxxxxxxxxxxxx)",
    "type": "new_api_error",
    "code": "error_code"
  }
}
```

When an async task fails, the poll response sets `status` to `failed` with details in `error.code` and `error.message`.

Common errors:

- Missing `model`, `prompt`, or `duration`.
- `duration` is not an integer in `4–30`.
- `resolution` exceeds what the chosen model supports (e.g., passing `1080p` to `seedance-2-5-flash`).
- `aspect_ratio` is not one of `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`.
- Missing `ref[].url` or `ref[].type`.
- Mismatched `type` and `role`.
- Submitting `last_frame` without `first_frame`, or mixing strict frames with general reference assets.
- Exceeding per-type image, video, audio, or total general `ref` limits for the selected model.
- Referencing a nonexistent asset index in `prompt`.
- Unreachable asset URL, HTML web-page response instead of media bytes, or mismatched MIME type.
- Prompt or media assets triggering content moderation policies.

Do not pass chat completion parameters such as `messages`, `temperature`, `top_p`, or `stream` to `/v1/videos`.

