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.
durationnumberNoRequested duration in seconds. Maximum is clamped server-side.
resolutionstringNoValues such as 480p, 720p, 1080p, 4K, or WIDTHxHEIGHT.
aspect_ratiostringNoValues such as 16:9, 9:16, 1:1, 4:3, 3:4.
nintegerNoNumber of output videos. Defaults to 1.
audiobooleanNoExplicit audio on/off.
qualitystringNoValues such as draft, std, or pro.
negative_promptstringNoContent to avoid.
seedintegerNoDeterministic generation seed when supported.
provider_optionsobjectNoProvider-specific options passed through.
userstringNoClient-side user identifier.

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 materialized to temporary public URLs when an upstream provider requires URL input.

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.

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

Before calling the provider, rout.my estimates a worst-case cost from missing parameters. If quota is insufficient, the request returns 429 before generation starts.

API documentation for rout.my.