doubao-seedance-2-0-260128(Reference To Video)
POST
/v3/contents/generations/tasksAuthentication
- Sign up for an account
- Navigate to the API Keys section in your dashboard
- Generate a new API key (sk-xxxxx)
- Copy and securely store your API key
Create Task Request
curl --location 'http://45.32.108.182:15555/api/v3/contents/generations/tasks' \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "Cute pet birthday scene, puppy wearing a party hat in a cozy home setting, mini birthday cake, warm lighting, wagging tail and licking cream, soft and heartwarming style, dynamic short video, HD 60fps, soft filter"
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/dog.png"
},
"role": "reference_image",
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/happy.png"
},
"role": "reference_image",
},
{
"type": "video_url",
"video_url": {
"url": "https://docs.test.maxtoken.io/dog_video.mp4"
},
"role": "reference_video",
},
{
"type": "audio_url",
"audio_url": {
"url": "https://docs.test.maxtoken.io/dog_audio.mp3"
},
"role": "reference_audio",
},
],
"generate_audio": true,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"camera_fixed": false,
"watermark": true
}'
const axios = require('axios');
let data = JSON.stringify({
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "Cute pet birthday scene, puppy wearing a party hat in a cozy home setting, mini birthday cake, warm lighting, wagging tail and licking cream, soft and heartwarming style, dynamic short video, HD 60fps, soft filter"
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/dog.png"
},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/happy.png"
},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {
"url": "https://docs.test.maxtoken.io/dog_video.mp4"
},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://docs.test.maxtoken.io/dog_audio.mp3"
},
"role": "reference_audio"
},
],
"generate_audio": true,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"camera_fixed": false,
"watermark": true
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'http://45.32.108.182:15555/api/v3/contents/generations/tasks',
headers: {
'Authorization': 'Bearer API_KEY',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
import json
url = "http://45.32.108.182:15555/api/v3/contents/generations/tasks"
payload = json.dumps({
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "Cute pet birthday scene, puppy wearing a party hat in a cozy home setting, mini birthday cake, warm lighting, wagging tail and licking cream, soft and heartwarming style, dynamic short video, HD 60fps, soft filter"
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/dog.png"
},
"role": "reference_image",
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/happy.png"
},
"role": "reference_image",
},
{
"type": "video_url",
"video_url": {
"url": "https://docs.test.maxtoken.io/dog_video.mp4"
},
"role": "reference_video",
},
{
"type": "audio_url",
"audio_url": {
"url": "https://docs.test.maxtoken.io/dog_audio.mp3"
},
"role": "reference_audio",
},
],
"generate_audio": True,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"camera_fixed": False,
"watermark": True,
}
)
headers = {
"Authorization": "Bearer API_KEY",
"Content-Type": "application/json"
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "http://45.32.108.182:15555/api/v3/contents/generations/tasks"
method := "POST"
payload := strings.NewReader(`{
"model": "doubao-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "Cute pet birthday scene, puppy wearing a party hat in a cozy home setting, mini birthday cake, warm lighting, wagging tail and licking cream, soft and heartwarming style, dynamic short video, HD 60fps, soft filter"
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/dog.png"
},
"role": "reference_image",
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.test.maxtoken.io/happy.png"
},
"role": "reference_image",
},
{
"type": "video_url",
"video_url": {
"url": "https://docs.test.maxtoken.io/dog_video.mp4"
},
"role": "reference_video",
},
{
"type": "audio_url",
"audio_url": {
"url": "https://docs.test.maxtoken.io/dog_audio.mp3"
},
"role": "reference_audio",
},
],
"generate_audio": true,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"camera_fixed": false,
"watermark": true
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer API_KEY")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Resopnese Example
{
"id": "cgt-20251225201056-abc"
}
Get Task Result Request
curl --location 'http://45.32.108.182:15555/api/v3/contents/generations/tasks/id' \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json'
const axios = require('axios');
const config = {
method: 'get',
maxBodyLength: Infinity,
url: 'http://45.32.108.182:15555/api/v3/contents/generations/tasks/id',
headers: {
'Authorization': 'Bearer API_KEY',
'Content-Type': 'application/json'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
url = "http://45.32.108.182:15555/api/v3/contents/generations/tasks/id"
headers = {
"Authorization": "Bearer API_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "http://45.32.108.182:15555/api/v3/contents/generations/tasks/id"
method := "GET"
client := &http.Client{}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer API_KEY")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Core Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
model | string | ✅ Yes | - | - | |
content | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text, image, video, audio information. |
>content.type | string | ✅ Yes | - | textimage_urlvideo_urlaudio_url | Type of input content. Use text for text input, image_url for image input ,video_url for video input,audio_url for video input |
>content.text | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. |
>content.image_url | object | ✅ Yes (if type is image_url) | - | - | Image object input to the model. |
>>content.image_url.url | string | ✅ Yes (if image_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. |
>content.video_url | object | ✅ Yes (if type is video_url) | - | - | Video object input to the model. |
>>content.video_url.url | string | ✅ Yes (if video_url is used) | - | - | Video information, which can be an video URL |
>content.audio_url | object | ✅ Yes (if type is audio_url) | - | - | Audio object input to the model. |
>>content.audio_url.url | string | ✅ Yes (if audio_url is used) | - | - | Audio information, which can be an audio URL |
>content.role | string | ❌ No | - | first_framelast_framereference_imagereference_videoreference_audio | Position or purpose of the image. Different roles correspond to different video generation scenarios. |
generate_audio | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. |
resolution | string | ❌ No | 480p 720p 1080p | - | Video resolution. Default values vary by model. |
ratio | string | ❌ No | 21:9 16:9 4:3 1:1 3:4 9:16 | - | Aspect ratio of the generated video. |
duration | integer | ❌ No | 4~15 | 5 | Duration of the generated video in seconds. |
camera_fixed | boolean | ❌ No | true | - | Whether to fix the camera. |
watermark | boolean | ❌ No | true | - | Whether to include watermark in the generated video. |
