Node.js
import GetimgAI from "getimg-ai";
const client = new GetimgAI();
const { id } = await client.videos.generations.create({
model: "seedance-v1-pro",
prompt: "A drone shot over a futuristic city skyline at sunset",
aspect_ratio: "16:9",
resolution: "1080p",
duration: 5,
sound: false,
});from getimg import GetimgAI
client = GetimgAI()
submission = client.videos.generations.create(
model="seedance-v1-pro",
prompt="A drone shot over a futuristic city skyline at sunset",
aspect_ratio="16:9",
resolution="1080p",
duration=5,
sound=False,
)
curl --request POST \
--url https://api.getimg.ai/v2/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedance-v1-pro",
"prompt": "A drone shot over a futuristic city skyline at sunset",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5,
"sound": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getimg.ai/v2/videos/generations",
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' => 'seedance-v1-pro',
'prompt' => 'A drone shot over a futuristic city skyline at sunset',
'aspect_ratio' => '16:9',
'resolution' => '1080p',
'duration' => 5,
'sound' => false
]),
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.getimg.ai/v2/videos/generations"
payload := strings.NewReader("{\n \"model\": \"seedance-v1-pro\",\n \"prompt\": \"A drone shot over a futuristic city skyline at sunset\",\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"duration\": 5,\n \"sound\": false\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.getimg.ai/v2/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedance-v1-pro\",\n \"prompt\": \"A drone shot over a futuristic city skyline at sunset\",\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"duration\": 5,\n \"sound\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getimg.ai/v2/videos/generations")
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\": \"seedance-v1-pro\",\n \"prompt\": \"A drone shot over a futuristic city skyline at sunset\",\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"duration\": 5,\n \"sound\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "req-01HXYZVIDEO1234",
"status": "pending"
}Videos
Create a video generation
Submit a video generation request and return a pending result.
POST
/
v2
/
videos
/
generations
Node.js
import GetimgAI from "getimg-ai";
const client = new GetimgAI();
const { id } = await client.videos.generations.create({
model: "seedance-v1-pro",
prompt: "A drone shot over a futuristic city skyline at sunset",
aspect_ratio: "16:9",
resolution: "1080p",
duration: 5,
sound: false,
});from getimg import GetimgAI
client = GetimgAI()
submission = client.videos.generations.create(
model="seedance-v1-pro",
prompt="A drone shot over a futuristic city skyline at sunset",
aspect_ratio="16:9",
resolution="1080p",
duration=5,
sound=False,
)
curl --request POST \
--url https://api.getimg.ai/v2/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedance-v1-pro",
"prompt": "A drone shot over a futuristic city skyline at sunset",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5,
"sound": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getimg.ai/v2/videos/generations",
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' => 'seedance-v1-pro',
'prompt' => 'A drone shot over a futuristic city skyline at sunset',
'aspect_ratio' => '16:9',
'resolution' => '1080p',
'duration' => 5,
'sound' => false
]),
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.getimg.ai/v2/videos/generations"
payload := strings.NewReader("{\n \"model\": \"seedance-v1-pro\",\n \"prompt\": \"A drone shot over a futuristic city skyline at sunset\",\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"duration\": 5,\n \"sound\": false\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.getimg.ai/v2/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedance-v1-pro\",\n \"prompt\": \"A drone shot over a futuristic city skyline at sunset\",\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"duration\": 5,\n \"sound\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getimg.ai/v2/videos/generations")
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\": \"seedance-v1-pro\",\n \"prompt\": \"A drone shot over a futuristic city skyline at sunset\",\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"duration\": 5,\n \"sound\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "req-01HXYZVIDEO1234",
"status": "pending"
}Authorizations
Send your API key as a bearer token:
Authorization: Bearer sk_<secret>.
Body
application/json
AI model ID. See supported models.
Description of the video to generate.
Required string length:
1 - 4096Optional reference images. See supported values by model.
Maximum array length:
8Show child attributes
Show child attributes
Optional output aspect ratio. See supported values by model.
Optional output resolution. See supported values by model.
Optional duration in seconds. See supported values by model.
Set to true to generate audio when supported by the model.
⌘I