查询 Seedance 视频生成任务
curl --request GET \
--url https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}', 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://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "task_20261020080000abcdef",
"model": "dreamina-seedance-2-0-260128",
"status": "succeeded",
"content": {
"video_url": "https://media.example.com/result.mp4?signature=xxx",
"expireAt": 1792483200
},
"created_at": 1792396500,
"updated_at": 1792396800,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true,
"framespersecond": 24,
"priority": 0,
"usage": {
"completion_tokens": 100000,
"total_tokens": 100000
}
}{
"error": {
"code": "AuthenticationError",
"message": "The API key is missing or invalid.",
"param": "",
"type": "Unauthorized"
}
}{
"error": {
"code": "AccountOverdueError",
"message": "Your account balance is insufficient.",
"param": "",
"type": "Forbidden"
}
}{
"error": {
"code": "NotFound",
"message": "The specified task task_20261020080000abcdef is not found.",
"param": "",
"type": "NotFound"
}
}{
"error": {
"code": "AccountRateLimitExceeded",
"message": "Too many requests, please retry later.",
"param": "",
"type": "TooManyRequests"
}
}视频
/api/v3/contents/generations/tasks/{task_id}
按任务 ID 查询生成状态与结果。
GET
/
api
/
v3
/
contents
/
generations
/
tasks
/
{task_id}
查询 Seedance 视频生成任务
curl --request GET \
--url https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}', 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://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-vip.apigo.ai/api/v3/contents/generations/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "task_20261020080000abcdef",
"model": "dreamina-seedance-2-0-260128",
"status": "succeeded",
"content": {
"video_url": "https://media.example.com/result.mp4?signature=xxx",
"expireAt": 1792483200
},
"created_at": 1792396500,
"updated_at": 1792396800,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true,
"framespersecond": 24,
"priority": 0,
"usage": {
"completion_tokens": 100000,
"total_tokens": 100000
}
}{
"error": {
"code": "AuthenticationError",
"message": "The API key is missing or invalid.",
"param": "",
"type": "Unauthorized"
}
}{
"error": {
"code": "AccountOverdueError",
"message": "Your account balance is insufficient.",
"param": "",
"type": "Forbidden"
}
}{
"error": {
"code": "NotFound",
"message": "The specified task task_20261020080000abcdef is not found.",
"param": "",
"type": "NotFound"
}
}{
"error": {
"code": "AccountRateLimitExceeded",
"message": "Too many requests, please retry later.",
"param": "",
"type": "TooManyRequests"
}
}使用
Authorization: Bearer <API_KEY> 鉴权。
任务状态
| status | 说明 |
|---|---|
queued | 排队中 |
running | 生成中 |
succeeded | 生成成功,成片地址位于 content.video_url |
failed | 生成失败,原因位于 error |
cancelled | 已取消 |
expired | 已过期 |
queued 和 running 需继续轮询,其余为终态。建议每 10 秒查询一次。
结果字段
content.video_url是有时效的下载地址,请在过期前转存。过期后再查询不再返回video_url。content.expireAt是video_url的过期时间(Unix 秒)。created_at、updated_at为 Unix 秒。usage为实际用量。priority、safety_identifier等字段是否返回,取决于创建时是否传入以及任务状态。
生成失败
任务创建后也可能生成失败。此时查询接口返回 HTTP 200,status 为 failed,error 中包含 code、type 和 message。参数或内容审核导致的失败返回对应错误码;服务内部或上游原因导致的失败,code 为 InternalServiceError。
{
"id": "task_20261020080000abcdef",
"model": "dreamina-seedance-2-0-260128",
"status": "failed",
"error": {
"code": "InternalServiceError",
"type": "InternalServerError",
"message": "Media generation failed."
},
"created_at": 1792396500,
"updated_at": 1792396620
}
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
创建任务时返回的 id。
示例:
"task_20261020080000abcdef"
响应
任务详情
任务 ID。
模型 ID。
任务状态。queued、running 为进行中;succeeded、failed、cancelled、expired 为终态。
可用选项:
queued, running, succeeded, failed, cancelled, expired 生成结果,status=succeeded 时返回。
Show child attributes
Show child attributes
失败原因,status=failed 时返回。
Show child attributes
Show child attributes
创建时间,Unix 秒。
更新时间,Unix 秒。
输出分辨率,例如 720p。
画面比例,例如 16:9、1:1。
视频时长(秒)。
是否生成声音。使用参考音频或参考视频原声时传 true。
帧率。
任务优先级。传入后会在查询结果中回传。
终端用户标识,建议使用不可逆的哈希值。传入后会在查询结果中回传。
实际用量。
Show child attributes
Show child attributes
