Video
Use POST /v1/video/generations for synchronous video generation. The HTTP connection stays open while the provider renders the result.
POST https://api.rout.my/v1/video/generationsRequest
curl --max-time 900 https://api.rout.my/v1/video/generations \
-H "Authorization: Bearer $ROUTMY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "provider/video-model-id",
"prompt": "A slow camera move across a glass cube on a white table",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"n": 1
}'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. |
input_image | string | No | URL, data URI, or raw base64 image for image-to-video. |
input_image_b64 | string | No | Explicit base64 image input. |
image, image_url, input_image_url | string | No | Accepted aliases for image input. |
input_video | string | No | URL, data URI, or raw base64 source video for edit mode. |
input_video_b64 | string | No | Explicit base64 source video input. |
input_audio | string | No | URL, data URI, or raw base64 source audio for models that support an external audio track. |
input_audio_b64 | string | No | Explicit base64 audio input. |
duration | number | No | Requested duration in seconds. Maximum is clamped server-side. |
resolution | string | No | Values such as 480p, 720p, 1080p, 4K, or WIDTHxHEIGHT. |
aspect_ratio, aspectRatio | string | No | Values such as 16:9, 9:16, 1:1, 4:3, 3:4. |
n, sampleCount | integer | No | Number of output videos. Defaults to 1. |
audio | boolean | No | Explicit audio on/off. |
sound | string | No | Audio switch for providers that expose string flags, for example Kling on or off. |
tier | string | No | Friendly video quality tier. For Kling, standard maps to mode:"std", pro maps to mode:"pro", and 4k maps to mode:"4k" when supported. |
quality, mode | string | No | Values such as draft, std, pro, 4k, lossless, optimized, single, or multi, when supported by the selected model. |
negative_prompt, negativePrompt | string | No | Content to avoid. |
seed | integer | No | Deterministic generation seed when supported. |
last_frame_image, lastFrameImage, image_tail, imageTail | string | No | Ending frame for first/last-frame models. |
reference_urls, referenceUrls | string[] | No | Reference media URLs for reference-to-video models. Data URI/base64 entries are temporarily hosted when possible. |
reference_images, referenceImages | string[] | No | Reference image URLs for multi-reference models. |
reference_videos, referenceVideos | string[] | No | Reference video URLs for models that support video references. |
watermark | boolean | No | Watermark flag when supported. |
prompt_enhancement, enhance_prompt, prompt_extend, enable_prompt_expansion | boolean | No | Unified prompt expansion/enhancement switch. CamelCase aliases are accepted. |
camera_fixed, cameraFixed | boolean | No | Fixed camera flag for supported Seedance models. |
cfg_scale, cfgScale | number | No | Guidance scale for supported Kling models. |
camera_control, cameraControl | string | No | Kling camera control mode. |
camera_control_config, cameraControlConfig | object | No | Kling camera control config object. |
shot_type, shotType | string | No | Wan reference-to-video shot type, usually single or multi. |
character_orientation, characterOrientation | string | No | Kling motion-control orientation, usually image or video. |
keep_original_sound, keepOriginalSound | boolean | No | Kling motion-control source audio flag. |
voice_list, voiceList | object[] | No | Kling voice-control voices, up to 2 entries such as { "voice_id": "..." }. Use prompt markers like <<<voice_1>>> and enable audio with sound:"on" or audio:true. |
person_generation, personGeneration | string | No | Veo person generation mode when supported. |
resize_mode, resizeMode | string | No | Veo resize mode when supported. |
compression_quality, compressionQuality | string | No | Veo compression quality when supported. |
service_tier, serviceTier | string | No | Service tier for models that support it, for example Seedance default or flex. |
audio_url, audioUrl | string | No | Accepted aliases for input_audio. |
poll_timeout_ms, pollTimeoutMs | integer | No | Video job polling timeout in milliseconds. |
poll_interval_ms, pollIntervalMs | integer | No | Video job polling interval in milliseconds. |
user | string | No | Optional client-side user identifier. |
Use the exact model IDs returned by /v1/models.
Optional video controls
These fields are accepted at the top level. Availability depends on the selected model.
| Field | Notes |
|---|---|
audio | Enables model audio when supported. |
sound | Kling audio switch, usually on or off. |
negative_prompt, negativePrompt | Content to avoid when supported. |
prompt_enhancement, enhance_prompt, prompt_extend, enable_prompt_expansion | Prompt expansion/enhancement when supported. |
tier, quality, mode | Quality or mode selection, for example Kling std/pro/4k or Wan single/multi. |
watermark | Watermark flag when supported. |
last_frame_image, lastFrameImage, image_tail, imageTail | Ending frame for first/last-frame models. |
voice_list, voiceList | Kling voice control. If prompt uses <<<voice_1>>>, pass matching voices and enable audio. |
n, sampleCount | Multiple outputs for models that support them. |
reference_urls, referenceUrls | Reference media for -r2v models such as Wan reference-to-video. |
reference_images, referenceImages | Multiple image references for models that support them, including Seedance 2.0 and Wan reference-to-video. |
reference_videos, referenceVideos | Multiple video references for models that support them, including Seedance 2.0. |
input_video, video_url, videoUrl | Source video for xAI video editing, Kling motion-control, or a single Seedance 2.0 video reference. |
input_audio, audio_url, audioUrl | External audio track when supported. |
poll_timeout_ms, poll_interval_ms | Longer waits for slow video jobs. |
Some editing and motion-control models ignore duration, resolution, and aspect_ratio.
Kling tiers, audio, and voice control
Kling Standard / Pro / 4K can be selected with tier, mode, or quality:
{
"model": "klingai/kling-v3.0-t2v",
"prompt": "A chef plates a dessert with cinematic lighting.",
"tier": "pro",
"sound": "on",
"duration": 5,
"aspect_ratio": "16:9"
}tier:"standard" becomes Kling mode std, tier:"pro" becomes pro, and tier:"4k" becomes 4k when the selected Kling model supports it.
For voice control, add voice_list and reference voices from the prompt:
{
"model": "klingai/kling-v3.0-t2v",
"prompt": "The man <<<voice_1>>> said, \"Hello.\"",
"tier": "pro",
"sound": "on",
"voice_list": [
{ "voice_id": "voice-id-from-provider" }
]
}Voice control accepts up to 2 voices. If the prompt contains <<<voice_1>>> markers, voice_list is required and sound must be enabled.
Veo
Use Veo model IDs from /v1/models, for example google/veo-3.1 or google/veo-3.1-fast.
{
"model": "google/veo-3.1-fast",
"prompt": "A robot skating through a neon arcade, cinematic motion",
"duration": 6,
"resolution": "720p",
"aspect_ratio": "16:9",
"n": 2,
"audio": true
}For Veo text-to-video, duration must be 4, 6, or 8; resolution must be 720p or 1080p (4K is also accepted on Veo 3.1 models); aspect_ratio must be 16:9 or 9:16. Use n/sampleCount for multiple outputs when supported.
Image-to-video
{
"model": "provider/video-model-id",
"prompt": {
"text": "Animate this product with a slow turntable movement.",
"image": "https://example.com/source.png"
},
"duration": 5,
"resolution": "720p"
}Base64 and data URI images are temporarily hosted as URLs when needed.
xAI Grok Imagine 1.5 Preview
x-ai/grok-imagine-video-1.5-preview is image-to-video. It requires an image input and does not support text-to-video.
{
"model": "x-ai/grok-imagine-video-1.5-preview",
"prompt": "Slow cinematic push-in as embers drift across the battlefield and the helmet's crest stirs in the wind",
"image_url": "https://your-host.com/helmet.jpg",
"duration": 10,
"resolution": "720p"
}Accepted image aliases are input_image, image_url, and prompt:{"image":"..."}. input_video is not used for this model.
Seedance 2.0 Fast
bytedance/seedance-2.0-fast supports text-to-video, image-to-video, and multimodal references through reference_images, reference_videos, input_video, and input_audio.
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Use the image as visual reference and animate it with a slow cinematic camera move.",
"input_image": "https://example.com/reference.png",
"duration": 5,
"resolution": "480p",
"aspect_ratio": "16:9"
}For multiple image references:
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Use [Image 1] as the main character and [Image 2] as the product reference 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"
}For a video reference, use input_video for one clip or reference_videos for multiple clips. For an audio reference, use input_audio or audio_url. When input_image is combined with audio/video references on Seedance 2.0, rout.my treats the image as a reference image to avoid first-frame/reference-media conflicts.
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Use the image references for characters, the video reference for motion, and the audio reference for soundtrack timing.",
"reference_images": [
"https://example.com/character.png",
"https://example.com/background.png"
],
"reference_videos": [
"https://example.com/motion.mp4"
],
"input_audio": "https://example.com/music.mp3",
"duration": 5,
"resolution": "480p",
"aspect_ratio": "16:9"
}Video editing
{
"model": "provider/video-model-id",
"prompt": "Make the camera movement smoother and keep the same subject.",
"input_video": "https://example.com/source.mp4",
"duration": 5,
"resolution": "720p"
}input_video triggers video-input accounting. Base64 videos can be passed through input_video_b64 and are temporarily hosted when needed.
For some edit and motion-control models, duration, resolution, and aspect_ratio are not supported and may be ignored.
Motion control
{
"model": "klingai/kling-v2.6-motion-control",
"prompt": {
"image": "https://example.com/character.png",
"text": "Make the character follow the reference motion."
},
"input_video": "https://example.com/reference-motion.mp4",
"mode": "pro",
"character_orientation": "image",
"keep_original_sound": false
}Motion-control models require both a character image and a reference video URL.
Reference-to-video
{
"model": "qwen/wan-v2.6-r2v",
"prompt": "character1 and character2 talk in a cafe",
"reference_urls": [
"https://example.com/character1.png",
"https://example.com/character2.png"
],
"duration": 4,
"resolution": "1080p",
"mode": "single"
}reference_urls is required for -r2v models. These models use reference media instead of a primary input_image.
Response
{
"created": 1744000000,
"model": "provider/video-model-id",
"duration": 5,
"videos": [
{
"url": "https://api.rout.my/public/media/generated.mp4",
"mime_type": "video/mp4"
}
]
}Generated video URLs are temporary. Download and re-host them if your application needs long-term storage.
Quota accounting
Video requests use a duration-based formula:
tokens = duration_sec x 60,000 x resolution x audio x quality x video_input x n x token_multiplierCommon coefficients:
| Factor | Value | Multiplier |
|---|---|---|
| resolution | 480p | 0.7 |
| resolution | 720p or 1K | 1.0 |
| resolution | 1080p or 2K | 1.8 |
| resolution | 4K | 2.5 |
| audio | off | 1.0 |
| audio | on | 1.3 |
| quality | draft | 0.3 |
| quality | std or optimized | 1.0 |
| quality | pro or lossless | 1.5 |
| video input | absent | 1.0 |
| video input | present | 1.7 |
Quota is checked before generation starts. If quota is insufficient, the request returns 429.