# Seedance 2.5 4K > Generate native 4K video from text, images, or references, with synchronized native audio, delivered as 10-bit HEVC. ## Overview - **Endpoint**: `https://api.segmind.com/v1/seedance-2.5-4k` - **Model ID**: `seedance-2.5-4k` - **Category**: Image-to-Video Generation - **Type**: Synchronous (Direct response) - **Average Latency**: ~262.9s (30-day average) - **Average Cost**: $10.64 per run (observed across past runs, not a price — see Pricing) - **Provider**: BYTEDANCE ## Pricing | Input Type | Resolution | Rate | | --- | --- | --- | | Text or image input | 4k | $5.222217 per million tokens | | Video input | 4k | $3.222219 per million tokens | Billed per million video tokens: output width x height x frame rate x duration / 1024, at 4K (3840x2160 at 16:9). With a reference video, the full length of every reference video is billed at the video-input rate on top of the output. ## Pricing Notes ### Pricing Seedance 2.5 4K is billed per video token, exactly as Seedance 2.5 is, at the 4K tier. Tokens = output width x height x frame rate x duration / 1024, so a 4K second is about 4x a 1080p second. With a reference video, the whole request is billed at the lower video-input rate, and every reference video is billed for its full length on top of the output, counted at the output's 4K resolution (whatever the clip's own resolution). #### Per second of output | Input | 16:9 | 9:16 | 1:1 | 4:3 | 3:4 | 21:9 | |---|---|---|---|---|---|---| | Text / image | $1.0234/s | $1.0234/s | $1.0234/s | $1.0299/s | $1.0299/s | $1.0284/s | | With reference video (output + each reference second) | $0.6321/s | $0.6321/s | $0.6321/s | $0.6360/s | $0.6360/s | $0.6351/s | #### Examples | Input | Aspect ratio | Duration | Price | |---|---|---|---| | Text / image | 16:9 | 5s | $5.12 | | Text / image | 16:9 | 10s | $10.23 | | Text / image | 16:9 | 30s | $30.70 | | 5s output + 5s reference video | 16:9 | 5s | $6.32 | | 10s output + 5s reference video | 16:9 | 10s | $9.48 | #### How the charge works 1. **On request**: a temporary hold is placed on your credits. 2. **On completion**: you are charged for the tokens the render used; the rest of the hold is released. 3. **Failed or moderated renders** are not charged. #### Tips - Render drafts on seedance-2.5 at 480p and use 4K only for the final shot. - 4K renders take several minutes: use the async API (POST /v2/seedance-2.5-4k) and poll. ## API Information This model uses a **synchronous response pattern**: 1. Make a POST request with your parameters 2. Receive the output directly in the response: the generated file itself, saved here as `output.mp4` (if the Content-Type is JSON, read it as JSON instead) 3. No polling required - response is immediate ### Input Schema The API accepts the following input parameters: - **`prompt`** (`string`, _required_): Prompt Text describing the video. Use Shot 1:, Shot 2: for multi-shot sequences. Reference uploaded assets as '@Image 1', '@Video 1', '@Audio 1' in your prompt. - **`first_frame_url`** (`File (URL)`, _optional_): First Frame Image Starting frame image URL for image-to-video. Animates outward from this reference. Note: images with real human faces are blocked by ByteDance content policy. Cannot be used together with reference_images. - **`last_frame_url`** (`File (URL)`, _optional_): Last Frame Image Ending frame; requires first_frame_url. Guides transitions between two frames. - **`reference_images`** (`array`, _optional_): Reference Images Up to 30 reference images (max 30MB each) for character/style consistency. Cite as '@Image 1', '@Image 2' in your prompt. Cannot be used together with first_frame_url. - Item type: string - **`reference_videos`** (`array`, _optional_): Reference Videos Up to 10 reference videos (2-30 seconds each, 30 seconds combined, mp4/mov, max 200MB each) for motion/style transfer. Cite as '@Video 1' in your prompt. Each clip's full length is billed at the video-input token rate, counted at the output's 4K resolution, on top of the output. - Item type: string - **`reference_audios`** (`array`, _optional_): Reference Audios Up to 10 reference audio files (MP3, 2-30 seconds each, 30 seconds combined, max 15MB each). Cite as '@Audio 1' in your prompt. Audio-only reference is supported on seedance-2.5. - Item type: string - **`duration`** (`integer`, _optional_): Duration Video length in seconds (4-30), or -1 to let the model choose. Video-editing prompts require -1 (output follows the input video, which must be 4-30s). Cost scales with output duration (token-based). - Default: `5` - Options: "-1" (Auto (use for video edits)), "4" (4s), "5" (5s), "6" (6s), "7" (7s), "8" (8s), "9" (9s), "10" (10s), "11" (11s), "12" (12s), "13" (13s), "14" (14s), "15" (15s), "16" (16s), "17" (17s), "18" (18s), "19" (19s), "20" (20s), "21" (21s), "22" (22s), "23" (23s), "24" (24s), "25" (25s), "26" (26s), "27" (27s), "28" (28s), "29" (29s), "30" (30s) - **`resolution`** (`string`, _optional_): Resolution Output resolution. This model renders natively at 4K only (3840x2160 at 16:9, 10-bit, 24fps). Use seedance-2.5 for 480p, 720p or 1080p. - Default: `"4k"` - Options: "4k" (4K) - **`aspect_ratio`** (`string`, _optional_): Aspect Ratio Output aspect ratio. Defaults to adaptive, which lets the model match the prompt or the input media. adaptive is the only value accepted when you supply first_frame_url, or when the prompt asks for a video edit or extension — the output keeps the geometry of the input in those cases. Pick a fixed ratio (16:9 landscape, 9:16 vertical, 21:9 ultrawide) for text-to-video or plain reference-to-video. - Default: `"adaptive"` - Options: "16:9" (16:9), "9:16" (9:16), "1:1" (1:1), "4:3" (4:3), "3:4" (3:4), "21:9" (21:9), "adaptive" (adaptive) - **`generate_audio`** (`boolean`, _optional_): Generate Audio Co-generate synchronized audio (dialogue, SFX, ambient, music) in the same pass. Best for scenes with speech, nature sounds, or music. - Default: `true` - **`seed`** (`integer`, _optional_): Seed Reproducibility seed. Use -1 for random output, set a fixed value to iterate on the same scene. - Default: `42` - Range: -1 to 2147483647 - **`return_last_frame`** (`boolean`, _optional_): Return Last Frame Returns the final video frame as a separate image, delivered in the response as `video.last_frame_url`. Chain shots by feeding that URL into the next generation's `first_frame_url`. Note this is an output: it is distinct from the `last_frame_url` input parameter, which is an image you supply to steer how the clip ends. - Default: `false` - **`skip_moderation`** (`boolean`, _optional_): Skip Moderation Bypass the upstream content moderation pre-filter. Useful when generating artistic content or faces that may trigger false positives. Baseline safety policies still apply. - Default: `true` - **`bitrate_mode`** (`string`, _optional_): Bitrate Mode Output video encoding bitrate. 'standard' gives smaller files and faster downloads; 'high' produces ~5-6x higher bitrate for better visual fidelity and fewer compression artifacts (larger files). Does not affect price. - Default: `"standard"` - Options: "standard" (Standard), "high" (High) - **`auto_resize`** (`boolean`, _optional_): Auto Resize Inputs Automatically resizes an input image that falls outside the provider's accepted range (300-6000px per side, aspect ratio 0.4-2.5, 30MB) so the request succeeds instead of being rejected. Aspect ratio is preserved: oversized images are downscaled, undersized ones upscaled, and out-of-band ratios padded rather than cropped. On by default - set it to false to have the provider reject out-of-range images instead. When a resize happens the response carries an X-Input-Normalized header naming the field and the before/after dimensions. - Default: `true` - **`output_codec`** (`string`, _optional_): Output Codec auto (default) returns the video exactly as the model encodes it: 10-bit HEVC at 4K. h264 re-encodes it for browsers that cannot play HEVC; at 4K that adds noticeable time. - Default: `"auto"` - Options: "auto", "h264" **Required Parameters Example**: ```json { "prompt": "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves." } ``` **Full Example**: ```json { "prompt": "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves.", "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264" } ``` ### Output Schema The API returns a synchronous response based on the model type: **For Image/Video/Audio Models**: - Response contains binary data (image/png, video/mp4, audio/mp3) - Content-Type header indicates the media type - Save the response body directly to a file **For Text Models**: - Response is JSON with the generated text - Structure varies by model **HTTP Response Codes**: - **200 - OK**: Request successful, output in response body - **400 - Bad Request**: Invalid parameters - **401 - Unauthorized**: Invalid or missing API key - **404 - Not Found**: Model not found - **406 - Not Acceptable**: Insufficient credits - **429 - Too Many Requests**: Rate limit exceeded - **500 - Server Error**: Internal server error ## About ### Seedance 2.5 4K: Native 4K AI Video Generation (ByteDance) #### What is Seedance 2.5 4K? Seedance 2.5 4K is ByteDance Seed's video model running at native 3840x2160. It turns a text prompt, a starting image, or a stack of references into a coherent 4-to-30-second clip with synchronized native audio. Unlike an upscaler, the detail is generated at full 4K rather than enlarged from 1080p, and the clip ships in 10-bit colour for smoother gradients and grading headroom. A 4K render is heavy, so the model runs asynchronously: submit the request, then poll for the finished file. #### Key Features - Native 4K (3840x2160) generation, not upscaled, in 10-bit colour. - Synchronized native audio: dialogue, sound effects, and music co-generated with the picture. - Durations of 4 to 30 seconds in a single pass, with multi-shot Shot 1: / Shot 2: scripting. - Up to 30 reference images, 10 reference videos and 10 reference audios, cited as @Image 1, @Video 1 and @Audio 1. - Modes: text-to-video, image-to-video (first_frame_url), and first-to-last-frame transitions. - Delivered as 10-bit HEVC by default; an h264 option re-encodes for any browser. #### Best Use Cases The native-4K pipeline fits professional production: commercials and product films shown on large screens, previsualization at final resolution, texture-heavy footage where fine detail sells realism, and music or performance clips that lean on synchronized audio. Reference control keeps a character or palette consistent across a shot, and single-pass durations up to 30 seconds remove the continuity breaks of stitching shorter clips. #### Prompt Tips and Output Quality Write the shot as evolving motion: subject and action first, then scene, one camera move, and sound. Favour concrete nouns over adjectives. For image-to-video, pass first_frame_url and set aspect_ratio to adaptive; avoid real human faces in first frames, which policy blocks. In testing, a 4-second 4K text-to-video of a hummingbird held crisp feather detail and airborne pollen with clean, fast wing motion. ## Usage Guide ### How to Use Seedance 2.5 4K Seedance 2.5 4K generates video natively at 3840x2160 from a text prompt, a first frame, or references, with synchronized native audio. Because each 4K render is heavy, the model runs asynchronously: submit your request, then poll the returned job URL until the clip is ready, usually a few minutes. #### Choosing a mode - Text-to-video: write a prompt and leave first_frame_url empty. Set aspect_ratio to 16:9 or 9:16. - Image-to-video: pass first_frame_url and set aspect_ratio to adaptive so the output follows your frame. Do not use real human faces in the first frame. - Reference-led: add up to 30 reference images, up to 10 reference videos and up to 10 reference audios, and name each one in the prompt as @Image 1, @Video 1 or @Audio 1. A reference video is billed for its full length, counted at 4K, on top of the output. References and first_frame_url cannot be combined. #### Writing the prompt Structure it like a short production brief: subject and action first, then scene, one camera move, and the sound. Use concrete nouns, keep one clear action, and add Shot 1: / Shot 2: lines for multi-beat sequences. Vague or over-long prompts tend to drift over a longer clip. #### Output format (read this) By default the clip is delivered as 10-bit HEVC (H.265). HEVC does not play in every browser. Set output_codec to h264 to receive an H.264 file that plays everywhere; at 4K this re-encode adds some delivery time. Use bitrate_mode high for maximum fidelity, or standard for smaller files. #### Recommended Settings - Quick preview: duration 4, resolution 4k, aspect_ratio 16:9, generate_audio true, output_codec h264. - Finished delivery: set duration to match your beat (up to 30) and bitrate_mode high; keep the default HEVC for 10-bit grading, or h264 for the web. - Reproducibility: fix seed to iterate the same scene; use -1 for variety. The default example, a 4-second 4K hummingbird macro, rendered cleanly with crisp feather detail, airborne pollen, fast wing motion, and ambient audio. #### Examples to try Each example ran end to end at the settings shown - native 4K (3840x2160), 24 fps, 4 to 10 seconds, synchronized audio, in a browser-friendly h264 file - so the framing, motion and length are exactly what the body produces. - **Native 4K detail (default).** Prompt: "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves." Feather barbs and airborne pollen stay sharp while the wings blur with fast motion. Tip: keep one clear action for the cleanest macro. - **Lifelike human skin and texture.** Prompt: "An elderly woman weaves a basket from pale rattan reeds, her weathered hands bending a strand into place; close on her lined face and attentive eyes as she looks down at the work. Steady close-up. Quiet sound of creaking reeds." Pores, fine lines and veined hands read naturally, with no plastic AI sheen. Tip: frame a tight portrait and name the material; 9:16 suits vertical feeds. ##### Reference-guided prompts Pass up to 30 reference images, 10 reference videos and 10 audios, cite each as @Image 1, @Video 1 or @Audio 1, and say what must stay identical or which motion to follow. A reference video is billed for its full length on top of the output. References and first_frame_url cannot be combined. - **Product consistency from a reference image.** Prompt: "@Image 1 is the porcelain teapot. Keep its blue-and-white bird-and-branch motif, curved spout and round shape identical. A hand lifts the teapot and pours a thin stream of amber tea into a matching white cup on a pale linen cloth; steam rises from the cup. Static camera. Quiet pouring sound." The painted bird motif, spout and shape hold across the pour. Tip: one clean studio reference locks a product best. - **Cinematic action from a reference video.** Prompt: "Follow the camera movement and pacing of @Video 1. A scarred, bearded warrior in battered bronze armor, a burning chain whip wrapped around one forearm, sprints along the rooftops of a crumbling desert palace at sunset as a towering stone colossus smashes the domes behind him. He runs up a carved sandstone wall, flips over a falling beam, lashes the burning chain around the colossus's wrist and swings across a chasm, landing in a roll as debris and embers rain down. Epic, sweeping action, golden dust, deep crashing sound, roaring wind and a war cry." @Video 1 is a 5-second rooftop parkour clip; the 10-second 4K shot keeps its tracking camera and pacing while the scene, warrior and colossus come from the prompt, with crashing sound and a war cry. Tip: use the reference for camera and timing, and describe everything you want to see. Also try: "Shot 1: wide, Shot 2: close" for a two-beat sequence in one pass; a 9:16 vertical for social; or a duration up to 30 seconds for a full scene. ## FAQ ### Does it output true 4K? Yes, 3840x2160 generated natively, not upscaled. ### Does it include audio? Yes, synchronized native audio when generate_audio is enabled. ### Why is it asynchronous? A 4K render takes several minutes, so you submit and poll. ### What video codec do I get? 10-bit HEVC by default; set output_codec to h264 for a browser-friendly file. ### Can it use an existing clip? Yes: pass it as a reference video, cited as @Video 1, to carry its motion, camera move or style into a new 4K shot. The reference is billed for its full length on top of the output. ## Examples Requests run on the playground, the output each produced, and the API call that makes it. ### Seedance 2.5 4K cinematic camera movement > Follow the camera movement and pacing of @Video 1. A scarred, bearded warrior in battered bronze armor, a burning chain whip wrapped around one forearm, sprints along the rooftops of a crumbling desert palace at sunset as a towering stone colossus smashes the domes behind him. He runs up a carved sandstone wall, flips over a falling beam, lashes the burning chain around the colossus's wrist and swings across a chasm, landing in a roll as debris and embers rain down. Epic, sweeping action, golden dust, deep crashing sound, roaring wind and a war cry. Output: https://segmind-resources.s3.amazonaws.com/output/seedance-2.5-4k-example-video-reference-action-ea0ad2b7.mp4 ```bash # 1. Submit the request; the reply carries its request_id REQUEST_ID=$(curl -s -X POST "https://api.segmind.com/v2/seedance-2.5-4k" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Follow the camera movement and pacing of @Video 1. A scarred, bearded warrior in battered bronze armor, a burning chain whip wrapped around one forearm, sprints along the rooftops of a crumbling desert palace at sunset as a towering stone colossus smashes the domes behind him. He runs up a carved sandstone wall, flips over a falling beam, lashes the burning chain around the colossus'\''s wrist and swings across a chasm, landing in a roll as debris and embers rain down. Epic, sweeping action, golden dust, deep crashing sound, roaring wind and a war cry.", "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_videos": [ "https://segmind-resources.s3.amazonaws.com/input/seedance-2.5-4k-action-reference-5s.mp4" ], "reference_audios": [], "duration": 10, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264" }' | jq -r .request_id) # 2. Check its status until it is COMPLETED curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID/status" \ -H "x-api-key: YOUR_API_KEY" # 3. Fetch the result curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID" \ -H "x-api-key: YOUR_API_KEY" ``` ### Seedance 2.5 4K nature documentary footage > A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves. Output: https://segmind-resources.s3.amazonaws.com/output/seedance-2.5-4k-example-output-7f57908c.mp4 ```bash # 1. Submit the request; the reply carries its request_id REQUEST_ID=$(curl -s -X POST "https://api.segmind.com/v2/seedance-2.5-4k" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves.", "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264" }' | jq -r .request_id) # 2. Check its status until it is COMPLETED curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID/status" \ -H "x-api-key: YOUR_API_KEY" # 3. Fetch the result curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID" \ -H "x-api-key: YOUR_API_KEY" ``` ### Seedance 2.5 4K stock video generation > An elderly woman weaves a basket from pale rattan reeds, her weathered hands bending a strand into place; close on her lined face and attentive eyes as she looks down at the work. Steady close-up. Quiet sound of creaking reeds. Output: https://segmind-resources.s3.amazonaws.com/output/seedance-2.5-4k-example-skin-texture-15f8187b.mp4 ```bash # 1. Submit the request; the reply carries its request_id REQUEST_ID=$(curl -s -X POST "https://api.segmind.com/v2/seedance-2.5-4k" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "9:16", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264", "prompt": "An elderly woman weaves a basket from pale rattan reeds, her weathered hands bending a strand into place; close on her lined face and attentive eyes as she looks down at the work. Steady close-up. Quiet sound of creaking reeds." }' | jq -r .request_id) # 2. Check its status until it is COMPLETED curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID/status" \ -H "x-api-key: YOUR_API_KEY" # 3. Fetch the result curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID" \ -H "x-api-key: YOUR_API_KEY" ``` ### Seedance 2.5 4K product video ad generator > @Image 1 is the porcelain teapot. Keep its blue-and-white bird-and-branch motif, curved spout and round shape identical. A hand lifts the teapot and pours a thin stream of amber tea into a matching white cup on a pale linen cloth; steam rises from the cup. Static camera. Quiet pouring sound. Output: https://segmind-resources.s3.amazonaws.com/output/seedance-2.5-4k-example-reference-consistency-f0dbf9a6.mp4 ```bash # 1. Submit the request; the reply carries its request_id REQUEST_ID=$(curl -s -X POST "https://api.segmind.com/v2/seedance-2.5-4k" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "first_frame_url": "", "last_frame_url": "", "reference_images": [ "https://segmind-resources.s3.amazonaws.com/input/seedance-2.5-4k-example-reference-teapot-3c1a1fda.jpg" ], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264", "prompt": "@Image 1 is the porcelain teapot. Keep its blue-and-white bird-and-branch motif, curved spout and round shape identical. A hand lifts the teapot and pours a thin stream of amber tea into a matching white cup on a pale linen cloth; steam rises from the cup. Static camera. Quiet pouring sound." }' | jq -r .request_id) # 2. Check its status until it is COMPLETED curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID/status" \ -H "x-api-key: YOUR_API_KEY" # 3. Fetch the result curl -s "https://api.segmind.com/v2/requests/$REQUEST_ID" \ -H "x-api-key: YOUR_API_KEY" ``` ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/seedance-2.5-4k" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves.", "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264" }' \ -o output.mp4 ``` ### Python ```python import requests import json url = "https://api.segmind.com/v1/seedance-2.5-4k" headers = { "x-api-key": "YOUR_API_KEY", "Content-Type": "application/json" } data = { "prompt": "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves.", "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264" } response = requests.post(url, headers=headers, json=data) if response.status_code == 200: # Media models return the file itself; a JSON body carries the result instead. if response.headers.get("Content-Type", "").startswith("application/json"): print(json.dumps(response.json(), indent=2)) else: with open("output.mp4", "wb") as f: f.write(response.content) print("Saved output.mp4") else: print(f"Error: {response.status_code}") print(response.text) ``` ### JavaScript ```javascript import { writeFile } from 'node:fs/promises'; const response = await fetch('https://api.segmind.com/v1/seedance-2.5-4k', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "prompt": "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves.", "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264" }), }); if (response.ok) { // Media models return the file itself; a JSON body carries the result instead. if ((response.headers.get('content-type') || '').startsWith('application/json')) { console.log(await response.json()); } else { await writeFile('output.mp4', Buffer.from(await response.arrayBuffer())); console.log('Saved output.mp4'); } } else { console.error('Error:', response.status); console.error(await response.text()); } ``` ### JavaScript (SDK) ```javascript // npm install segmind // export SEGMIND_API_KEY="YOUR_API_KEY" import { InferenceFailed, InferenceTimeout, Segmind } from 'segmind'; const segmind = new Segmind(); // reads SEGMIND_API_KEY // Async (v2) — recommended for long-running / video models. // run() waits up to 10 minutes; submit + job.wait({ timeout }) sets a longer // deadline and keeps the requestId so you can check again later. const job = await segmind.submit('seedance-2.5-4k', { "prompt": "A ruby-throated hummingbird hovers at an orange trumpet flower in a shaded garden, iridescent green feathers and fast-beating wings crisp in extreme close-up; it slips its slender beak into the bloom, knocks a puff of pollen into the air, then darts upward out of frame. Steady macro shot. Natural sound of humming wingbeats and rustling leaves.", "first_frame_url": "", "last_frame_url": "", "reference_images": [], "reference_audios": [], "duration": 4, "resolution": "4k", "aspect_ratio": "16:9", "generate_audio": true, "seed": 42, "return_last_frame": false, "skip_moderation": false, "bitrate_mode": "standard", "auto_resize": true, "output_codec": "h264" }); console.log(job.requestId); // available immediately try { const result = await job.wait({ timeout: 15 * 60_000, interval: 2_000 }); console.log(result.output); // model output (e.g. video URL) } catch (err) { if (err instanceof InferenceTimeout) console.log('still running:', err.requestId); else if (err instanceof InferenceFailed) console.log('failed:', err.detail); else throw err; } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.segmind.com/models/seedance-2.5-4k) - [API Documentation](https://www.segmind.com/models/seedance-2.5-4k/api) - [Pricing Details](https://www.segmind.com/models/seedance-2.5-4k/pricing) - [Platform Documentation](https://docs.segmind.com/)