Content पर जाएं

Seedance वीडियो

POST/api/v3/contents/generations/tasks

एक Seedance वीडियो task सबमिट करें। सफल submission पर HTTP 200 और एक SandBase task id मिलता है।

Request body

stringmodelज़रूरी

समर्थित model identifier: bytedance/seedance/2.0-official या bytedance/seedance/2.5-official।

arraycontentज़रूरी

Typed text और वैकल्पिक media inputs। Item shapes model द्वारा validate किए जाते हैं।

वैकल्पिक<integer>duration

बिना बदलाव model को forward किया जाता है। Model validation लागू होती है।

वैकल्पिक<string>resolution

बिना बदलाव model को forward किया जाता है। Model validation लागू होती है।

वैकल्पिक<string>ratio

बिना बदलाव model को forward किया जाता है। Model validation लागू होती है।

वैकल्पिक<boolean>generate_audio

बिना बदलाव model को forward किया जाता है। समर्थित होने पर generated audio का अनुरोध करें।

Seedance गाइड ​

Seedance टेक्स्ट, opening और closing frames, तथा multimodal references जैसे images, video, और audio से video बनाता है। इसका उपयोग एक साधारण text-to-video clip से लेकर एक निर्देशित shot तक किसी भी चीज़ के लिए करें, जो एक visual subject, camera movement, और soundtrack का अनुसरण करता हो।

Generation asynchronous है। एक task submit करें, फिर उसे तब तक poll करें जब तक वह terminal status तक न पहुँच जाए।

एक model चुनना ​

modelकिसके लिए सबसे अच्छाOutput resolutions
bytedance/seedance/2.5-official1080p delivery और सबसे उच्च उपलब्ध output resolution480p, 720p, 1080p
bytedance/seedance/2.0-officialजब 480p या 720p पर्याप्त हो, तब कम लागत वाली generation480p, 720p

दोनों models एक ही multimodal input स्वीकार करते हैं और एक ही request shape में text-to-video, image-to-video, और multimodal reference workflows का समर्थन करते हैं। जब 480p या 720p आपकी ज़रूरत पूरी करता हो और आप कम कीमत वाला विकल्प चाहते हों, तब 2.0-official चुनें। जब आपको 1080p चाहिए, तब 2.5-official चुनें।

API संदर्भ ​

MethodPath
POST/api/v3/contents/generations/tasks
GET/api/v3/contents/generations/tasks/{task_id}

Tasks की सूची बनाना और किसी task को cancel या delete करना समर्थित नहीं है। परिणाम प्राप्त करने के लिए लौटाए गए task id को सहेजें।

हर request को उसी API key से authenticate करें जिसका उपयोग task बनाने के लिए किया गया था:

Authorization: Bearer $SANDBASE_API_KEY

model value एक model चुनना में दिए गए नामों में से किसी एक से मेल खानी चाहिए। परिणाम प्राप्त करने का समर्थित तरीका polling है; इस endpoint के लिए callback_url पर निर्भर न रहें।

त्वरित शुरुआत ​

एक task submit करें:

bash
curl -X POST https://api.sandbase.ai/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedance/2.5-official",
    "content": [
      {"type": "text", "text": "A slow cinematic push across an alpine lake at sunrise"}
    ],
    "ratio": "16:9",
    "resolution": "720p",
    "duration": 5,
    "generate_audio": true
  }'
json
{ "id": "158d2649-e01d-45b9-b88a-ef3c450c601c" }

उस id के साथ task को हर 5 से 10 seconds में poll करें, जब तक status succeeded, failed, expired, या cancelled न हो जाए:

bash
curl https://api.sandbase.ai/api/v3/contents/generations/tasks/158d2649-e01d-45b9-b88a-ef3c450c601c \
  -H "Authorization: Bearer $SANDBASE_API_KEY"
json
{
  "id": "158d2649-e01d-45b9-b88a-ef3c450c601c",
  "model": "bytedance/seedance/2.5-official",
  "status": "succeeded",
  "created_at": 1787059000,
  "updated_at": 1787059150,
  "content": { "video_url": "https://media.sandbase.ai/files/158d2649.../0.mp4" },
  "usage": { "completion_tokens": 108900, "total_tokens": 108900 }
}

जनरेट किया गया video content.video_url पर उपलब्ध है।

एक input workflow चुनें ​

API सात सामान्य input workflows का समर्थन करती है। content में हर item का एक type होता है; item types और roles का संयोजन workflow चुनता है:

