Skip to content

Video

Use POST /v1/video/generations for synchronous video generation. The HTTP connection stays open while the provider renders the result.

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

Request

bash
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

FieldTypeRequiredNotes
modelstringYesExact video model ID from /v1/models.
promptstring or objectYesText prompt, or { "text": "...", "image": "..." } for image-to-video.
input_imagestringNoURL, data URI, or raw base64 image for image-to-video.
input_image_b64stringNoExplicit base64 image input.
image, image_url, input_image_urlstringNoAccepted aliases for image input.
input_videostringNoURL, data URI, or raw base64 source video for edit mode.
input_video_b64stringNoExplicit base64 source video input.
input_audiostringNoURL, data URI, or raw base64 source audio for models that support an external audio track.
input_audio_b64stringNoExplicit base64 audio input.
durationnumberNoRequested duration in seconds. Maximum is clamped server-side.
resolutionstringNoValues such as 480p, 720p, 1080p, 4K, or WIDTHxHEIGHT.
aspect_ratio, aspectRatiostringNoValues such as 16:9, 9:16, 1:1, 4:3, 3:4.
n, sampleCountintegerNoNumber of output videos. Defaults to 1.
audiobooleanNoExplicit audio on/off.
soundstringNoAudio switch for providers that expose string flags, for example Kling on or off.
tierstringNoFriendly video quality tier. For Kling, standard maps to mode:"std", pro maps to mode:"pro", and 4k maps to mode:"4k" when supported.
quality, modestringNoValues such as draft, std, pro, 4k, lossless, optimized, single, or multi, when supported by the selected model.
negative_prompt, negativePromptstringNoContent to avoid.
seedintegerNoDeterministic generation seed when supported.
last_frame_image, lastFrameImage, image_tail, imageTailstringNoEnding frame for first/last-frame models.
reference_urls, referenceUrlsstring[]NoReference media URLs for reference-to-video models. Data URI/base64 entries are temporarily hosted when possible.
reference_images, referenceImagesstring[]NoReference image URLs for multi-reference models.
reference_videos, referenceVideosstring[]NoReference video URLs for models that support video references.
watermarkbooleanNoWatermark flag when supported.
prompt_enhancement, enhance_prompt, prompt_extend, enable_prompt_expansionbooleanNoUnified prompt expansion/enhancement switch. CamelCase aliases are accepted.
camera_fixed, cameraFixedbooleanNoFixed camera flag for supported Seedance models.
cfg_scale, cfgScalenumberNoGuidance scale for supported Kling models.
camera_control, cameraControlstringNoKling camera control mode.
camera_control_config, cameraControlConfigobjectNoKling camera control config object.
shot_type, shotTypestringNoWan reference-to-video shot type, usually single or multi.
character_orientation, characterOrientationstringNoKling motion-control orientation, usually image or video.
keep_original_sound, keepOriginalSoundbooleanNoKling motion-control source audio flag.
voice_list, voiceListobject[]NoKling 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, personGenerationstringNoVeo person generation mode when supported.
resize_mode, resizeModestringNoVeo resize mode when supported.
compression_quality, compressionQualitystringNoVeo compression quality when supported.
service_tier, serviceTierstringNoService tier for models that support it, for example Seedance default or flex.
audio_url, audioUrlstringNoAccepted aliases for input_audio.
poll_timeout_ms, pollTimeoutMsintegerNoVideo job polling timeout in milliseconds.
poll_interval_ms, pollIntervalMsintegerNoVideo job polling interval in milliseconds.
userstringNoOptional 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.

FieldNotes
audioEnables model audio when supported.
soundKling audio switch, usually on or off.
negative_prompt, negativePromptContent to avoid when supported.
prompt_enhancement, enhance_prompt, prompt_extend, enable_prompt_expansionPrompt expansion/enhancement when supported.
tier, quality, modeQuality or mode selection, for example Kling std/pro/4k or Wan single/multi.
watermarkWatermark flag when supported.
last_frame_image, lastFrameImage, image_tail, imageTailEnding frame for first/last-frame models.
voice_list, voiceListKling voice control. If prompt uses <<<voice_1>>>, pass matching voices and enable audio.
n, sampleCountMultiple outputs for models that support them.
reference_urls, referenceUrlsReference media for -r2v models such as Wan reference-to-video.
reference_images, referenceImagesMultiple image references for models that support them, including Seedance 2.0 and Wan reference-to-video.
reference_videos, referenceVideosMultiple video references for models that support them, including Seedance 2.0.
input_video, video_url, videoUrlSource video for xAI video editing, Kling motion-control, or a single Seedance 2.0 video reference.
input_audio, audio_url, audioUrlExternal audio track when supported.
poll_timeout_ms, poll_interval_msLonger 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:

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

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

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

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

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

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

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

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

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

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

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

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

text
tokens = duration_sec x 60,000 x resolution x audio x quality x video_input x n x token_multiplier

Common coefficients:

FactorValueMultiplier
resolution480p0.7
resolution720p or 1K1.0
resolution1080p or 2K1.8
resolution4K2.5
audiooff1.0
audioon1.3
qualitydraft0.3
qualitystd or optimized1.0
qualitypro or lossless1.5
video inputabsent1.0
video inputpresent1.7

Quota is checked before generation starts. If quota is insufficient, the request returns 429.

API documentation for rout.my.