Doubao Video Generation
curl --request POST \
--url https://www.token-nova.com/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"seconds": 123
}
'import requests
url = "https://www.token-nova.com/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"seconds": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', prompt: '<string>', size: '<string>', seconds: 123})
};
fetch('https://www.token-nova.com/v1/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.token-nova.com/v1/videos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'size' => '<string>',
'seconds' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.token-nova.com/v1/videos"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"seconds\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.token-nova.com/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"seconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"seconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"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"
}
OpenAI Format
Doubao Video Generation
Use POST /v1/videos to call the Doubao model and submit asynchronous video tasks.
POST
https://www.token-nova.com
/
v1
/
videos
Doubao Video Generation
curl --request POST \
--url https://www.token-nova.com/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"seconds": 123
}
'import requests
url = "https://www.token-nova.com/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"seconds": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', prompt: '<string>', size: '<string>', seconds: 123})
};
fetch('https://www.token-nova.com/v1/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.token-nova.com/v1/videos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'size' => '<string>',
'seconds' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.token-nova.com/v1/videos"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"seconds\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.token-nova.com/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"seconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"seconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"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"
}
Doubao Video Generation
The Doubao channel usesPOST /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_imagefield, and the last-frame image is uploaded via thelast_frame_imagefield. - After successful submission, the task
idandstatusare returned. Use Task Status Query to poll for the result.
Supported Models
doubao-seedance-1-0-pro_480pdoubao-seedance-1-0-pro_720pdoubao-seedance-1-0-pro_1080pdoubao-seedance-1-5-pro_480pdoubao-seedance-1-5-pro_720pdoubao-seedance-1-5-pro_1080p
Method and Path
POST /v1/videos
Request Example
curl -X POST https://www.token-nova.com/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"
import requests
resp = requests.post(
"https://www.token-nova.com/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())
First-Frame Video Generation Example
# Request example with a first-frame image
curl -X POST https://www.token-nova.com/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"
# Request example with a first-frame image
import requests
with open("first-frame.png", "rb") as f:
resp = requests.post(
"https://www.token-nova.com/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())
First-and-Last-Frame Video Generation Example
# Request example with first- and last-frame images
curl -X POST https://www.token-nova.com/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"
# 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://www.token-nova.com/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())
Response Example
{
"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"
}
Authentication
Authorization: Bearer YOUR_API_KEY
Body
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.string
required
Prompt. The text description for the generated video, supporting both Chinese and English.
file
First-frame image. Upload a single image file for first-frame-to-video scenarios. Supported image formats include png, jpeg, jpg, and webp.
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.
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).integer
Video duration (seconds). Valid range:
>= 4 and < 12.Response
string
Task ID.
string
Fixed as
video.string
Model name.
string
Task status. Optional values include
queued (in queue), processing (in progress), completed (completed), failed (failed), and cancelled (cancelled).integer
Progress percentage (0-100).
integer
Creation time (Unix timestamp).
string
Video dimensions, for example
720x720.