获取 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 查询 OpenAI 风格视频任务状态。
查询顺序
POST /v1/videos创建任务。- 轮询本接口,直到状态进入完成或失败。
- 完成后下载视频内容,或继续调用 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>"
}
}