Query video generation task
curl --request GET \
--url https://api.siray.ai/v1/video/generations/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siray.ai/v1/video/generations/{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{
"code": "success",
"message": "",
"data": {
"task_id": "video_69196fafcc9c8190acccf32e9b560c3f0da8a6d1948cfaa5",
"status": "SUCCESS",
"progress": "100%",
"outputs": [
"https://api.siray.ai/redirect/example-output"
],
"start_time": 1763274702,
"finish_time": 1763274838,
"submit_time": 1763274672,
"fail_code": "",
"fail_reason": ""
}
}API documentation
Video Task Status API
Monitor asynchronous t2v/i2v generation tasks and download the produced video assets.
GET
/
v1
/
video
/
generations
/
{task_id}
Query video generation task
curl --request GET \
--url https://api.siray.ai/v1/video/generations/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{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.siray.ai/v1/video/generations/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siray.ai/v1/video/generations/{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{
"code": "success",
"message": "",
"data": {
"task_id": "video_69196fafcc9c8190acccf32e9b560c3f0da8a6d1948cfaa5",
"status": "SUCCESS",
"progress": "100%",
"outputs": [
"https://api.siray.ai/redirect/example-output"
],
"start_time": 1763274702,
"finish_time": 1763274838,
"submit_time": 1763274672,
"fail_code": "",
"fail_reason": ""
}
}Overview
All text-to-video or image-to-video submissions return atask_id. Use the video task status endpoint to poll the job until it finishes. The payload mirrors the async submission response and includes downloadable asset URLs when the task succeeds.
Poll every 3–5 seconds to balance freshness with API usage efficiency.
Endpoint
GET https://api.siray.ai/v1/video/generations/{task_id}
Authorization: Bearer <SIRAY_API_TOKEN>
| Name | Description |
|---|---|
task_id | ID returned when the video task was created. |
Response structure
{
"code": "success",
"message": "",
"data": {
"task_id": "video_69196fafcc9c8190acccf32e9b560c3f0da8a6d1948cfaa5",
"status": "SUCCESS",
"progress": "100%",
"outputs": [
"https://api.siray.ai/redirect/example-output"
],
"start_time": 1763274702,
"finish_time": 1763274838,
"submit_time": 1763274672,
"fail_code": "",
"fail_reason": ""
}
}
Fields
code/message: Service-level indicators for the polling request.data.task_id: Echo of the video task identifier.data.status: Lifecycle state — values listed below.data.progress: Human-readable progress string.data.outputs: URLs pointing to the generated video assets (present whenstatusisSUCCESS).data.fail_code: Machine-readable failure code whenstatusisFAILURE. See fail_code.data.fail_reason: Explains why processing stopped whenstatusisFAILURE.data.submit_time,data.start_time,data.finish_time: Unix timestamps that help track total latency.
Status values
| Status | Meaning |
|---|---|
NOT_START | Task accepted but preprocessing has not started yet. |
SUBMITTED | Request stored and waiting to enter the queue. |
QUEUED | Task is scheduled and waiting for compute resources. |
IN_PROGRESS | Generation is currently running. |
SUCCESS | Outputs are ready; download the video via the provided URLs. |
FAILURE | Irrecoverable error; inspect fail_code and fail_reason for remediation steps. |
Usage example
curl -X GET "https://api.siray.ai/v1/video/generations/${TASK_ID}" \
-H "Authorization: Bearer ${SIRAY_API_TOKEN}"
WhenstatusreachesSUCCESS, stream or download the video from the URLs inoutputs. If the task fails, retry after resolving the underlying issue noted infail_code/fail_reason.
Authorizations
Bearer authentication using API key
Path Parameters
Identifier returned from the video generation task submission
Response
200 - application/json
Task status and (if available) generated outputs
