Create video
curl --request POST \
--url https://api.aiohub.org/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedance-2-5-260628",
"prompt": "A blue ceramic cup on a wooden table in daylight.",
"seconds": "4",
"size": "1280x720"
}
'import requests
url = "https://api.aiohub.org/v1/videos"
payload = {
"model": "doubao-seedance-2-5-260628",
"prompt": "A blue ceramic cup on a wooden table in daylight.",
"seconds": "4",
"size": "1280x720"
}
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({
model: 'doubao-seedance-2-5-260628',
prompt: 'A blue ceramic cup on a wooden table in daylight.',
seconds: '4',
size: '1280x720'
})
};
fetch('https://api.aiohub.org/v1/videos', 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/videos",
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([
'model' => 'doubao-seedance-2-5-260628',
'prompt' => 'A blue ceramic cup on a wooden table in daylight.',
'seconds' => '4',
'size' => '1280x720'
]),
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/videos"
payload := strings.NewReader("{\n \"model\": \"doubao-seedance-2-5-260628\",\n \"prompt\": \"A blue ceramic cup on a wooden table in daylight.\",\n \"seconds\": \"4\",\n \"size\": \"1280x720\"\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/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedance-2-5-260628\",\n \"prompt\": \"A blue ceramic cup on a wooden table in daylight.\",\n \"seconds\": \"4\",\n \"size\": \"1280x720\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/v1/videos")
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 \"model\": \"doubao-seedance-2-5-260628\",\n \"prompt\": \"A blue ceramic cup on a wooden table in daylight.\",\n \"seconds\": \"4\",\n \"size\": \"1280x720\"\n}"
response = http.request(request)
puts response.read_body{
"id": "task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ",
"object": "video",
"model": "doubao-seedance-2-5-260628",
"status": "queued",
"progress": 0,
"created_at": 1791275108,
"seconds": "4",
"size": "1280x720"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Create video · OpenAI video
Submit a Seedance video task using OpenAI video, with examples, input limits and full parameters.
POST
/
v1
/
videos
Create video
curl --request POST \
--url https://api.aiohub.org/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedance-2-5-260628",
"prompt": "A blue ceramic cup on a wooden table in daylight.",
"seconds": "4",
"size": "1280x720"
}
'import requests
url = "https://api.aiohub.org/v1/videos"
payload = {
"model": "doubao-seedance-2-5-260628",
"prompt": "A blue ceramic cup on a wooden table in daylight.",
"seconds": "4",
"size": "1280x720"
}
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({
model: 'doubao-seedance-2-5-260628',
prompt: 'A blue ceramic cup on a wooden table in daylight.',
seconds: '4',
size: '1280x720'
})
};
fetch('https://api.aiohub.org/v1/videos', 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/videos",
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([
'model' => 'doubao-seedance-2-5-260628',
'prompt' => 'A blue ceramic cup on a wooden table in daylight.',
'seconds' => '4',
'size' => '1280x720'
]),
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/videos"
payload := strings.NewReader("{\n \"model\": \"doubao-seedance-2-5-260628\",\n \"prompt\": \"A blue ceramic cup on a wooden table in daylight.\",\n \"seconds\": \"4\",\n \"size\": \"1280x720\"\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/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedance-2-5-260628\",\n \"prompt\": \"A blue ceramic cup on a wooden table in daylight.\",\n \"seconds\": \"4\",\n \"size\": \"1280x720\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiohub.org/v1/videos")
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 \"model\": \"doubao-seedance-2-5-260628\",\n \"prompt\": \"A blue ceramic cup on a wooden table in daylight.\",\n \"seconds\": \"4\",\n \"size\": \"1280x720\"\n}"
response = http.request(request)
puts response.read_body{
"id": "task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ",
"object": "video",
"model": "doubao-seedance-2-5-260628",
"status": "queued",
"progress": 0,
"created_at": 1791275108,
"seconds": "4",
"size": "1280x720"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Use this format with an existing OpenAI SDK
The creation response includes these fields. Save
After saving the task identifier, poll the task.
client.videos integration. It supports text or one first-frame image at 720p. Use Ark / Seedance for reference audio, multiple reference images and video editing.
Setup
Set the OpenAI SDK base URL tohttps://api.aiohub.org/v1 and supply your full AIOHub sk- API key. This is the video API, not Chat Completions or Responses.
Example request
Replace<AIOHUB_API_KEY> with your full API key. Its group must include the Seedance model used here.
curl https://api.aiohub.org/v1/videos \
-H "Authorization: Bearer <AIOHUB_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-5-260628",
"prompt": "A blue ceramic cup on a wooden table in daylight.",
"seconds": "4",
"size": "1280x720"
}'
id; do not submit another creation request to check progress.
{"id": "task_example", "object": "video", "status": "queued", "progress": 0}
Parameter limits
Useapplication/json for JSON requests and multipart/form-data with the input_reference field for file uploads. Crop or resize an image to match size before submitting.
Complete SDK example
Complete SDK example
Install the
openai SDK and set AIOHUB_API_KEY in your environment. These examples download only after generation succeeds.import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["AIOHUB_API_KEY"], base_url="https://api.aiohub.org/v1")
video = client.videos.create(
model="doubao-seedance-2-5-260628",
prompt="A blue ceramic cup on a wooden table in daylight, slow camera push-in.",
seconds="4",
size="1280x720",
)
video = client.videos.poll(video.id)
if video.status != "completed":
raise RuntimeError(f"Video generation failed: {video.error}")
with open("video.mp4", "wb") as f:
f.write(client.videos.download_content(video.id).read())
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.AIOHUB_API_KEY, baseURL: "https://api.aiohub.org/v1" });
let video = await client.videos.create({
model: "doubao-seedance-2-5-260628",
prompt: "A blue ceramic cup on a wooden table in daylight, slow camera push-in.",
seconds: "4",
size: "1280x720",
});
while (video.status !== "completed" && video.status !== "failed") {
await new Promise((r) => setTimeout(r, 15000));
video = await client.videos.retrieve(video.id);
}
if (video.status !== "completed") {
throw new Error(JSON.stringify(video.error));
}
const bytes = await (await client.videos.downloadContent(video.id)).arrayBuffer();
If creation times out without a task identifier, check the usage log before resubmitting to avoid duplicate generation and charges. Correct parameters after a 400 and check the API key after a 401. See Authentication for access and quota requirements.
Authorizations
API key (sk-xxx)
Body
application/jsonmultipart/form-data
Model name
Example:
"doubao-seedance-2-5-260628"
Prompt
Example:
"A blue ceramic cup on a wooden table in daylight, slow camera push-in."
Duration in seconds
Example:
"4"
Video size
Example:
"1280x720"
First-frame image as an HTTPS URL or data URL
Example:
"https://example.com/first.png"
Response
Video task created successfully
Video ID
Object type
Model used
Task status
Progress percentage
Creation timestamp
Video duration
Completion timestamp
Expiration timestamp
Video size
OpenAI video error information
Show child attributes
Show child attributes
Additional metadata