Skip to content

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.

text
POST https://api.rout.my/v1/video/generations

Available models

ModelWhat it doesResolutionsDurationAudio
bytedance/seedance-2.5Text-to-video, image-to-video, first/last frame, reference-to-video, video editing, extend480p, 720p4–30 sYes
qwen/wan-v2.7Text-to-video and reference-to-video (mode selected automatically)720p, 1080p2–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

bash
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

FieldTypeRequiredNotes
modelstringYesExact video model ID from /v1/models.
promptstring or objectYesText prompt, or { "text": "...", "image": "..." } for image-to-video.
durationnumberNoSeconds. Clamped to the model's range.
resolutionstringNo480p, 720p, 1080p, or WIDTHxHEIGHT depending on the model.
aspect_ratio, aspectRatiostringNo16:9, 9:16, 1:1, 4:3, 3:4, 21:9. Ignored when an input image defines it — see below.
n, sampleCountintegerNoNumber of outputs. Seedance always returns exactly 1.
audiobooleanNoEnable generated audio where supported.
negative_prompt, negativePromptstringNoContent to avoid.
seedintegerNoDeterministic seed when supported.
input_imagestringNoURL, data URI, or raw base64. Used as the first frame.
image, image_url, input_image_url, input_image_b64stringNoAliases for the image input.
last_frame_image, lastFrameImage, image_tail, imageTailstringNoEnding frame for first/last-frame generation.
reference_images, referenceImagesstring[]NoImage references that guide content without pinning the first frame.
reference_videos, referenceVideosstring[]NoVideo references.
reference_urls, referenceUrlsstring[]NoMixed references; video items are inferred from the file extension.
input_video, input_video_b64stringNoSource clip for editing/extending. Triggers video-input pricing.
input_audio, input_audio_b64, audio_url, audioUrlstringNoExternal audio track where supported.
prompt_enhancement, enhance_prompt, prompt_extend, enable_prompt_expansionbooleanNoPrompt expansion switch.
camera_fixed, cameraFixedbooleanNoLock the camera (Seedance).
shot_type, shotTypestringNoWan reference-to-video shot type: single or multi.
watermarkbooleanNoWatermark flag where supported.
service_tier, serviceTierstringNodefault or flex on Seedance.
poll_timeout_ms, poll_interval_msintegerNoJob polling timeout and interval.
userstringNoClient-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.

ModeSend
Text-to-videoprompt only
Image-to-videoinput_image, or prompt: { text, image }
First/last frameinput_image + last_frame_image
Reference-to-videoreference_images and/or reference_videos
Video editinginput_video + a prompt describing the change
Extend videoinput_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:

text
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.

json
{
  "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.

json
{
  "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

json
{
  "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, or reference_urls → reference-to-video (2–10 s, up to 5 images or 3 clips)
json
{
  "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

json
{
  "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:

text
tokens = (output_sec + input_video_sec) x width x height x 24 / 1024

Both 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.

ResolutionTokens per secondCost 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.

API documentation for rout.my.