获取 OpenAI 兼容视频任务
curl --request GET \
--url https://kaienapi.com/v1/videos/{video_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://kaienapi.com/v1/videos/{video_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kaienapi.com/v1/videos/{video_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kaienapi.com/v1/videos/{video_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))
}{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}获取 OpenAI 兼容视频任务
统一根据任务 ID 查询视频任务状态和结果。任务可以来自 /v1/videos、/v1/video/generations 或 /api/v3/contents/generations/tasks;优先使用创建响应中的 Kaien 公开任务 ID,官方豆包任务也兼容其上游任务 ID。
查询顺序
- 调用任一视频创建入口并保存返回的任务 ID。
- 轮询本接口,直到状态进入完成或失败。
- 完成后调用
/v1/videos/{video_id}/content获取视频,或继续调用 remix。
轮询处理
前端每隔几秒查询一次,不要无间隔重复请求。保存任务 ID、创建时间、状态和最终结果,用户稍后回到页面仍能继续查看。
GET
/
v1
/
videos
/
{video_id}
获取 OpenAI 兼容视频任务
curl --request GET \
--url https://kaienapi.com/v1/videos/{video_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://kaienapi.com/v1/videos/{video_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kaienapi.com/v1/videos/{video_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kaienapi.com/v1/videos/{video_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))
}{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}