Get Vertex video task
curl --request POST \
--url https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operationName": "publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example"
}
'import requests
url = "https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation"
payload = { "operationName": "publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operationName: 'publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example'
})
};
fetch('https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation', 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.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operationName' => 'publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation"
payload := strings.NewReader("{\n \"operationName\": \"publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operationName\": \"publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operationName\": \"publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example\"\n}"
response = http.request(request)
puts response.read_body{
"name": "publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example",
"done": false
}Get video · Vertex AI
Check task status, handle failures and find the completed video.
POST
/
v1
/
publishers
/
{publisher}
/
models
/
{model}
:fetchPredictOperation
Get Vertex video task
curl --request POST \
--url https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operationName": "publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example"
}
'import requests
url = "https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation"
payload = { "operationName": "publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operationName: 'publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example'
})
};
fetch('https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation', 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.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operationName' => 'publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation"
payload := strings.NewReader("{\n \"operationName\": \"publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operationName\": \"publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/v1/publishers/{publisher}/models/{model}:fetchPredictOperation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operationName\": \"publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example\"\n}"
response = http.request(request)
puts response.read_body{
"name": "publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example",
"done": false
}Polling and status
Replace<OPERATION_NAME> with the full name from creation and poll every 10 to 15 seconds:
curl "https://api.aiohub.org/v1/publishers/bytedance/models/doubao-seedance-2-5-260628:fetchPredictOperation" \
-H "Authorization: Bearer <AIOHUB_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"operationName": "<OPERATION_NAME>"}'
| Response | Action |
|---|---|
done: false | Keep polling |
done: true with response | Download the video |
done: true with error | Stop polling and read error.message |
done: true means the operation ended, not necessarily that it succeeded.
Read a successful result
Key fields in a successful response:{
"name": "publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example",
"done": true,
"response": {
"videos": [
{
"gcsUri": "https://api.aiohub.org/v1/videos/task_example/content",
"mimeType": "video/mp4"
}
]
}
}
response.videos[0].gcsUri is an AIOHub HTTPS URL, not a gs:// object. Download with an HTTP client; Google Cloud Storage is not required.
After success, download the video.
Failures and retries
After a polling disconnect, keep polling the samename rather than calling predictLongRunning again. Correct fields before retrying a 400. If a terminal operation has error, do not read the success response fields. Files remain for 72 hours and task records for 7 days.
After a 429 or temporary service error, wait before retrying the read; do not create another task. If a task is missing, check the identifier and the account that owns the API key.Authorizations
API key (sk-xxx)
Path Parameters
Model publisher; Seedance examples use bytedance.
Example:
"bytedance"
Full Seedance model name.
Example:
"doubao-seedance-2-5-260628"
Body
application/json
Pass the complete name from creation unchanged.
Response
Current task state; generation failures can also return HTTP 200.