创建视频生成任务
curl --request POST \
--url https://www.anyfast.ai/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedance-2.0-ultra",
"content": [
{
"type": "text",
"text": "一只猫在阳光明媚的房间里弹钢琴"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.jpg"
},
"role": "reference_image"
}
],
"generate_audio": true,
"resolution": "720p",
"ratio": "adaptive",
"duration": 5,
"tools": [
{
"type": "web_search"
}
],
"watermark": false
}
'import requests
url = "https://www.anyfast.ai/v1/video/generations"
payload = {
"model": "seedance-2.0-ultra",
"content": [
{
"type": "text",
"text": "一只猫在阳光明媚的房间里弹钢琴"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/reference.jpg" },
"role": "reference_image"
}
],
"generate_audio": True,
"resolution": "720p",
"ratio": "adaptive",
"duration": 5,
"tools": [{ "type": "web_search" }],
"watermark": False
}
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: 'seedance-2.0-ultra',
content: [
{type: 'text', text: '一只猫在阳光明媚的房间里弹钢琴'},
{
type: 'image_url',
image_url: {url: 'https://example.com/reference.jpg'},
role: 'reference_image'
}
],
generate_audio: true,
resolution: '720p',
ratio: 'adaptive',
duration: 5,
tools: [{type: 'web_search'}],
watermark: false
})
};
fetch('https://www.anyfast.ai/v1/video/generations', 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.anyfast.ai/v1/video/generations",
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' => 'seedance-2.0-ultra',
'content' => [
[
'type' => 'text',
'text' => '一只猫在阳光明媚的房间里弹钢琴'
],
[
'type' => 'image_url',
'image_url' => [
'url' => 'https://example.com/reference.jpg'
],
'role' => 'reference_image'
]
],
'generate_audio' => true,
'resolution' => '720p',
'ratio' => 'adaptive',
'duration' => 5,
'tools' => [
[
'type' => 'web_search'
]
],
'watermark' => false
]),
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.anyfast.ai/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"seedance-2.0-ultra\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一只猫在阳光明媚的房间里弹钢琴\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/reference.jpg\"\n },\n \"role\": \"reference_image\"\n }\n ],\n \"generate_audio\": true,\n \"resolution\": \"720p\",\n \"ratio\": \"adaptive\",\n \"duration\": 5,\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ],\n \"watermark\": false\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.anyfast.ai/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedance-2.0-ultra\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一只猫在阳光明媚的房间里弹钢琴\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/reference.jpg\"\n },\n \"role\": \"reference_image\"\n }\n ],\n \"generate_audio\": true,\n \"resolution\": \"720p\",\n \"ratio\": \"adaptive\",\n \"duration\": 5,\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ],\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/video/generations")
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\": \"seedance-2.0-ultra\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一只猫在阳光明媚的房间里弹钢琴\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/reference.jpg\"\n },\n \"role\": \"reference_image\"\n }\n ],\n \"generate_audio\": true,\n \"resolution\": \"720p\",\n \"ratio\": \"adaptive\",\n \"duration\": 5,\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ],\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "cgt-20260312231129-7db6s",
"task_id": "cgt-20260312231129-7db6s",
"object": "video",
"model": "seedance-2.0-ultra",
"status": "",
"progress": 0,
"created_at": 1773328294
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}ByteDance
seedance-2.0-ultra
创建异步视频生成任务。支持多种输入方式:
- 文生视频
- 图生视频(首帧 / 首尾帧)
- 多模态参考(图片 + 视频 + 音频组合)
- 编辑视频
- 延长视频
- 联网搜索增强
提交后轮询 GET /v1/video/generations/{id} 直到 status 为 succeeded。
POST
/
v1
/
video
/
generations
创建视频生成任务
curl --request POST \
--url https://www.anyfast.ai/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedance-2.0-ultra",
"content": [
{
"type": "text",
"text": "一只猫在阳光明媚的房间里弹钢琴"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.jpg"
},
"role": "reference_image"
}
],
"generate_audio": true,
"resolution": "720p",
"ratio": "adaptive",
"duration": 5,
"tools": [
{
"type": "web_search"
}
],
"watermark": false
}
'import requests
url = "https://www.anyfast.ai/v1/video/generations"
payload = {
"model": "seedance-2.0-ultra",
"content": [
{
"type": "text",
"text": "一只猫在阳光明媚的房间里弹钢琴"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/reference.jpg" },
"role": "reference_image"
}
],
"generate_audio": True,
"resolution": "720p",
"ratio": "adaptive",
"duration": 5,
"tools": [{ "type": "web_search" }],
"watermark": False
}
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: 'seedance-2.0-ultra',
content: [
{type: 'text', text: '一只猫在阳光明媚的房间里弹钢琴'},
{
type: 'image_url',
image_url: {url: 'https://example.com/reference.jpg'},
role: 'reference_image'
}
],
generate_audio: true,
resolution: '720p',
ratio: 'adaptive',
duration: 5,
tools: [{type: 'web_search'}],
watermark: false
})
};
fetch('https://www.anyfast.ai/v1/video/generations', 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.anyfast.ai/v1/video/generations",
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' => 'seedance-2.0-ultra',
'content' => [
[
'type' => 'text',
'text' => '一只猫在阳光明媚的房间里弹钢琴'
],
[
'type' => 'image_url',
'image_url' => [
'url' => 'https://example.com/reference.jpg'
],
'role' => 'reference_image'
]
],
'generate_audio' => true,
'resolution' => '720p',
'ratio' => 'adaptive',
'duration' => 5,
'tools' => [
[
'type' => 'web_search'
]
],
'watermark' => false
]),
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.anyfast.ai/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"seedance-2.0-ultra\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一只猫在阳光明媚的房间里弹钢琴\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/reference.jpg\"\n },\n \"role\": \"reference_image\"\n }\n ],\n \"generate_audio\": true,\n \"resolution\": \"720p\",\n \"ratio\": \"adaptive\",\n \"duration\": 5,\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ],\n \"watermark\": false\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.anyfast.ai/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedance-2.0-ultra\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一只猫在阳光明媚的房间里弹钢琴\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/reference.jpg\"\n },\n \"role\": \"reference_image\"\n }\n ],\n \"generate_audio\": true,\n \"resolution\": \"720p\",\n \"ratio\": \"adaptive\",\n \"duration\": 5,\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ],\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/video/generations")
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\": \"seedance-2.0-ultra\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一只猫在阳光明媚的房间里弹钢琴\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/reference.jpg\"\n },\n \"role\": \"reference_image\"\n }\n ],\n \"generate_audio\": true,\n \"resolution\": \"720p\",\n \"ratio\": \"adaptive\",\n \"duration\": 5,\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ],\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "cgt-20260312231129-7db6s",
"task_id": "cgt-20260312231129-7db6s",
"object": "video",
"model": "seedance-2.0-ultra",
"status": "",
"progress": 0,
"created_at": 1773328294
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
模型 ID
可用选项:
seedance-2.0-ultra 示例:
"seedance-2.0-ultra"
输入内容数组,支持文本、图片、视频、音频的多种组合:
- 文本
- 文本(可选)+ 图片
- 文本(可选)+ 视频
- 文本(可选)+ 图片 + 音频
- 文本(可选)+ 图片 + 视频
- 文本(可选)+ 视频 + 音频
- 文本(可选)+ 图片 + 视频 + 音频
Show child attributes
Show child attributes
示例:
[
{ "type": "text", "text": "一只猫在阳光明媚的房间里弹钢琴" },
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.jpg"
},
"role": "reference_image"
}
]
控制生成视频是否包含同步音频。
true— 自动生成人声、音效和背景音乐false— 无声视频
输出视频分辨率。Ultra 必填。
可用选项:
720p, 1080p, 2k 示例:
"720p"
输出宽高比。adaptive 根据输入自动选择最合适的宽高比。
可用选项:
16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive 视频时长(秒),整数,4–15。
必填范围:
4 <= x <= 15模型调用的工具。当前支持联网搜索(仅文生视频)。
Show child attributes
Show child attributes
是否添加水印。
此页面对您有帮助吗?
⌘I