Create video generation
curl --request POST \
--url https://api.gravitex.ai/v1/video/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"content": [
{}
],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"ratio": "<string>",
"generate_audio": true,
"watermark": true,
"seed": 123
}
'import requests
url = "https://api.gravitex.ai/v1/video/generations"
payload = {
"model": "<string>",
"content": [{}],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"ratio": "<string>",
"generate_audio": True,
"watermark": True,
"seed": 123
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
content: [{}],
prompt: '<string>',
duration: 123,
resolution: '<string>',
ratio: '<string>',
generate_audio: true,
watermark: true,
seed: 123
})
};
fetch('https://api.gravitex.ai/v1/video/generations', 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.gravitex.ai/v1/video/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' => '<string>',
'content' => [
[
]
],
'prompt' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'ratio' => '<string>',
'generate_audio' => true,
'watermark' => true,
'seed' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.gravitex.ai/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"content\": [\n {}\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"ratio\": \"<string>\",\n \"generate_audio\": true,\n \"watermark\": true,\n \"seed\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.gravitex.ai/v1/video/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"content\": [\n {}\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"ratio\": \"<string>\",\n \"generate_audio\": true,\n \"watermark\": true,\n \"seed\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/video/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"content\": [\n {}\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"ratio\": \"<string>\",\n \"generate_audio\": true,\n \"watermark\": true,\n \"seed\": 123\n}"
response = http.request(request)
puts response.read_bodySeedance 2.0(/generations)
Create video generation
Seedance 2.0 POST /v1/video/generations
POST
/
v1
/
video
/
generations
Create video generation
curl --request POST \
--url https://api.gravitex.ai/v1/video/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"content": [
{}
],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"ratio": "<string>",
"generate_audio": true,
"watermark": true,
"seed": 123
}
'import requests
url = "https://api.gravitex.ai/v1/video/generations"
payload = {
"model": "<string>",
"content": [{}],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"ratio": "<string>",
"generate_audio": True,
"watermark": True,
"seed": 123
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
content: [{}],
prompt: '<string>',
duration: 123,
resolution: '<string>',
ratio: '<string>',
generate_audio: true,
watermark: true,
seed: 123
})
};
fetch('https://api.gravitex.ai/v1/video/generations', 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.gravitex.ai/v1/video/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' => '<string>',
'content' => [
[
]
],
'prompt' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'ratio' => '<string>',
'generate_audio' => true,
'watermark' => true,
'seed' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.gravitex.ai/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"content\": [\n {}\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"ratio\": \"<string>\",\n \"generate_audio\": true,\n \"watermark\": true,\n \"seed\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.gravitex.ai/v1/video/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"content\": [\n {}\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"ratio\": \"<string>\",\n \"generate_audio\": true,\n \"watermark\": true,\n \"seed\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/video/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"content\": [\n {}\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"ratio\": \"<string>\",\n \"generate_audio\": true,\n \"watermark\": true,\n \"seed\": 123\n}"
response = http.request(request)
puts response.read_bodyIntroduction
Submit an async Seedance 2.0 job; returnstask_id for polling. Provide at least one of content or prompt; content is recommended.
Authentication
string
required
Bearer Token, e.g.
Bearer sk-xxxxxxxxxxstring
application/jsonRequest body
string
required
seedance-2-0 or seedance-2-0-fastarray
Multimodal array (see below); at least one of
content or prompt requiredstring
Text prompt; simplified alternative to
contentinteger
default:"5"
-1 (auto) or 4โ15 secondsstring
default:"720p"
480p, 720p; standard also supports 1080p (fast: no 1080p)string
default:"16:9"
16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptive (recommended with first-frame images; not available in reference-image/video mode)boolean
default:"true"
Auto-generate audio; set
false when using reference_audioboolean
default:"false"
Add watermark
integer
default:"-1"
Random seed;
-1 for random; fixed positive integer for reproducibilitycontent array
| type | role | Description | Limit |
|---|---|---|---|
text | โ | Text prompt | 1 |
image_url | (omit) | Defaults to first frame | 1 |
image_url | first_frame | First frame | 1 |
image_url | last_frame | Last frame (requires first_frame) | 1 |
image_url | reference_image | Reference images | up to 9 |
video_url | reference_video | Reference videos | up to 3 |
audio_url | reference_audio | Reference audio (requires image/video) | up to 3 |
first_frame and reference_image are mutually exclusive; last_frame requires first_frame.
asset:// must match asset_type: Image โ image_url; Video โ video_url; Audio โ audio_url. Putting audio in image_url returns InvalidParameter.Asset asset_type | type | Field | role |
|---|---|---|---|
Image | image_url | image_url.url | reference_image / first_frame / last_frame |
Video | video_url | video_url.url | reference_video |
Audio | audio_url | audio_url.url | reference_audio |
Direct URL limits in content
When passing http(s) URLs directly incontent (not asset://), resources must meet these limits. asset:// references share the same numeric limits; asset library images allow more formatsโsee Create asset.
| Type | Main limits |
|---|---|
| Image | JPEG / PNG / WebP, โค 30MB, 300โ6000px; up to 9 reference_image; 1 first/last frame each |
| Video | MP4 / MOV, โค 50MB, 2โ15s per clip, up to 3 reference_video, total โค 15s |
| Audio | WAV / MP3, โค 15MB, 2โ15s per clip, up to 3; requires image or video input |
Examples
Text-to-video:curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0",
"content": [
{"type": "text", "text": "Golden hour drone shot over mountains and clouds"}
],
"duration": 5,
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true
}'
prompt (text-to-video):
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0",
"prompt": "Golden hour drone shot over mountains",
"duration": 5,
"resolution": "720p",
"ratio": "16:9"
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0",
"content": [
{"type": "text", "text": "Camera slowly pushes in, petals falling"},
{"type": "image_url", "image_url": {"url": "https://example.com/garden.jpg"}}
],
"ratio": "adaptive"
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0",
"content": [
{"type": "text", "text": "Time-lapse from sunrise to sunset"},
{"type": "image_url", "image_url": {"url": "https://example.com/sunrise.jpg"}, "role": "first_frame"},
{"type": "image_url", "image_url": {"url": "https://example.com/sunset.jpg"}, "role": "last_frame"}
],
"duration": 10,
"ratio": "adaptive"
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0",
"content": [
{"type": "text", "text": "Asset 1 sings with asset 2"},
{"type": "image_url", "image_url": {"url": "asset://asset-xxx-image"}, "role": "reference_image"},
{"type": "audio_url", "audio_url": {"url": "asset://asset-xxx-audio"}, "role": "reference_audio"}
],
"duration": 5,
"generate_audio": false
}'
Only active assets may be used; all referenced assets must belong to the same asset group.
Response
{
"id": "ut-abc123def456",
"task_id": "ut-abc123def456",
"object": "video",
"model": "seedance-2-0",
"status": "queued",
"progress": 0,
"created_at": 1712563200
}
โI