लक्ष्यcontent संयोजनइसका उपयोग तब करें जब
Text to videoTextदृश्य को पूरी तरह prompt में वर्णित किया जा सकता हो
एक opening frame को animate करनाText (optional) + first_frame के साथ imageपहला frame दी गई image से मेल खाना चाहिए
दो frames के बीच transitionText (optional) + first_frame + last_frameshot को नियंत्रित शुरुआत और अंत चाहिए
एक visual reference का अनुसरण करनाText (optional) + reference_image के साथ imageकोई subject, product, costume, या visual style पहचानने योग्य बना रहना चाहिए
motion या camera language का अनुसरण करनाText (optional) + reference_video के साथ videoMotion, timing, editing rhythm, या camera movement किसी reference clip से आता है
एक audio reference जोड़नाText/image/video + reference_audio के साथ audioDialogue, music, voice, या sound design परिणाम का मार्गदर्शन करे
पूर्ण multimodal directionText + image + video + audio referencesअलग-अलग assets एक ही shot में appearance, motion, और sound को नियंत्रित करें

Audio अकेले नहीं हो सकता। Audio item शामिल करने वाले हर request में कम से कम एक text, image, या video item भी होना चाहिए।

Content item shapes ​

json
{ "type": "text", "text": "A puppy running across a sunlit lawn" }
json
{ "type": "image_url", "image_url": { "url": "https://example.com/ref.jpg" }, "role": "reference_image" }
json
{ "type": "video_url", "video_url": { "url": "https://example.com/ref.mp4" }, "role": "reference_video" }
json
{ "type": "audio_url", "audio_url": { "url": "https://example.com/bgm.mp3" }, "role": "reference_audio" }

role बताता है कि model asset का उपयोग कैसे करे:

Assetroleप्रभाव
Imagefirst_frameimage को opening frame के रूप में उपयोग करें
Imagelast_frameimage को closing frame के रूप में उपयोग करें; उसी request में एक first_frame शामिल करें
Imagereference_imagesubject, composition, product, costume, या visual style का reference लें
Videoreference_videomotion, camera work, timing, या editing rhythm का reference लें
Audioreference_audiovoice, dialogue, music, या sound design का reference लें

Image items या तो public URL या inline data:image/...;base64,... value स्वीकार करते हैं। Video और audio references के लिए public URLs का उपयोग करना चाहिए जिन्हें model डाउनलोड कर सके।

कोई भी video_url item शामिल करने से request video-to-video mode में चली जाती है, जिससे token rate बदल जाता है। Billing देखें।

सामान्य recipes ​

नीचे दिए गए examples request bodies दिखाते हैं। इनमें से किसी को भी Quickstart में दिखाए गए create-task endpoint पर भेजें।

एक first frame को animate करना ​

json
{
  "model": "bytedance/seedance/2.5-official",
  "content": [
    {"type": "text", "text": "The woman slowly looks up and smiles as the camera gently pushes in"},
    {"type": "image_url", "image_url": {"url": "https://example.com/first-frame.jpg"}, "role": "first_frame"}
  ],
  "ratio": "adaptive",
  "resolution": "720p",
  "duration": 5,
  "generate_audio": true
}

first-to-last-frame transition बनाना ​

json
{
  "model": "bytedance/seedance/2.5-official",
  "content": [
    {"type": "text", "text": "A smooth transition from a bright afternoon into a neon-lit night"},
    {"type": "image_url", "image_url": {"url": "https://example.com/first-frame.jpg"}, "role": "first_frame"},
    {"type": "image_url", "image_url": {"url": "https://example.com/last-frame.jpg"}, "role": "last_frame"}
  ],
  "ratio": "adaptive",
  "resolution": "720p",
  "duration": 6
}

image, video, और audio references के साथ एक shot को निर्देशित करना ​

bash
curl -X POST https://api.sandbase.ai/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedance/2.5-official",
    "content": [
      {"type": "text", "text": "First-person fruit tea commercial, camera pushes in on the layered foam"},
      {"type": "image_url", "image_url": {"url": "https://example.com/ref.jpg"}, "role": "reference_image"},
      {"type": "video_url", "video_url": {"url": "https://example.com/ref.mp4"}, "role": "reference_video"},
      {"type": "audio_url", "audio_url": {"url": "https://example.com/bgm.mp3"}, "role": "reference_audio"}
    ],
    "ratio": "16:9",
    "resolution": "1080p",
    "duration": 11
  }'

Prompt का उपयोग करके हर reference को एक स्पष्ट काम दें: उदाहरण के लिए, “image से product appearance बनाए रखें, video से camera movement लें, और audio की pacing का पालन करें।” यह हर asset से पूरे परिणाम को नियंत्रित करने के लिए कहने से अधिक विश्वसनीय है।

