Video
Use POST /v1/video/generations for synchronous video generation. The HTTP connection stays open while the provider renders the result, so set a generous client timeout.
POST https://api.rout.my/v1/video/generationsAvailable models
| Model | What it does | Resolutions | Duration | Audio |
|---|---|---|---|---|
bytedance/seedance-2.5 | Text-to-video, image-to-video, first/last frame, reference-to-video, video editing, extend | 480p, 720p | 4–30 s | Yes |
qwen/wan-v2.7 | Text-to-video and reference-to-video (mode selected automatically) | 720p, 1080p | 2–15 s (t2v), 2–10 s (r2v) | Yes |
google/gemini-omni-flash-preview can also emit video, but it is a language model on /v1/chat/completions, not a video endpoint. It is not accepted here.
Always use the exact model IDs returned by /v1/models.
Request
curl --max-time 900 https://api.rout.my/v1/video/generations \
-H "Authorization: Bearer ***" \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedance-2.5",
"prompt": "A slow camera move across a glass cube on a white table",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}'Request fields
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | Yes | Exact video model ID from /v1/models. |
prompt | string or object | Yes | Text prompt, or { "text": "...", "image": "..." } for image-to-video. |
duration | number | No | Seconds. Clamped to the model's range. |
resolution | string | No | 480p, 720p, 1080p, or WIDTHxHEIGHT depending on the model. |
aspect_ratio, aspectRatio | string | No | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9. Ignored when an input image defines it — see below. |
n, sampleCount | integer | No | Number of outputs. Seedance always returns exactly 1. |
audio | boolean | No | Enable generated audio where supported. |
negative_prompt, negativePrompt | string | No | Content to avoid. |
seed | integer | No | Deterministic seed when supported. |
input_image | string | No | URL, data URI, or raw base64. Used as the first frame. |
image, image_url, input_image_url, input_image_b64 | string | No | Aliases for the image input. |
last_frame_image, lastFrameImage, image_tail, imageTail | string | No | Ending frame for first/last-frame generation. |
reference_images, referenceImages | string[] | No | Image references that guide content without pinning the first frame. |
reference_videos, referenceVideos | string[] | No | Video references. |
reference_urls, referenceUrls | string[] | No | Mixed references; video items are inferred from the file extension. |
input_video, input_video_b64 | string | No | Source clip for editing/extending. Triggers video-input pricing. |
input_audio, input_audio_b64, audio_url, audioUrl | string | No | External audio track where supported. |
prompt_enhancement, enhance_prompt, prompt_extend, enable_prompt_expansion | boolean | No | Prompt expansion switch. |
camera_fixed, cameraFixed | boolean | No | Lock the camera (Seedance). |
shot_type, shotType | string | No | Wan reference-to-video shot type: single or multi. |
watermark | boolean | No | Watermark flag where supported. |
service_tier, serviceTier | string | No | default or flex on Seedance. |
poll_timeout_ms, poll_interval_ms | integer | No | Job polling timeout and interval. |
user | string | No | Client-side user identifier. |
Base64 and data URI media are temporarily hosted as URLs when the provider requires a URL.
Seedance 2.5
One model covers six modes; which one runs is inferred from the fields you send.
| Mode | Send |
|---|---|
| Text-to-video | prompt only |
| Image-to-video | input_image, or prompt: { text, image } |
| First/last frame | input_image + last_frame_image |
| Reference-to-video | reference_images and/or reference_videos |
| Video editing | input_video + a prompt describing the change |
| Extend video | input_video with a continuation prompt |
Limits: 480p or 720p, 4–30 seconds, 24 fps, exactly one video per call. Input images: up to 30, JPEG/PNG/WebP/BMP/TIFF/GIF/HEIC/HEIF. Input videos: up to 10 clips, MP4/MOV, 2–30 s each. Input audio: MP3/WAV, 2–30 s.
Aspect ratio and input images
When you send a first-frame image, do not send aspect_ratio. ByteDance derives the output ratio from that image and rejects the request outright if a ratio is also specified:
The parameter ratio specified in the request is not valid. For first-frame
or first-last-frame generation, the output ratio follows the first-frame image.rout.my strips aspect_ratio for you in this case, so a request carrying both still succeeds — the image wins. Crop the image to the ratio you want.
aspect_ratio does apply to text-to-video and to reference-to-video, since neither pins the frame.
{
"model": "bytedance/seedance-2.5",
"prompt": {
"text": "Animate this product with a slow turntable movement.",
"image": "https://example.com/product.png"
},
"duration": 5,
"resolution": "720p"
}References
Reference images guide characters, style, or props without becoming the first frame. Refer to them positionally in the prompt.
{
"model": "bytedance/seedance-2.5",
"prompt": "Use [Image 1] as the main character and [Image 2] as the product in a cinematic street scene.",
"reference_images": [
"https://example.com/character.png",
"https://example.com/product.png"
],
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}When input_image is combined with audio or video references, rout.my routes the image to reference_images instead of the first frame, so reference media and the frame do not conflict.
Editing and extending
{
"model": "bytedance/seedance-2.5",
"prompt": "Make the camera movement smoother and keep the same subject.",
"input_video": "https://example.com/source.mp4",
"duration": 5,
"resolution": "720p"
}A request whose input contains video is billed at a reduced rate, but the source clip's own duration is billed too — see below.
Wan 2.7
qwen/wan-v2.7 routes to the right upstream mode automatically:
- no reference fields → text-to-video (
720p/1080p, 2–15 s) - any
reference_images,reference_videos, orreference_urls→ reference-to-video (2–10 s, up to 5 images or 3 clips)
{
"model": "qwen/wan-v2.7",
"prompt": "Image 1 and Video 1 walk through a rainy city",
"duration": 6,
"resolution": "1080p",
"reference_images": ["https://example.com/character.png"],
"reference_videos": ["https://example.com/motion.mp4"]
}Prefer the typed reference_images / reference_videos fields when mixing media, so the router does not have to guess from filenames. Wan accepts resolution as 720p/1080p or as WIDTHxHEIGHT.
Response
{
"created": 1744000000,
"model": "bytedance/seedance-2.5",
"duration": 5,
"videos": [
{
"url": "https://api.rout.my/public/media/generated.mp4",
"mime_type": "video/mp4"
}
]
}Generated URLs are temporary. Download and re-host anything you need to keep.
Quota accounting
Two models of billing are in use, depending on the provider.
Seedance 2.5 is billed per video token, matching ByteDance's own metering:
tokens = (output_sec + input_video_sec) x width x height x 24 / 1024Both resolutions bill at the same rate per token, so the price difference comes from the pixel count. A minimum token floor applies per clip based on output duration, and any request whose input contains video is billed at the reduced rate — including the input clip's own seconds.
| Resolution | Tokens per second | Cost per second |
|---|---|---|
480p (854x480) | 9,607.5 | $0.1028 |
720p (1280x720) | 21,600 | $0.2311 |
With video in the input the rate drops from $10.70 to $6.40 per million tokens, i.e. $0.0615/s at 480p and $0.1382/s at 720p.
Wan 2.7 is billed per second of output: $0.10/s at 720p and $0.15/s at 1080p.
Quota tokens are derived from the same figures and scaled by the model's token_multiplier.