curl --request POST 'https://restapi.scalingtensor.com/api/media/generate' \
--header 'apiKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kwaivgi/kling-video/v3/pro/image-to-video",
"params": {
"image": "https://example.com/your-image.png",
"prompt": "The craftsman slowly examines the bowl, turning it gently in his weathered hands. His eyes reflect years of wisdom. Subtle smile forms on his face. Dust particles drift in warm light. Breathing motion, blinking eyes.",
"duration": 12,
"shot_type": "customize",
"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": "kwaivgi/kling-video/v3/pro/image-to-video",
"params": {
"image": "https://example.com/your-image.png",
"prompt": "The craftsman slowly examines the bowl, turning it gently in his weathered hands. His eyes reflect years of wisdom. Subtle smile forms on his face. Dust particles drift in warm light. Breathing motion, blinking eyes.",
"duration": 12,
"shot_type": "customize",
"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": "kwaivgi/kling-video/v3/pro/image-to-video",
"params": {
"image": "https://example.com/your-image.png",
"prompt": "The craftsman slowly examines the bowl, turning it gently in his weathered hands. His eyes reflect years of wisdom. Subtle smile forms on his face. Dust particles drift in warm light. Breathing motion, blinking eyes.",
"duration": 12,
"shot_type": "customize",
"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