एक प्रभावी prompt लिखना ​

एक व्यावहारिक prompt आमतौर पर इस क्रम का पालन करता है:

  1. Subject — shot में कौन या क्या दिखाई देता है।
  2. Action — क्या बदलता है या हिलता है।
  3. Scene — स्थान, दिन का समय, मौसम, और आसपास के विवरण।
  4. Visual style — cinematic, documentary, product commercial, animation, आदि।
  5. Camera — framing, lens feel, camera movement, और cuts।
  6. Sound — जब generate_audio सक्षम हो, तब dialogue, ambience, music, या effects।

जो स्थिर रहना चाहिए, उसके बारे में स्पष्ट रहें। उदाहरण के लिए: “Product label पढ़ने योग्य बना रहता है, camera एक धीमा push-in करता है, कोई scene cuts नहीं, natural room tone।” जब कई references मौजूद हों, तो बताएं कि किस visual या motion quality को किससे लेना है।

आउटपुट विकल्प ​

पैरामीटरप्रकारडिफ़ॉल्टमान
resolutionstring720p480p, 720p, 1080p. 2.0-official 1080p का समर्थन नहीं करता
ratiostringadaptive16:9, 9:16, 4:3, 3:4, 1:1, 21:9, adaptive. adaptive इनपुट और प्रॉम्प्ट से एक अनुपात चुनता है
durationinteger54 से 15 सेकंड, या मॉडल को समर्थित सीमा के भीतर चुनने देने के लिए -1
generate_audiobooleantrueसमकालिक आवाज़, ध्वनि प्रभाव, और बैकग्राउंड संगीत उत्पन्न करें
seedinteger-1-1 से 2^32-1 तक। समान प्रॉम्प्ट और seed समान, लेकिन एक जैसे नहीं, आउटपुट देते हैं
watermarkbooleanfalseनिचले-दाएँ कोने में AI-जनित watermark जोड़ें
toolsarray[][{"type": "web_search"}] शॉट की योजना बनाते समय web search सक्षम करता है

कार्य नियंत्रण ​

पैरामीटरप्रकारडिफ़ॉल्टनोट्स
execution_expires_afterinteger172800सेकंड में task timeout, 3600 से 259200 तक। इससे आगे जाने पर task expired हो जाता है
service_tierstringdefaultये models flex का समर्थन नहीं करते
safety_identifierstring—अपारदर्शी end-user identifier, अधिकतम 64 characters। raw personal data नहीं, hash भेजें

फ़्रेम आकार ​

resolution और ratio मिलकर pixel dimensions निर्धारित करते हैं:

Resolution16:99:164:33:41:121:9
480p864×496496×864752×560560×752640×640992×432
720p1280×720720×12801112×834834×1112960×9601470×630
1080p1920×10801080×19201664×12481248×16641440×14402206×946

कार्य स्थिति ​

statusअर्थक्या करें
queuedस्वीकार किया गया, शुरू होने की प्रतीक्षा मेंहर 5 से 10 सेकंड में polling जारी रखें
runningउत्पन्न हो रहा हैpolling जारी रखें
succeededपूरा हो गयाcontent.video_url डाउनलोड करें
failedcontent review द्वारा अस्वीकृत, या model में error आयाerror.message पढ़ें। फिर से प्रयास करने से पहले प्रॉम्प्ट समायोजित करें
expiredexecution_expires_after से आगे चल गयाफिर से submit करें
cancelledgeneration शुरू होने से पहले समाप्त हो गयाफिर से submit करें

कार्य फ़ील्ड ​

फ़ील्डप्रकारनोट्स
idstringsubmit पर लौटाया गया task id
modelstringआपने भेजा हुआ model मान
statusstringऊपर देखें
created_atintegerUnix seconds
updated_atintegerUnix seconds. task समाप्त होने तक created_at के बराबर रहता है
contentobjecttask सफल होने तक खाली। उत्पन्न video_url रखता है
usageobjecttoken counts. Billing देखें
errorobjectfailed और expired के लिए मौजूद। इसमें code और message होते हैं

पूर्ण Python प्रवाह ​

python
import os
import time

import requests

BASE_URL = "https://api.sandbase.ai/api/v3/contents/generations/tasks"
HEADERS = {
    "Authorization": f"Bearer {os.environ['SANDBASE_API_KEY']}",
    "Content-Type": "application/json",
}

task = requests.post(
    BASE_URL,
    headers=HEADERS,
    json={
        "model": "bytedance/seedance/2.5-official",
        "content": [
            {
                "type": "text",
                "text": "A quiet shoreline at sunrise, gentle waves, one slow camera push-in",
            }
        ],
        "ratio": "16:9",
        "resolution": "720p",
        "duration": 5,
        "generate_audio": True,
    },
)
task.raise_for_status()
task_id = task.json()["id"]

