Download Video File
curl --request GET \
--url https://api.powertokens.ai/v1/videos/{task_id}/content \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/v1/videos/{task_id}/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/v1/videos/{task_id}/content', 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.powertokens.ai/v1/videos/{task_id}/content",
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.powertokens.ai/v1/videos/{task_id}/content"
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.powertokens.ai/v1/videos/{task_id}/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/v1/videos/{task_id}/content")
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"<string>"{
"code": "task_not_ready",
"message": "Task has not completed yet and cannot be downloaded",
"data": null
}{
"code": "access_denied",
"message": "Invalid token",
"data": null
}{
"code": "task_not_found",
"message": "Task does not exist or has expired",
"data": null
}{
"code": "insufficient_user_quota",
"message": "Insufficient account quota, please try again later",
"data": null
}{
"code": "gen_relay_info_failed",
"message": "Internal processing failed, please try again later",
"data": null
}{
"code": "bad_response_status_code",
"message": "The upstream provider returned an invalid response",
"data": null
}{
"code": "get_channel_failed",
"message": "No available channel for the current model, please try again later",
"data": null
}Video Models
Download Video File
Download the final video file after an asynchronous video task completes.
Use this endpoint when you need to obtain the media file directly, rather than handling a temporary result URL.
GET
/
v1
/
videos
/
{task_id}
/
content
Download Video File
curl --request GET \
--url https://api.powertokens.ai/v1/videos/{task_id}/content \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/v1/videos/{task_id}/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/v1/videos/{task_id}/content', 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.powertokens.ai/v1/videos/{task_id}/content",
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.powertokens.ai/v1/videos/{task_id}/content"
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.powertokens.ai/v1/videos/{task_id}/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/v1/videos/{task_id}/content")
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"<string>"{
"code": "task_not_ready",
"message": "Task has not completed yet and cannot be downloaded",
"data": null
}{
"code": "access_denied",
"message": "Invalid token",
"data": null
}{
"code": "task_not_found",
"message": "Task does not exist or has expired",
"data": null
}{
"code": "insufficient_user_quota",
"message": "Insufficient account quota, please try again later",
"data": null
}{
"code": "gen_relay_info_failed",
"message": "Internal processing failed, please try again later",
"data": null
}{
"code": "bad_response_status_code",
"message": "The upstream provider returned an invalid response",
"data": null
}{
"code": "get_channel_failed",
"message": "No available channel for the current model, please try again later",
"data": null
}⌘I