Get Jimeng video task
curl --request POST \
--url https://api.aiohub.org/jimeng/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"req_key": "doubao-seedance-2-0-fast-260128",
"task_id": "task_example"
}
'import requests
url = "https://api.aiohub.org/jimeng/"
payload = {
"req_key": "doubao-seedance-2-0-fast-260128",
"task_id": "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({req_key: 'doubao-seedance-2-0-fast-260128', task_id: 'task_example'})
};
fetch('https://api.aiohub.org/jimeng/', 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/jimeng/",
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([
'req_key' => 'doubao-seedance-2-0-fast-260128',
'task_id' => '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/jimeng/"
payload := strings.NewReader("{\n \"req_key\": \"doubao-seedance-2-0-fast-260128\",\n \"task_id\": \"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/jimeng/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"req_key\": \"doubao-seedance-2-0-fast-260128\",\n \"task_id\": \"task_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/jimeng/")
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 \"req_key\": \"doubao-seedance-2-0-fast-260128\",\n \"task_id\": \"task_example\"\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"message": "",
"data": {
"task_id": "task_example",
"status": "IN_PROGRESS",
"progress": "50%",
"fail_reason": ""
}
}
Get video · Jimeng compatible
Check task status, handle failures and find the completed video.
POST
/
jimeng
/
Get Jimeng video task
curl --request POST \
--url https://api.aiohub.org/jimeng/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"req_key": "doubao-seedance-2-0-fast-260128",
"task_id": "task_example"
}
'import requests
url = "https://api.aiohub.org/jimeng/"
payload = {
"req_key": "doubao-seedance-2-0-fast-260128",
"task_id": "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({req_key: 'doubao-seedance-2-0-fast-260128', task_id: 'task_example'})
};
fetch('https://api.aiohub.org/jimeng/', 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/jimeng/",
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([
'req_key' => 'doubao-seedance-2-0-fast-260128',
'task_id' => '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/jimeng/"
payload := strings.NewReader("{\n \"req_key\": \"doubao-seedance-2-0-fast-260128\",\n \"task_id\": \"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/jimeng/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"req_key\": \"doubao-seedance-2-0-fast-260128\",\n \"task_id\": \"task_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/jimeng/")
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 \"req_key\": \"doubao-seedance-2-0-fast-260128\",\n \"task_id\": \"task_example\"\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"message": "",
"data": {
"task_id": "task_example",
"status": "IN_PROGRESS",
"progress": "50%",
"fail_reason": ""
}
}
Polling and status
Replace<TASK_ID> with the returned task_id, keep the same req_key and poll every 10 to 15 seconds:
curl "https://api.aiohub.org/jimeng/?Action=CVSync2AsyncGetResult&Version=2022-08-31" \
-H "Authorization: Bearer <AIOHUB_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"req_key": "doubao-seedance-2-0-fast-260128",
"task_id": "<TASK_ID>"
}'
data.status | Action |
|---|---|
SUBMITTED / QUEUED / IN_PROGRESS | Keep polling |
SUCCESS | Read data.result_url and download |
FAILURE | Stop polling and read data.fail_reason |
code: success means the read succeeded, not that generation is complete. A successful task includes:
{
"code": "success",
"data": {
"status": "SUCCESS",
"result_url": "https://api.aiohub.org/v1/videos/task_example/content"
}
}
Failures and retries
After a polling disconnect, retry with the sametask_id. On FAILURE, read data.fail_reason. Do not use CVSync2AsyncSubmitTask to retry a read. 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)
Query Parameters
Operation name; use this page's fixed value.
Available options:
CVSync2AsyncGetResult Protocol version.
Available options:
2022-08-31 Body
application/json