while True:
    time.sleep(8)
    result = requests.get(f"{BASE_URL}/{task_id}", headers=HEADERS)
    result.raise_for_status()
    data = result.json()
    print(data["status"])

    if data["status"] == "succeeded":
        print(data["content"]["video_url"])
        break
    if data["status"] in {"failed", "expired", "cancelled"}:
        raise RuntimeError(data.get("error", {"message": data["status"]}))

बिलिंग ​

ये models usage.completion_tokens पर bill करते हैं, जिसे task समाप्त होने पर रिपोर्ट करता है। token rate दो आयामों पर निर्भर करता है:

  • क्या input में video शामिल है। Video-to-video requests, यानी type video_url वाला कोई भी content item, text-to-video की तुलना में कम rate पर bill होते हैं।
  • Output resolution. 2.5-official के लिए, 1080p का bill 480p और 720p से अधिक होता है। 2.0-official rate resolution के अनुसार नहीं बदलता।

usage completion_tokens और total_tokens रिपोर्ट करता है, जो वर्तमान में समान हैं। task चलने के दौरान यह खाली रहता है। वास्तविक charges के लिए अपना account history देखें, और वर्तमान rates के लिए pricing guide देखें।

त्रुटियाँ ​

एक अमान्य request तुरंत error लौटाती है। generation-time error polling के बाद task में दिखाई देती है। दोनों एक error object का उपयोग करते हैं, जिसमें machine-readable code और human-readable message होता है:

json
{ "error": { "code": "InvalidParameter", "message": "model is required", "type": "BadRequest" } }
HTTPcodetype
400InvalidParameterBadRequest
401AuthenticationErrorUnauthorized
403PermissionDeniedForbidden
404ResourceNotFoundNotFound
429RateLimitExceededTooManyRequests
500InternalServiceErrorInternalServerError
503InternalServiceErrorServiceUnavailable

सामान्य recovery steps:

Resultक्या आज़माएँ
400 InvalidParametermodel name, required content, roles, resolution, duration, और asset URLs जाँचें
Task status failed with a content-review errorफिर से submit करने से पहले prompt को फिर से लिखें या flagged reference asset को बदलें
Task status expiredएक नया task submit करें; high-resolution या लंबे clips के लिए लंबा execution_expires_after विचार करें
429 RateLimitExceededआपकी organization video concurrency limit या per-minute limit तक पहुँच गई है; Concurrency limits देखें। चल रहे task के समाप्त होने की प्रतीक्षा करें, या exponential backoff के साथ retry करें
503 ServiceUnavailableथोड़ी देरी के बाद वही request फिर से retry करें

पंजीकृत मीडिया Assets का उपयोग करें ​

SandBase /v1/assets पर आधिकारिक-संगत Asset प्रोटोकॉल प्रदान करता है। Asset अनुरोध और लौटाया गया asset:// संदर्भ आधिकारिक प्रोटोकॉल का पालन करते हैं, और यह संदर्भ मूल ByteDance Contents Generations अनुरोध में बिना बदले पास किया जाता है। दोनों bytedance/seedance/2.5-official और bytedance/seedance/2.0-official उस संदर्भ को स्वीकार करते हैं जहाँ वे सामान्यतः एक सार्वजनिक HTTP(S) URL स्वीकार करते हैं।

पूरा कार्यप्रवाह यह है:

  1. POST /v1/assets के साथ एक पहुँच योग्य मीडिया URL पंजीकृत करें।
  2. GET /v1/assets/{external_id} से तब तक क्वेरी करें जब तक प्रदाता यह रिपोर्ट न करे कि Asset उपयोग योग्य है।
  3. लौटाए गए asset_url को Seedance content आइटम में रखें और generation task सबमिट करें।

आधिकारिक-संगत Asset operations ​

MethodPathPurpose
POST/v1/assetsएक पहुँच योग्य मीडिया URL पंजीकृत करें और एक आधिकारिक-संगत asset:// संदर्भ प्राप्त करें
GET/v1/assets/{external_id}प्रदाता स्थिति पढ़ें और वर्तमान preview/download URL प्राप्त करें

सार्वजनिक API वर्तमान में registration और lookup उपलब्ध कराता है। Asset groups, listing, renaming, updating, और deletion सार्वजनिक operations नहीं हैं। Assets उस organization से संबंधित होते हैं जो API key से जुड़ी होती है।

चरण 1: Asset पंजीकृत करें ​

