Vidu 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>",
"aspect_ratio": "<string>",
"audio": true,
"voice_id": "<string>",
"is_rec": true,
"bgm": true,
"duration": 123,
"seed": 123,
"resolution": "<string>",
"payload": "<string>",
"off_peak": true,
"watermark": true,
"wm_position": 123,
"wm_url": "<string>",
"meta_data": "<string>"
}
'import requests
url = "https://www.token-nova.com/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"aspect_ratio": "<string>",
"audio": True,
"voice_id": "<string>",
"is_rec": True,
"bgm": True,
"duration": 123,
"seed": 123,
"resolution": "<string>",
"payload": "<string>",
"off_peak": True,
"watermark": True,
"wm_position": 123,
"wm_url": "<string>",
"meta_data": "<string>"
}
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>',
aspect_ratio: '<string>',
audio: true,
voice_id: '<string>',
is_rec: true,
bgm: true,
duration: 123,
seed: 123,
resolution: '<string>',
payload: '<string>',
off_peak: true,
watermark: true,
wm_position: 123,
wm_url: '<string>',
meta_data: '<string>'
})
};
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>',
'aspect_ratio' => '<string>',
'audio' => true,
'voice_id' => '<string>',
'is_rec' => true,
'bgm' => true,
'duration' => 123,
'seed' => 123,
'resolution' => '<string>',
'payload' => '<string>',
'off_peak' => true,
'watermark' => true,
'wm_position' => 123,
'wm_url' => '<string>',
'meta_data' => '<string>'
]),
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 \"aspect_ratio\": \"<string>\",\n \"audio\": true,\n \"voice_id\": \"<string>\",\n \"is_rec\": true,\n \"bgm\": true,\n \"duration\": 123,\n \"seed\": 123,\n \"resolution\": \"<string>\",\n \"payload\": \"<string>\",\n \"off_peak\": true,\n \"watermark\": true,\n \"wm_position\": 123,\n \"wm_url\": \"<string>\",\n \"meta_data\": \"<string>\"\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 \"aspect_ratio\": \"<string>\",\n \"audio\": true,\n \"voice_id\": \"<string>\",\n \"is_rec\": true,\n \"bgm\": true,\n \"duration\": 123,\n \"seed\": 123,\n \"resolution\": \"<string>\",\n \"payload\": \"<string>\",\n \"off_peak\": true,\n \"watermark\": true,\n \"wm_position\": 123,\n \"wm_url\": \"<string>\",\n \"meta_data\": \"<string>\"\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 \"aspect_ratio\": \"<string>\",\n \"audio\": true,\n \"voice_id\": \"<string>\",\n \"is_rec\": true,\n \"bgm\": true,\n \"duration\": 123,\n \"seed\": 123,\n \"resolution\": \"<string>\",\n \"payload\": \"<string>\",\n \"off_peak\": true,\n \"watermark\": true,\n \"wm_position\": 123,\n \"wm_url\": \"<string>\",\n \"meta_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "video_123",
"object": "video",
"model": "viduq3-pro",
"status": "queued",
"progress": 0,
"created_at": 1712697600,
"size": "1024x1808",
"seconds": "5",
"quality": "standard"
}
OpenAI Format
Vidu Video Generation
Use POST /v1/videos to call the Vidu model and submit asynchronous video tasks.
POST
https://www.token-nova.com
/
v1
/
videos
Vidu 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>",
"aspect_ratio": "<string>",
"audio": true,
"voice_id": "<string>",
"is_rec": true,
"bgm": true,
"duration": 123,
"seed": 123,
"resolution": "<string>",
"payload": "<string>",
"off_peak": true,
"watermark": true,
"wm_position": 123,
"wm_url": "<string>",
"meta_data": "<string>"
}
'import requests
url = "https://www.token-nova.com/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"aspect_ratio": "<string>",
"audio": True,
"voice_id": "<string>",
"is_rec": True,
"bgm": True,
"duration": 123,
"seed": 123,
"resolution": "<string>",
"payload": "<string>",
"off_peak": True,
"watermark": True,
"wm_position": 123,
"wm_url": "<string>",
"meta_data": "<string>"
}
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>',
aspect_ratio: '<string>',
audio: true,
voice_id: '<string>',
is_rec: true,
bgm: true,
duration: 123,
seed: 123,
resolution: '<string>',
payload: '<string>',
off_peak: true,
watermark: true,
wm_position: 123,
wm_url: '<string>',
meta_data: '<string>'
})
};
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>',
'aspect_ratio' => '<string>',
'audio' => true,
'voice_id' => '<string>',
'is_rec' => true,
'bgm' => true,
'duration' => 123,
'seed' => 123,
'resolution' => '<string>',
'payload' => '<string>',
'off_peak' => true,
'watermark' => true,
'wm_position' => 123,
'wm_url' => '<string>',
'meta_data' => '<string>'
]),
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 \"aspect_ratio\": \"<string>\",\n \"audio\": true,\n \"voice_id\": \"<string>\",\n \"is_rec\": true,\n \"bgm\": true,\n \"duration\": 123,\n \"seed\": 123,\n \"resolution\": \"<string>\",\n \"payload\": \"<string>\",\n \"off_peak\": true,\n \"watermark\": true,\n \"wm_position\": 123,\n \"wm_url\": \"<string>\",\n \"meta_data\": \"<string>\"\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 \"aspect_ratio\": \"<string>\",\n \"audio\": true,\n \"voice_id\": \"<string>\",\n \"is_rec\": true,\n \"bgm\": true,\n \"duration\": 123,\n \"seed\": 123,\n \"resolution\": \"<string>\",\n \"payload\": \"<string>\",\n \"off_peak\": true,\n \"watermark\": true,\n \"wm_position\": 123,\n \"wm_url\": \"<string>\",\n \"meta_data\": \"<string>\"\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 \"aspect_ratio\": \"<string>\",\n \"audio\": true,\n \"voice_id\": \"<string>\",\n \"is_rec\": true,\n \"bgm\": true,\n \"duration\": 123,\n \"seed\": 123,\n \"resolution\": \"<string>\",\n \"payload\": \"<string>\",\n \"off_peak\": true,\n \"watermark\": true,\n \"wm_position\": 123,\n \"wm_url\": \"<string>\",\n \"meta_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "video_123",
"object": "video",
"model": "viduq3-pro",
"status": "queued",
"progress": 0,
"created_at": 1712697600,
"size": "1024x1808",
"seconds": "5",
"quality": "standard"
}
Vidu Video Generation
The Vidu channel usesPOST /v1/videos to submit tasks, submitted as multipart/form-data.
- The route entry is
POST /v1/videos. - Currently submitted as
multipart/form-data. - Supports text-to-video and image-to-video.
- Upload a single reference image file through the
imagesfield. - After a successful submission, the task
idandstatusare returned. Poll the result later with Task Status Query.
Supported Models
viduq3-pro: Efficiently generates high-quality audio and video content, making videos more vivid, more lifelike, and more three-dimensionalviduq2-pro: New model, good results, rich detailsviduq2-turbo: New model, good results, fast generation
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=viduq3-pro" \
-F "prompt=A cat chasing butterflies on the grass" \
-F "aspect_ratio=16:9" \
-F "duration=5"
import requests
resp = requests.post(
"https://www.token-nova.com/v1/videos",
headers={"Authorization": "Bearer YOUR_API_KEY"},
data={
"model": "viduq3-pro",
"prompt": "A cat chasing butterflies on the grass",
"aspect_ratio": "16:9",
"duration": 5,
},
timeout=60,
)
print(resp.json())
Image-to-Video Example
# Request example with a reference image
curl -X POST https://www.token-nova.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=viduq3-pro" \
-F "prompt=Have the person walk forward and smile" \
-F "aspect_ratio=9:16" \
-F "duration=5" \
-F "images=@/path/to/image.png"
# Request example with a reference image
import requests
with open("image.png", "rb") as f:
resp = requests.post(
"https://www.token-nova.com/v1/videos",
headers={"Authorization": "Bearer YOUR_API_KEY"},
data={
"model": "viduq3-pro",
"prompt": "Have the person walk forward and smile",
"aspect_ratio": "9:16",
"duration": 5,
},
files={"images": f},
timeout=60,
)
print(resp.json())
Response Example
{
"id": "video_123",
"object": "video",
"model": "viduq3-pro",
"status": "queued",
"progress": 0,
"created_at": 1712697600,
"size": "1024x1808",
"seconds": "5",
"quality": "standard"
}
Authentication
Authorization: Bearer YOUR_API_KEY
Body
Text prompt. The text description for generating the video. If the
is_rec recommended prompt parameter is used, the model will ignore the prompt entered in this parameter.Reference image. Upload a single image file for image-to-video scenarios. Supports passing an image Base64 encoding or an image URL (ensure it is accessible). Only 1 image is supported. Supported image formats: png, jpeg, jpg, webp. The image aspect ratio must be less than 1:4 or greater than 4:1, and the image size must not exceed 50 MB.
Aspect ratio. Optional values include
16:9 (default), 9:16, 3:4, 4:3, 1:1. Note: 3:4 and 4:3 are only supported by q2 and q3 models.Whether to use the audio-video direct output capability.
false: no direct audio-video output, produces a silent video; true: direct audio-video output is required, producing a video with dialogue and background sound.Voice ID, not effective for q3 models. Used to determine the voice timbre in the video; when empty, the system will automatically recommend one.
Whether to use recommended prompts.
true: the system automatically recommends prompts and uses the prompt content to generate the video, recommended prompt count = 1; false: generate the video based on the input prompt.Whether to add background music to the generated video.
true: the system will automatically select suitable music from the preset BGM library and add it; false: no BGM is added.Random seed. When not passed by default or passed as 0, a random number will be used instead. If set manually, the configured seed will be used.
Resolution. The default value depends on the model and video duration.
viduq2-pro 1-10 seconds: default 720p, optional: 540p, 720p, 1080p; viduq2-turbo 1-10 seconds: default 720p, optional: 540p, 720p, 1080p.Off-peak mode.
true: generate videos during off-peak hours; false: generate videos immediately.Watermark content, here it is an image URL. If not passed, the default watermark is used: content generated by AI.
Response
Task status. Optional values include
queued (in queue), processing (processing), completed (completed), failed (failed), cancelled (cancelled).