# doubao-seedance-1-5-pro

Text/image-to-video model

## Submit Async Task

### Endpoint

`https://api-us-ca.umodelverse.ai/v1/tasks/submit`

### Input

| Parameter | Type | Required | Description |
| :--------------------------------- | :------ | :------- | :------------------------------------------------------------------------------------------------------- |
| model | string | Yes | Model name, here it is `doubao-seedance-1-5-pro-251215` |
| input.content | object[] | Yes | Input objects for video generation. Supports three object types:<br>`Text content`<br>`Image content`<br>`Draft content`<br>See the content description below. |
| parameters.execution_expires_after | int | No | Task timeout threshold. Specifies the expiration time after submission in seconds. Default: `172800` seconds (`48` hours). Range: `[3600, 259200]`. |
| parameters.generate_audio | boolean | No | Controls whether the generated video includes synchronized audio. Default: `false`.<br>`true`: output video contains synced audio.<br>`false`: output video is silent. |
| parameters.draft | boolean | No | Controls whether to enable draft mode. Default: `false`.<br>`true`: enables draft mode and generates a preview video to quickly validate scene structure, camera scheduling, subject motion, and prompt intent. Uses fewer tokens and costs less than a normal video.<br>`false`: disables draft mode and generates a normal video. |
| parameters.resolution | string | No | Video resolution. Default: `720p`.<br>Supported values: `480p`, `720p`, `1080p`.<br>Draft mode only supports `480p`. |
| parameters.ratio | string | No | Aspect ratio of the generated video. Supported values: `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `21:9`, `adaptive`. Default: `adaptive`, which intelligently selects the most suitable ratio. |
| parameters.duration | int | No | Video duration in seconds: `4~12`, default is `5` |
| parameters.seed | int | No | Random seed, range `[0, 2147483647]` |
| parameters.camera_fixed | boolean | No | Whether to fix the camera. Default: `false`.<br>`true`: fixed camera.<br>`false`: unfixed camera. |
| parameters.watermark | boolean | No | Whether the generated video includes a watermark. Default: `false`.<br>`false`: no watermark.<br>`true`: contains watermark. |
| parameters.service_tier | string | No | Specifies the service tier for processing this request. Default: `default`.<br>`default`: online inference mode, suitable for scenarios requiring lower latency.<br>`flex`: offline inference mode, suitable for scenarios with lower latency requirements. |

#### Description of `input.content` Objects
A draft content object generates a video from a draft task and cannot be mixed with text content or image content objects.

#### Text Content Object
| Parameter | Type | Required | Description |
| :--------------------------------- | :------ | :------- | :------------------------------------------------------------------------------------------------------- |
| content.type | string | Yes | Type of input content. Must be `text`. |
| content.text | string | Yes | Text input describing the expected video. Supports both Chinese and English. Recommended length: no more than 500 characters. |

#### Image Content Object
| Parameter | Type | Required | Description |
| :--------------------------------- | :------ | :------- | :------------------------------------------------------------------------------------------------------- |
| content.type | string | Yes | Type of input content. Must be `image_url`. Supports image URL or Base64-encoded image. |
| content.image_url | object | Yes | Image object provided to the model. |
| content.image_url.url | string | Yes | Image data, which can be an image URL or Base64-encoded image.<br>Image URL: please ensure the URL is accessible.<br>Base64 format must follow: `data:image/<image_format>;base64,<Base64>` where `<image_format>` must be lowercase, e.g. `data:image/png;base64,{base64_image}`. |
| content.role | string | No | Position or purpose of the image.<br>For 1 `image_url` object, `role` may be omitted or set to `first_frame`.<br>For 2 `image_url` objects, `role` is required.<br>The first frame image should use `first_frame`.<br>The last frame image should use `last_frame`. |

#### Draft Content Object
| Parameter | Type | Required | Description |
| :--------------------------------- | :------ | :------- | :------------------------------------------------------------------------------------------------------- |
| content.type | string | Yes | Type of input content. Must be `draft_task`. |
| content.draft_task | object | Yes | Draft task provided to the model. |
| content.draft_task.id | string | Yes | Draft task ID. |

### Request Example
⚠️ If you are using Windows, it is recommended to use Postman or another API client tool.
```shell
curl -v 'https://api-us-ca.umodelverse.ai/v1/tasks/submit' \
--header 'Authorization: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "doubao-seedance-1-5-pro-251215",
    "input": {
        "content": [
        {
            "type": "text",
            "text": "Make him run."
        },
        {
            "type": "image_url",
            "image_url": {
                "url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
            },
            "role": "first_frame"
        },
        {
            "type": "image_url",
            "image_url": {
                "url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
            },
            "role": "last_frame"
        }
      ]
    },
    "parameters": {
      "generate_audio": true,
      "duration": 5,
      "execution_expires_after": 3600,
      "generate_audio": true,
      "resolution": "720p",
      "camera_fixed": false,
      "watermark": false,
      "draft": false
    }
  }'
```

### Output

| Parameter      | Type   | Description                         |
| :------------- | :----- | :---------------------------------- |
| output.task_id | string | Unique identifier of the async task |
| request_id     | string | Unique request identifier           |

### Response Example

```json
{
  "output": {
    "task_id": "task_id"
  },
  "request_id": "request_id"
}
```

## Query Task Status

### Endpoint

`https://api-us-ca.umodelverse.ai/v1/tasks/status?task_id=<task_id>`

### Request Example

```shell
curl --location 'https://api-us-ca.umodelverse.ai/v1/tasks/status?task_id=<task_id>' \
--header 'Authorization: <YOUR_API_KEY>'
```

### Output

| Parameter               | Type    | Description                                                                                                                                             |
| :---------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
| output.task_id          | string  | Unique identifier of the async task                                                                                                                     |
| output.task_status      | string  | Task status: `Pending`, `Running`, `Success`, `Failure`, `Expired`                                                                                      |
| output.urls             | array   | List of video result URLs                                                                                                                               |
| output.submit_time      | integer | Task submission timestamp                                                                                                                               |
| output.finish_time      | integer | Task completion timestamp                                                                                                                               |
| output.error_message    | string  | Error message returned on failure                                                                                                                       |
| usage.duration          | integer | Video duration (seconds)                                                                                                                                |
| usage.completion_tokens | integer | Number of tokens spent by the model to generate the output video                                                                                        |
| usage.total_tokens      | integer | Total tokens consumed by this request. Video generation models do not count input tokens, so input tokens are 0 and `total_tokens = completion_tokens`. |
| request_id              | string  | Unique request identifier                                                                                                                               |

### Response Example (Success)

```json
{
	"output": {
		"task_id": "xxxxxxx",
		"task_status": "Success",
		"urls": ["http://xxxxxxxx/xx.mp4"],
		"submit_time": 1768460826,
		"finish_time": 1768460932
	},
	"usage": {
		"completion_tokens": 108900,
		"total_tokens": 108900,
		"duration": 5
	},
	"request_id": ""
}
```

### Response Example (Failure)

```json
{
  "output": {
    "task_id": "xxxxxxx",
    "task_status": "Failure",
    "submit_time": 1756959000,
    "finish_time": 1756959019,
    "error_message": "error_message"
  },
  "usage": {
  	"completion_tokens": 0,
		"total_tokens": 0,
    "duration": 5
  },
  "request_id": ""
}

```


