Skip to main content
ByteDance Seedance 2.0 reference-to-video generates video from a text prompt guided by reference images, videos, and/or audio. Reference media are addressed in the prompt as @Image1, @Image2, @Video1, @Video2, @Audio1, etc. Supports resolutions up to 720p, durations from 4–15 seconds, and synchronized audio generation including sound effects, ambient sounds, and lip-synced speech. Model name: bytedance-seedance-2-0-reference-to-video

Endpoint

POST /api/ai/videos/generate
Video generation is synchronous — the request blocks until the video is ready (typically 1–5 minutes). It is recommended to use /ai/queue instead for long-running jobs, so that you don’t have long running http requests.

Request Parameters

ParameterTypeRequiredDefaultDescription
modelstringyes"bytedance-seedance-2-0-reference-to-video"
promptstringyesText prompt. Use @Image1, @Video1, @Audio1, etc. to reference input media.
input_imagesarray of URIsnoReference images (JPEG, PNG, WebP). Max 30 MB each. Up to 9. Use @Image1, @Image2, … in the prompt.
input_videosarray of URIsnoReference videos (MP4, MOV). Up to 3. Combined duration must be 2–15 s, total size < 50 MB. Resolution between ~480p and ~720p. Use @Video1, @Video2, … in the prompt.
input_audiosarray of URIsnoReference audio (MP3, WAV). Up to 3 files. Combined duration ≤ 15 s. Max 15 MB each. Requires at least one reference image or video. Use @Audio1, @Audio2, … in the prompt.
resolutionstringno"720p""480p" for faster generation, "720p" for higher quality.
durationstringno"auto"Duration in seconds: "auto", or "4" through "15".
generate_audiobooleannotrueGenerate synchronized audio (sound effects, ambient sounds, lip-synced speech). Cost is the same either way.
aspect_ratiostringno"auto""auto", "21:9", "16:9", "4:3", "1:1", "3:4", or "9:16".
seedintegernoRandom seed for reproducibility. Results may still vary slightly.
response_formatstringno"url""url" returns a hosted URL. "b64_json" returns base64-encoded video bytes inline.
target_namespacestringnocurrent userNamespace to save results and bill to. Can be an organization name.

Reference Media Limits

ModalityMax CountSize LimitOther Constraints
Images930 MB eachJPEG, PNG, WebP
Videos350 MB totalMP4, MOV. Combined duration 2–15 s. Resolution ~480p to ~720p.
Audio315 MB eachMP3, WAV. Combined duration ≤ 15 s. Requires ≥ 1 image or video.
Total files across all modalities must not exceed 12.

Duration

ValueBehavior
"auto"Model decides based on prompt and references
"4""15"Fixed duration in seconds

Examples

Text-only prompt

import requests

response = requests.post(
    "https://hub.oxen.ai/api/ai/videos/generate",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "bytedance-seedance-2-0-reference-to-video",
        "prompt": "A serene mountain lake at sunrise with mist rolling across the water",
    },
)

data = response.json()
print("Video URL:", data["videos"][0]["url"])

With reference images

import requests

response = requests.post(
    "https://hub.oxen.ai/api/ai/videos/generate",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "bytedance-seedance-2-0-reference-to-video",
        "prompt": "@Image1 walks through a crowded market, browsing the stalls",
        "input_images": ["https://example.com/character.jpg"],
        "duration": "8",
        "aspect_ratio": "16:9",
    },
)

data = response.json()
print("Video URL:", data["videos"][0]["url"])

With reference video and audio

import requests

response = requests.post(
    "https://hub.oxen.ai/api/ai/videos/generate",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "bytedance-seedance-2-0-reference-to-video",
        "prompt": "@Image1 dances to the rhythm of @Audio1 in the style of @Video1",
        "input_images": ["https://example.com/dancer.jpg"],
        "input_videos": ["https://example.com/dance-reference.mp4"],
        "input_audios": ["https://example.com/music.mp3"],
        "resolution": "720p",
        "duration": "10",
        "generate_audio": True,
    },
)

data = response.json()
print("Video URL:", data["videos"][0]["url"])

Portrait video at 480p

import requests

response = requests.post(
    "https://hub.oxen.ai/api/ai/videos/generate",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "bytedance-seedance-2-0-reference-to-video",
        "prompt": "@Image1 speaks directly to camera, warm studio lighting",
        "input_images": ["https://example.com/speaker.jpg"],
        "resolution": "480p",
        "aspect_ratio": "9:16",
        "duration": "6",
        "generate_audio": True,
    },
)

data = response.json()
print("Video URL:", data["videos"][0]["url"])

Response (response_format: "url")

{
  "created": 1775090723,
  "model": "bytedance-seedance-2-0-reference-to-video",
  "videos": [
    {
      "url": "https://hub.oxen.ai/api/repos/.../files/.../video.mp4?..."
    }
  ]
}
The URL is a temporary link that expires after a period of time.

Response (response_format: "b64_json")

{
  "created": 1775090723,
  "model": "bytedance-seedance-2-0-reference-to-video",
  "videos": [
    {
      "b64_json": "<base64-encoded mp4 bytes>"
    }
  ]
}

Using with /ai/queue

Recommended for video generation. Returns immediately, processes in the background.

Enqueue

import requests

response = requests.post(
    "https://hub.oxen.ai/api/ai/queue",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "bytedance-seedance-2-0-reference-to-video",
        "prompt": "@Image1 waves at the camera and smiles",
        "input_images": ["https://example.com/person.jpg"],
        "duration": "5",
        "num_generations": 2,
    },
)

generations = response.json()["generations"]
for g in generations:
    print(f"ID: {g['generation_id']}, Status: {g['status']}")

Poll

import requests

response = requests.get(
    "https://hub.oxen.ai/api/ai/queue",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"model": "bytedance-seedance-2-0-reference-to-video"},
)

status = response.json()
print(f"Remaining: {status['count']}")
When finished, the generation disappears from the list. A count of 0 means all generations are complete.

Cancel

import requests

generation_id = "4ef840a4-..."
response = requests.delete(
    f"https://hub.oxen.ai/api/ai/queue/{generation_id}",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)

print(response.json())

Errors

ErrorCauseFix
Field requiredMissing promptProvide a text prompt
Too many input filesTotal files across images, videos, audio > 12Reduce the number of reference files
Audio requires at least one image or videoinput_audios provided without input_images or input_videosAdd at least one reference image or video
Invalid durationDuration not "auto" or "4""15"Use a supported duration value
Invalid resolutionResolution not "480p" or "720p"Use "480p" or "720p"
num_generations must be an integer between 1 and 4Invalid count (via /ai/queue)Use 1–4