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/generationsRequest
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
| 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. |
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 | string | No | Values such as 16:9, 9:16, 1:1, 4:3, 3:4. |
n | integer | No | Number of output videos. Defaults to 1. |
audio | boolean | No | Explicit audio on/off. |
quality | string | No | Values such as draft, std, or pro. |
negative_prompt | string | No | Content to avoid. |
seed | integer | No | Deterministic generation seed when supported. |
provider_options | object | No | Provider-specific options passed through. |
user | string | No | Client-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_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 |
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.