पहुंच योग्य URL को POST /v1/assets पर भेजें। asset_type case-sensitive है और Image, Video, या Audio होना चाहिए:

bash
curl -X POST https://api.sandbase.ai/v1/assets \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/product-reference.png",
    "asset_type": "Image",
    "name": "Product reference"
  }'

प्रतिक्रिया से asset_url सहेजें:

json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "asset_url": "asset://asset-20260710150403-hx4hf",
  "asset_type": "Image",
  "name": "Product reference",
  "created_at": "2026-07-10T15:04:03Z"
}

asset:// के बाद का मान वह external_id है जिसका उपयोग आधिकारिक-संगत lookup operation में किया जाता है।

चरण 2: readiness जाँचें ​

asset:// prefix के बिना, external_id के साथ Asset को क्वेरी करें:

bash
curl https://api.sandbase.ai/v1/assets/asset-20260710150403-hx4hf \
  -H "Authorization: Bearer $SANDBASE_API_KEY"
json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "external_id": "asset-20260710150403-hx4hf",
  "asset_url": "asset://asset-20260710150403-hx4hf",
  "status": "Active",
  "asset_type": "Image",
  "name": "Product reference",
  "download_url": "https://media.example.com/current-signed-url",
  "created_at": "2026-07-10T15:04:03Z"
}

status को exhaustive enum के बजाय एक open provider value के रूप में मानें। generation task सबमिट करने से पहले तब तक प्रतीक्षा करें जब तक प्रदाता उपयोग योग्य state रिपोर्ट न करे; एक सामान्य ready value Active है। download_url provider-managed होता है और processing के दौरान खाली हो सकता है। जब आपको current preview URL चाहिए, तब Asset को फिर से क्वेरी करें। Seedance requests में download_url कॉपी करने के बजाय persistent asset_url का उपयोग करते रहें।

चरण 3: Asset के साथ generate करें ​

मीडिया प्रकार से मेल खाने वाले URL field में asset_url रखें। यह उदाहरण registered image को visual reference के रूप में उपयोग करता है:

bash
curl -X POST https://api.sandbase.ai/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedance/2.5-official",
    "content": [
      {
        "type": "text",
        "text": "Create a cinematic product shot. Keep the bottle shape and label from the reference image."
      },
      {
        "type": "image_url",
        "image_url": {"url": "asset://asset-20260710150403-hx4hf"},
        "role": "reference_image"
      }
    ],
    "ratio": "16:9",
    "resolution": "1080p",
    "duration": 5,
    "generate_audio": true
  }'

create response एक task id लौटाता है। चयनित model page पर वर्णित अनुसार GET /api/v3/contents/generations/tasks/{task_id} को poll करें।

content item और role चुनें ​

Asset typecontent[].typeURL fieldSupported roleUse it for
Imageimage_urlimage_url.urlfirst_frameवीडियो को इस exact frame से शुरू करें
Imageimage_urlimage_url.urllast_frameइस frame पर समाप्त करें; उसी request में first_frame शामिल करें
Imageimage_urlimage_url.urlreference_imagesubject, product, composition, costume, या visual style को बनाए रखें
Videovideo_urlvideo_url.urlreference_videomotion, timing, camera work, या editing rhythm का अनुसरण करें
Audioaudio_urlaudio_url.urlreference_audiovoice, dialogue, music, या sound design का अनुसरण करें

Audio अकेला input नहीं हो सकता। reference_audio Asset को text, image, या video के साथ संयोजित करें। कोई भी request जिसमें video_url शामिल हो, वह video-to-video billing rate का उपयोग करती है।

Video Asset example ​

json
{
  "type": "video_url",
  "video_url": {"url": "asset://asset-20260710150403-video1"},
  "role": "reference_video"
}

Audio Asset example ​

json
{
  "type": "audio_url",
  "audio_url": {"url": "asset://asset-20260710150403-audio1"},
  "role": "reference_audio"
}

Direct URL या asset:// संदर्भ? ​

InputBest whenTrade-off
Public HTTP(S) URLमीडिया पहले से hosted है और एक बार उपयोग किया जाना हैसबसे तेज़ path, लेकिन task submission और provider fetch के दौरान URL पहुँच योग्य बना रहना चाहिए
asset:// संदर्भमीडिया का पुन: उपयोग आधिकारिक Asset protocol के माध्यम से किया जाता हैएक registration/readiness चरण जोड़ता है, फिर बाद के Seedance tasks के लिए एक persistent संदर्भ देता है

request parameters, polling, task statuses, और billing के लिए ऊपर दिए गए Seedance guide को देखें।

आधिकारिक ByteDance resources ​