Generate video using seedance2.0
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "bytedance/seedance2-0-i2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.",
"img_urls": [
"https://example.com/frame_start.png",
"https://example.com/frame_end.png"
],
"resolution": "720p",
"aspect_ratio": "auto",
"duration": 6,
"audio": true,
"byteplus_fallback": false,
"return_last_frame": false
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "bytedance/seedance2-0-i2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.",
"img_urls": ["https://example.com/frame_start.png", "https://example.com/frame_end.png"],
"resolution": "720p",
"aspect_ratio": "auto",
"duration": 6,
"audio": True,
"byteplus_fallback": False,
"return_last_frame": False
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'bytedance/seedance2-0-i2v',
callback_url: 'https://your-domain.com/api/callback',
input: {
prompt: 'The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.',
img_urls: ['https://example.com/frame_start.png', 'https://example.com/frame_end.png'],
resolution: '720p',
aspect_ratio: 'auto',
duration: 6,
audio: true,
byteplus_fallback: false,
return_last_frame: false
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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.crun.ai/api/v1/client/job/CreateTask",
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' => 'bytedance/seedance2-0-i2v',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'prompt' => 'The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.',
'img_urls' => [
'https://example.com/frame_start.png',
'https://example.com/frame_end.png'
],
'resolution' => '720p',
'aspect_ratio' => 'auto',
'duration' => 6,
'audio' => true,
'byteplus_fallback' => false,
'return_last_frame' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance2-0-i2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.\",\n \"img_urls\": [\n \"https://example.com/frame_start.png\",\n \"https://example.com/frame_end.png\"\n ],\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"auto\",\n \"duration\": 6,\n \"audio\": true,\n \"byteplus_fallback\": false,\n \"return_last_frame\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"bytedance/seedance2-0-i2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.\",\n \"img_urls\": [\n \"https://example.com/frame_start.png\",\n \"https://example.com/frame_end.png\"\n ],\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"auto\",\n \"duration\": 6,\n \"audio\": true,\n \"byteplus_fallback\": false,\n \"return_last_frame\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"bytedance/seedance2-0-i2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.\",\n \"img_urls\": [\n \"https://example.com/frame_start.png\",\n \"https://example.com/frame_end.png\"\n ],\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"auto\",\n \"duration\": 6,\n \"audio\": true,\n \"byteplus_fallback\": false,\n \"return_last_frame\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}{
"code": 422,
"message": "Missing Params or Type Error",
"errors": [
"specific error field message"
]
}Seedance2.0
Seedance 2.0 - Image to Video
Transform images into dynamic videos powered by Bytedance’s advanced Seedance 2.0 model
POST
/
api
/
v1
/
client
/
job
/
CreateTask
Generate video using seedance2.0
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "bytedance/seedance2-0-i2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.",
"img_urls": [
"https://example.com/frame_start.png",
"https://example.com/frame_end.png"
],
"resolution": "720p",
"aspect_ratio": "auto",
"duration": 6,
"audio": true,
"byteplus_fallback": false,
"return_last_frame": false
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "bytedance/seedance2-0-i2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.",
"img_urls": ["https://example.com/frame_start.png", "https://example.com/frame_end.png"],
"resolution": "720p",
"aspect_ratio": "auto",
"duration": 6,
"audio": True,
"byteplus_fallback": False,
"return_last_frame": False
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'bytedance/seedance2-0-i2v',
callback_url: 'https://your-domain.com/api/callback',
input: {
prompt: 'The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.',
img_urls: ['https://example.com/frame_start.png', 'https://example.com/frame_end.png'],
resolution: '720p',
aspect_ratio: 'auto',
duration: 6,
audio: true,
byteplus_fallback: false,
return_last_frame: false
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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.crun.ai/api/v1/client/job/CreateTask",
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' => 'bytedance/seedance2-0-i2v',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'prompt' => 'The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.',
'img_urls' => [
'https://example.com/frame_start.png',
'https://example.com/frame_end.png'
],
'resolution' => '720p',
'aspect_ratio' => 'auto',
'duration' => 6,
'audio' => true,
'byteplus_fallback' => false,
'return_last_frame' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance2-0-i2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.\",\n \"img_urls\": [\n \"https://example.com/frame_start.png\",\n \"https://example.com/frame_end.png\"\n ],\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"auto\",\n \"duration\": 6,\n \"audio\": true,\n \"byteplus_fallback\": false,\n \"return_last_frame\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"bytedance/seedance2-0-i2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.\",\n \"img_urls\": [\n \"https://example.com/frame_start.png\",\n \"https://example.com/frame_end.png\"\n ],\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"auto\",\n \"duration\": 6,\n \"audio\": true,\n \"byteplus_fallback\": false,\n \"return_last_frame\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"bytedance/seedance2-0-i2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"The dancer turns toward the camera and the silk dress flows naturally in the wind while the background city lights shimmer.\",\n \"img_urls\": [\n \"https://example.com/frame_start.png\",\n \"https://example.com/frame_end.png\"\n ],\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"auto\",\n \"duration\": 6,\n \"audio\": true,\n \"byteplus_fallback\": false,\n \"return_last_frame\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}{
"code": 422,
"message": "Missing Params or Type Error",
"errors": [
"specific error field message"
]
}
## Query Task Status
After submitting a task, use the unified query endpoint to check progress and retrieve results:
<Card title="Get Task Info" icon="magnifying-glass" href="/models/common/get-task-info">
Learn how to query task status and retrieve generation results
</Card>
<Tip>
For production use, we recommend using the `callback_url` parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.
</Tip>
## Related Resources
<CardGroup cols={2}>
<Card title="Asset Upload" icon="upload" href="/models/seedance/asset-upload">
Upload custom assets before using them in Seedance requests
</Card>
<Card title="Asset Info" icon="magnifying-glass" href="/models/seedance/asset-info">
Wait until uploaded assets become active
</Card>
<Card title="Models Overview" icon="store" href="/models/quickstart">
Explore all available models
</Card>
<Card title="Common API" icon="gear" href="/common-api/get-account-credits">
Check credits and account usage
</Card>
</CardGroup>
Authorizations
All APIs require authentication via API Key.
Get API Key:
- Visit API Key Management Page to get your API Key
Usage: Add to request header:
x-api-key: YOUR_API_KEY
Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately in the management page
Body
application/json
The model name to use for generation. Required field.
- Must be
bytedance/seedance2-0-i2vfor this endpoint
Available options:
bytedance/seedance2-0-i2v Input parameters for the image-to-video generation task (Seedance 2.0)
Show child attributes
Show child attributes
Optional. Callback URL for receiving task completion notifications.
- System will POST task status and results to this URL when generation completes
- Callback payloads structure is consistent with the
dataobject returned by the task status query - Your callback endpoint should accept POST requests with JSON payload containing results
- It returns an HTTP 200 status code upon successful receipt
Example:
"https://your-domain.com/api/callback"
Response
Request successful
Response status code
- 200: Success - Request has been processed successfully
- 401: Unauthorized - Authentication credentials are missing or invalid
- 402: Insufficient Credits - Account does not have enough credits to perform the operation
- 404: Not Found - The requested resource or endpoint does not exist
- 422: Validation Error - The request parameters failed validation checks
- 429: Rate Limited - Request limit has been exceeded for this resource
- 455: Service Unavailable - System is currently undergoing maintenance
- 500: Server Error - An unexpected error occurred while processing the request
- 501: Generation Failed - Content generation task failed
- 505: Feature Disabled - The requested feature is currently disabled
Available options:
200, 401, 402, 404, 422, 429, 455, 500, 501, 505 Response message, error description when failed
Example:
"success"
Show child attributes
Show child attributes
Was this page helpful?
⌘I
