curl --request POST 'https://restapi.scalingtensor.com/api/media/generate' \
--header 'apiKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "dreamina-seedance-2-0-260128",
"params": {
"ratio": "16:9",
"content": [
{
"text": "Use the first-person POV framing from Video 1 throughout, and use Audio 1 as the background music throughout. First-person POV fruit tea promotional ad, Seedance brand limited-edition apple fruit tea; opening frame is Image 1, your hand picks a dew-covered Aksu red apple, a light, crisp apple tapping sound; 2–4 seconds: fast cuts, your hand drops apple chunks into a shaker, adds ice and tea base, shakes forcefully, ice clinking and shaking sounds sync with upbeat rhythmic beats, background audio: {Fresh-cut, shaken fresh}; 4–6 seconds: first-person close-up of the finished drink, layered fruit tea is poured into a clear cup, your hand gently squeezes milk foam to spread across the top, a pink brand sticker is applied to the cup, the camera moves closer to show the layered textures of the foam and fruit tea; 6–8 seconds: first-person hand-held toast shot, you raise the fruit tea from Image 2 toward the camera (simulating handing it to the viewer), the cup label is clearly visible, background audio {Take a sip of fresh refreshment}, the final frame freezes on Image 2. All background voice audio uses a female voice.",
"type": "text"
},
{
"role": "reference_image",
"type": "image_url",
"image_url": {
"url": "https://example.com/your-image.jpg"
}
},
{
"role": "reference_image",
"type": "image_url",
"image_url": {
"url": "https://example.com/your-image.jpg"
}
},
{
"role": "reference_video",
"type": "video_url",
"video_url": {
"url": "https://example.com/your-video.mp4"
}
},
{
"role": "reference_audio",
"type": "audio_url",
"audio_url": {
"url": "https://example.com/your-audio.mp3"
}
}
],
"duration": 11,
"watermark": false,
"generate_audio": true
}
}'
const response = await fetch("https://restapi.scalingtensor.com/api/media/generate", {
method: "POST",
headers: {
apiKey: process.env.SCALINGTENSOR_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "dreamina-seedance-2-0-260128",
"params": {
"ratio": "16:9",
"content": [
{
"text": "Use the first-person POV framing from Video 1 throughout, and use Audio 1 as the background music throughout. First-person POV fruit tea promotional ad, Seedance brand limited-edition apple fruit tea; opening frame is Image 1, your hand picks a dew-covered Aksu red apple, a light, crisp apple tapping sound; 2–4 seconds: fast cuts, your hand drops apple chunks into a shaker, adds ice and tea base, shakes forcefully, ice clinking and shaking sounds sync with upbeat rhythmic beats, background audio: {Fresh-cut, shaken fresh}; 4–6 seconds: first-person close-up of the finished drink, layered fruit tea is poured into a clear cup, your hand gently squeezes milk foam to spread across the top, a pink brand sticker is applied to the cup, the camera moves closer to show the layered textures of the foam and fruit tea; 6–8 seconds: first-person hand-held toast shot, you raise the fruit tea from Image 2 toward the camera (simulating handing it to the viewer), the cup label is clearly visible, background audio {Take a sip of fresh refreshment}, the final frame freezes on Image 2. All background voice audio uses a female voice.",
"type": "text"
},
{
"role": "reference_image",
"type": "image_url",
"image_url": {
"url": "https://example.com/your-image.jpg"
}
},
{
"role": "reference_image",
"type": "image_url",
"image_url": {
"url": "https://example.com/your-image.jpg"
}
},
{
"role": "reference_video",
"type": "video_url",
"video_url": {
"url": "https://example.com/your-video.mp4"
}
},
{
"role": "reference_audio",
"type": "audio_url",
"audio_url": {
"url": "https://example.com/your-audio.mp3"
}
}
],
"duration": 11,
"watermark": false,
"generate_audio": true
}
}),
});
const result = await response.json();
if (!response.ok || result.code !== 0) {
throw new Error(result.msg || `Request failed: ${response.status}`);
}
console.log(result.data); // Save data.jobId to query /api/media/result
import os
import requests
payload = {
"model": "dreamina-seedance-2-0-260128",
"params": {
"ratio": "16:9",
"content": [
{
"text": "Use the first-person POV framing from Video 1 throughout, and use Audio 1 as the background music throughout. First-person POV fruit tea promotional ad, Seedance brand limited-edition apple fruit tea; opening frame is Image 1, your hand picks a dew-covered Aksu red apple, a light, crisp apple tapping sound; 2–4 seconds: fast cuts, your hand drops apple chunks into a shaker, adds ice and tea base, shakes forcefully, ice clinking and shaking sounds sync with upbeat rhythmic beats, background audio: {Fresh-cut, shaken fresh}; 4–6 seconds: first-person close-up of the finished drink, layered fruit tea is poured into a clear cup, your hand gently squeezes milk foam to spread across the top, a pink brand sticker is applied to the cup, the camera moves closer to show the layered textures of the foam and fruit tea; 6–8 seconds: first-person hand-held toast shot, you raise the fruit tea from Image 2 toward the camera (simulating handing it to the viewer), the cup label is clearly visible, background audio {Take a sip of fresh refreshment}, the final frame freezes on Image 2. All background voice audio uses a female voice.",
"type": "text",
},
{
"role": "reference_image",
"type": "image_url",
"image_url": {
"url": "https://example.com/your-image.jpg",
},
},
{
"role": "reference_image",
"type": "image_url",
"image_url": {
"url": "https://example.com/your-image.jpg",
},
},
{
"role": "reference_video",
"type": "video_url",
"video_url": {
"url": "https://example.com/your-video.mp4",
},
},
{
"role": "reference_audio",
"type": "audio_url",
"audio_url": {
"url": "https://example.com/your-audio.mp3",
},
},
],
"duration": 11,
"watermark": False,
"generate_audio": True,
},
}
response = requests.post(
"https://restapi.scalingtensor.com/api/media/generate",
headers={"apiKey": os.environ["SCALINGTENSOR_API_KEY"]},
json=payload,
timeout=60,
)
result = response.json()
if result["code"] != 0:
raise RuntimeError(result["msg"])
print(result["data"]) # Save data["jobId"] to query /api/media/result