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

# Doubao Video Generation

> Use `POST /v1/videos` to call the Doubao model and submit asynchronous video tasks.

# Doubao Video Generation

The Doubao channel uses `POST /v1/videos` to submit tasks, with `multipart/form-data`.

* The route entry is `POST /v1/videos`.
* Currently submitted as `multipart/form-data`.
* Supports text-to-video, first-frame-to-video, and first-and-last-frame-to-video.
* The first-frame image is uploaded via the `first_frame_image` field, and the last-frame image is uploaded via the `last_frame_image` field.
* After successful submission, the task `id` and `status` are returned. Use [Task Status Query](./doubao-query) to poll for the result.

## Supported Models

* `doubao-seedance-1-0-pro_480p`
* `doubao-seedance-1-0-pro_720p`
* `doubao-seedance-1-0-pro_1080p`
* `doubao-seedance-1-5-pro_480p`
* `doubao-seedance-1-5-pro_720p`
* `doubao-seedance-1-5-pro_1080p`

## Method and Path

```http theme={null}
POST /v1/videos
```

## Request Example

<CodeGroup>
  ```bash theme={null}
  curl -X POST https://octopusx.ai/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=doubao-seedance-1-5-pro_720p" \
    -F "prompt=The cat listens to music and nods its head while rain pours down" \
    -F "size=4:3" \
    -F "seconds=4"
  ```

  ```python theme={null}
  import requests

  resp = requests.post(
      "https://octopusx.ai/v1/videos",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      data={
          "model": "doubao-seedance-1-5-pro_720p",
          "prompt": "The cat listens to music and nods its head while rain pours down",
          "size": "4:3",
          "seconds": 4,
      },
      timeout=60,
  )
  print(resp.json())
  ```
</CodeGroup>

### First-Frame Video Generation Example

<CodeGroup>
  ```bash theme={null}
  # Request example with a first-frame image
  curl -X POST https://octopusx.ai/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=doubao-seedance-1-5-pro_720p" \
    -F "prompt=Have the character walk forward and smile" \
    -F "size=16:9" \
    -F "seconds=5" \
    -F "first_frame_image=@/path/to/first-frame.png"
  ```

  ```python theme={null}
  # Request example with a first-frame image
  import requests

  with open("first-frame.png", "rb") as f:
      resp = requests.post(
          "https://octopusx.ai/v1/videos",
          headers={"Authorization": "Bearer YOUR_API_KEY"},
          data={
              "model": "doubao-seedance-1-5-pro_720p",
              "prompt": "Have the character walk forward and smile",
              "size": "16:9",
              "seconds": 5,
          },
          files={"first_frame_image": f},
          timeout=60,
      )
      print(resp.json())
  ```
</CodeGroup>

### First-and-Last-Frame Video Generation Example

<CodeGroup>
  ```bash theme={null}
  # Request example with first- and last-frame images
  curl -X POST https://octopusx.ai/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=doubao-seedance-1-5-pro_720p" \
    -F "prompt=Smooth transition" \
    -F "size=9:16" \
    -F "seconds=5" \
    -F "first_frame_image=@/path/to/first-frame.png" \
    -F "last_frame_image=@/path/to/last-frame.png"
  ```

  ```python theme={null}
  # Request example with first- and last-frame images
  import requests

  with open("first-frame.png", "rb") as f1, open("last-frame.png", "rb") as f2:
      resp = requests.post(
          "https://octopusx.ai/v1/videos",
          headers={"Authorization": "Bearer YOUR_API_KEY"},
          data={
              "model": "doubao-seedance-1-5-pro_720p",
              "prompt": "Smooth transition",
              "size": "9:16",
              "seconds": 5,
          },
          files={
              "first_frame_image": f1,
              "last_frame_image": f2,
          },
          timeout=60,
      )
      print(resp.json())
  ```
</CodeGroup>

## Response Example

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "video_bbfbc1d2-ab22-44ca-b9dd-bc16983acac2",
    "object": "video",
    "model": "doubao-seedance-1-5-pro_720p",
    "status": "queued",
    "progress": 0,
    "created_at": 1761635478,
    "size": "720x720"
  }
  ```
</ResponseExample>

## Authentication

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Body

<ParamField body="model" type="string" required>
  Model name. Supported values include `doubao-seedance-1-0-pro_480p`, `doubao-seedance-1-0-pro_720p`, `doubao-seedance-1-0-pro_1080p`, `doubao-seedance-1-5-pro_480p`, `doubao-seedance-1-5-pro_720p`, and `doubao-seedance-1-5-pro_1080p`.
</ParamField>

<ParamField body="prompt" type="string" required>
  Prompt. The text description for the generated video, supporting both Chinese and English.
</ParamField>

<ParamField body="first_frame_image" type="file">
  First-frame image. Upload a single image file for first-frame-to-video scenarios. Supported image formats include png, jpeg, jpg, and webp.
</ParamField>

<ParamField body="last_frame_image" type="file">
  Last-frame image. Upload a single image file for first-and-last-frame-to-video scenarios. Supported image formats include png, jpeg, jpg, and webp.
</ParamField>

<ParamField body="size" type="string">
  Video aspect ratio. Optional values include `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `21:9`, `keep_ratio` (keeps the same aspect ratio as the uploaded image), and `adaptive` (automatically selects the most suitable aspect ratio based on the uploaded image ratio).
</ParamField>

<ParamField body="seconds" type="integer">
  Video duration (seconds). Valid range: `>= 4` and `< 12`.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Task ID.
</ResponseField>

<ResponseField name="object" type="string">
  Fixed as `video`.
</ResponseField>

<ResponseField name="model" type="string">
  Model name.
</ResponseField>

<ResponseField name="status" type="string">
  Task status. Optional values include `queued` (in queue), `processing` (in progress), `completed` (completed), `failed` (failed), and `cancelled` (cancelled).
</ResponseField>

<ResponseField name="progress" type="integer">
  Progress percentage (0-100).
</ResponseField>

<ResponseField name="created_at" type="integer">
  Creation time (Unix timestamp).
</ResponseField>

<ResponseField name="size" type="string">
  Video dimensions, for example `720x720`.
</ResponseField>

## Related APIs

* [Doubao Video Overview](./overview)
* [Task Status Query](./doubao-query)
