Flux 3
Отримання відео Flux 3
Отримайте завдання відео Flux 3 за ID завдання, включно з його статусом, прогресом, часовими мітками, URL результату або відомостями про помилку.
GET
/
v1
/
videos
/
{task_id}
cURL
curl "https://api.cometapi.com/v1/videos/<task_id>" \
-H "Authorization: Bearer $COMETAPI_KEY"import os
import requests
task_id = "<task_id>"
response = requests.get(
f"https://api.cometapi.com/v1/videos/{task_id}",
headers={
"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
},
timeout=60,
)
response.raise_for_status()
print(response.json())
const taskId = "<task_id>";
const response = await fetch(
`https://api.cometapi.com/v1/videos/${taskId}`,
{ headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` } },
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/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.cometapi.com/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.cometapi.com/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/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": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}Використовуйте цей endpoint після створення завдання відео Flux 3. Відповідь містить
video_url, коли завдання завершено.
Перевірте ці поля
statusмає одне зі значень:queued,in_progress,completedабоfailed.progressє приблизним відсотком завершення від0до100.video_urlз’являється, коли завдання завершено.errorз’являється, коли виконання завдання завершується помилкою.
Опитування завдання
1
Спочатку створіть завдання
Почніть із Створення відео Flux 3 і збережіть отриманий
id.2
Отримання стану завдання
Надсилайте ID завдання до цього endpoint, доки
status не дорівнюватиме completed або failed.3
Завантаження файлу MP4
Коли
status дорівнює completed, викличте Завантаження відеовмісту Flux 3.Відповідь
Current Flux 3 video task state.
Останнє оновлення 14 серпня 2026 р.
⌘I
cURL
curl "https://api.cometapi.com/v1/videos/<task_id>" \
-H "Authorization: Bearer $COMETAPI_KEY"import os
import requests
task_id = "<task_id>"
response = requests.get(
f"https://api.cometapi.com/v1/videos/{task_id}",
headers={
"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
},
timeout=60,
)
response.raise_for_status()
print(response.json())
const taskId = "<task_id>";
const response = await fetch(
`https://api.cometapi.com/v1/videos/${taskId}`,
{ headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` } },
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/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.cometapi.com/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.cometapi.com/v1/videos/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/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": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}