API Tips
Image-to-Video (First and Last Frame): Generate target video based on your input: first frame image + last frame image + text prompt (optional) + parameters (optional)
Image-to-Video (First Frame): Generate target video based on your input: first frame image + text prompt (optional) + parameters (optional)
Text-to-Video: Generate target video based on your input: text prompt + parameters (optional)
Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key.
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID to use for the request
Value: spark_dance_v1_5_pro
content array required
Input information for generating videos, supports text, image and video (draft, Draft video) formats. Supports the following combinations: Text, Text + Image (first frame), Text + Image + Image (first and last frames), Video (draft)
Text Content Object
type
stringrequiredContent type
Value:
texttext
stringrequiredText content input to the model, describing the expected video, including:
Text prompt (required): Supports Chinese and English. Recommended not exceeding 500 characters. Too many characters can cause information dispersion, and the model may ignore details and only focus on key points, resulting in missing elements in the video
Image Content Object
type
stringrequiredContent type
Value:
image_urlimage_url
objectrequiredImage URL object
url
stringrequiredImage information, can be image URL or Base64 encoded image
Image URL: Ensure the image URL is accessible
Base64 encoding: Follow this format
data:image/<image_format>;base64,<base64_encoded>, note that<image_format>must be lowercase, e.g.data:image/png;base64,{base64_image}Image requirements:
Image formats: jpeg, png, webp, bmp, tiff, gif, heic, heif
Aspect ratio (width/height): (0.4, 2.5)
Width and height (px): (300, 6000)
Size: less than30 MBrole
stringconditional requiredImage position or purpose
First Frame to Video:
role value: Need to pass 1image_urlobject, androlefield can be empty, orroleis:first_frameFirst and Last Frame to Video:
role value: Need to pass 2image_urlobjects, androlefield is required
First frame image corresponds torole:first_frame
Last frame image corresponds torole:last_frame
Draft Information
type
stringrequiredInput content type, should be
draft_taskdraft_task
objectrequiredDraft task input to the model
id
stringrequiredDraft task ID. The platform will automatically reuse the user input used by the Draft video (model, content.text, content.image_url, generate_audio, seed, ratio, duration, camera_fixed) to generate the final video. Other parameters can be specified, and if not specified, the default values of this model will be used
callback_url string
Callback notification address for task results
return_last_frame boolean
Whether to return the last frame image of the generated video
true: Returns the last frame image of the generated video. After setting to true, you can get the video’s last frame image through the query video generation task API. The last frame image format is png, with the same width and height pixels as the generated video, without watermark. This parameter can be used to generate multiple consecutive videos by using the end frame of one video as the first frame of the next video task
false: Does not return the last frame image
Default: false
service_tier string
Service tier type for processing this request
default: Online inference mode
flex: Offline inference mode
Default: default
Options: default, flex
execution_expires_after integer
Task timeout threshold. Specifies the expiration time (in seconds) after task submission, calculated from the created_at timestamp
Default: 172800 (48 hours)
Range: [3600, 259200]
generate_audio boolean
Only Seedance 1.5 Pro supports controlling whether the generated video contains synchronized sound
true: Model outputs video with synchronized audio. Seedance 1.5 Pro can automatically generate matching voice, sound effects, and background music based on text prompts and visual content. It is recommended to place dialogue within double quotes to optimize audio generation effects. For example: The man calls out to the woman and says: “Remember, you cannot point your finger at the moon in the future.”
false: Model outputs silent video
Default: true
draft boolean
Only Seedance 1.5 Pro supports controlling whether to enable draft mode
true: Enable draft mode, generate a preview video to quickly verify scene structure, camera scheduling, subject actions, and whether the prompt intent meets expectations. Consumes fewer tokens than normal video, with lower usage cost
false: Disable draft mode, generate a normal video
Note: After enabling draft mode, 480p resolution will be used to generate the Draft video (using other resolutions will cause an error), does not support return last frame function, does not support offline inference function
Default: false
resolution string
Video resolution
Default: 720p
Options: 480p, 720p, 1080p
ratio string
Aspect ratio of the generated video
Default: adaptive
Options: 16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive
Note: adaptive automatically selects the most suitable aspect ratio based on the input prompt or uploaded first frame image
duration integer
Video duration in seconds
Seedance 1.5 Pro supports two configuration methods: Specify specific duration (any integer in range), or set to -1 to let the model autonomously choose an appropriate video length (integer seconds) within the range. The actual generated video duration can be obtained through the query video generation task API return duration field. Note: Video duration is related to billing, please set carefully
Default: 5
Range: 4 - 12, or -1 (auto)
seed integer
Seed integer for controlling randomness of generated content
Default: -1
Range: [-1, 2^32-1]
camera_fixed boolean
Whether to fix the camera
Default: false
Options: true, false
watermark boolean
Whether the generated video contains watermark
Default: false
Options: true, false
Polling
Since video generation takes time, you need to poll the task status after creation
The initial response returns the task ID and initial status. The actual generation results must be obtained through polling the task status endpoint
Response Format
error object
Error information. Only present when status is failed
code
stringError code
error_message
stringDetailed error message
output array
Generation results. Only present when status is completed
content
arrayList of generated content
type
stringResource type, e.g.
video,imageurl
stringGenerated content URL
duration
numberVideo duration
jobId
stringRemote job ID
usage object
Usage statistics. Only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information
Error Codes
| Error Code | Description |
|---|---|
| 003015001 | content parameter missing or format error |
| 003015002 | content array is empty |
| 003015003 | duration parameter must be -1 or an integer between 4-12 |
| 003015004 | resolution parameter must be 480p or 720p |
| 003015005 | ratio parameter must be 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 or adaptive |
| 003015006 | service_tier parameter must be default or flex |
| 003015010 | Task timeout |
| 003015095 | Internal generation error |
| 003015096 | Result parsing error |
| 003015097 | HTTP error response |
| 003015098 | Status check error |
| 003015099 | Task creation error |