查询视频任务
curl --request GET \
--url https://api.chenyu.cn/v1/videos/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chenyu.cn/v1/videos/{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": "<string>",
"object": "<string>",
"model": "<string>",
"status": "<string>",
"url": "<string>",
"error": {}
}直接 API 调用
查询视频任务
查询视频生成任务状态和结果
GET
/
v1
/
videos
/
{task_id}
查询视频任务
curl --request GET \
--url https://api.chenyu.cn/v1/videos/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{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.chenyu.cn/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chenyu.cn/v1/videos/{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": "<string>",
"object": "<string>",
"model": "<string>",
"status": "<string>",
"url": "<string>",
"error": {}
}查询视频任务
根据任务 ID 查询视频生成任务状态和结果。请求参数
响应参数
视频任务 ID
固定为
video模型 ID
任务状态,如
queued、running、completed、failed、cancelled视频地址。仅任务完成后返回
失败信息。仅任务失败时返回
代码示例
import requests
task_id = "cgt-20260602154730-twmv2"
url = f"https://api.chenyu.cn/v1/videos/{task_id}"
headers = {"Authorization": "Bearer your_api_key"}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
const taskId = 'cgt-20260602154730-twmv2';
axios.get(`https://api.chenyu.cn/v1/videos/${taskId}`, {
headers: {
Authorization: 'Bearer your_api_key'
}
}).then((response) => {
console.log(response.data);
});
curl -X GET "https://api.chenyu.cn/v1/videos/cgt-20260602154730-twmv2" \
-H "Authorization: Bearer your_api_key"
响应示例
{
"id": "cgt-20260602154730-twmv2",
"object": "video",
"model": "doubao-seedance-2-0-fast-260128",
"status": "completed",
"url": "https://example.com/video.mp4"
}
⌘I