Create a video job (asynchronous)
Asynchronous. This endpoint submits a job and returns immediately; it does not block
until the video is rendered. Poll GET /v1/videos/{id} for status, then fetch the result
from GET /v1/videos/{id}/content.
Billing happens when the job completes successfully. Failed jobs are not billed.
Image-to-video. Send input images in the same request. As JSON, each image is an
https:// URL or a base64 data URL (data:image/png;base64,...); as multipart/form-data
(what the OpenAI SDK sends for input_reference), use the same field names as file parts.
first_frame_image(aliasesinput_reference,image): the first framelast_frame_image(aliaslast_frame): the last frame; most models need a first frame with itreference_images(array; aliasreference_image): reference imageskeyframes(array of{ "image": ..., "timestamp_s": 2.5 }): images pinned at a moment inside the clip. Inmultipart/form-data, send the whole array as one JSON text field.reference_videos(array; aliasreference_video): reference video clips, MP4 or MOV, up to 50 MB each.reference_audios(array): either preset voices{ "voice_id": "eve" }, or reference audio files (anhttps://URL, a data URL, or{ "url": ... }), WAV or MP3, up to 15 MB each. Inmultipart/form-data, send voices as one JSON text field and audio files as file parts.
Images are PNG, JPEG or WebP, up to 10 MB each, at most 20 images and 80 MB of images per
request; all inputs together at most 120 MB. Which inputs a model accepts is listed on its
model page: minimax/minimax-hailuo-2.3 takes a first frame only; minimax/minimax-h3 and its
variants (-highspeed, -lite, -max) take a first frame or first + last frame, or references
(images, videos, audio files; see below);
xai/grok-imagine-video-1.5 takes frames, keyframes, reference images and preset voices (see
below). On H3, with input images or videos ratio defaults to adaptive (follows the input).
An input the model does not support is rejected with a 400, never silently ignored.
MiniMax H3 (minimax/minimax-h3) parameters.
| Field | Values | Default |
|---|---|---|
size | 768P or 2K. 720p counts as 768P; 1080p is rejected. A width×height such as 720x1280 is also accepted: it sets the ratio and means 768P. | 768P |
seconds | Any whole number from 4 to 15 | 5 |
ratio | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, or adaptive (follows the input image; needs at least one input image) | 16:9 without images, adaptive with images |
H3 references can be combined with each other, but not with first/last frames:
| Input | Limit |
|---|---|
reference_images | Up to 9. |
reference_videos | Up to 3 clips, each 2–15 seconds, 15 seconds in total. MP4 or MOV. |
reference_audios (audio files) | Up to 3 clips, each 2–15 seconds, 15 seconds in total. WAV or MP3. Preset voices are not supported on H3. |
Across the H3 family a request takes at most 12 input files (images, videos and audio combined).
H3 family. minimax/minimax-h3-highspeed, minimax/minimax-h3-lite and
minimax/minimax-h3-max take the same fields, frames and references as H3, with these
differences:
| Model | size | seconds | Other |
|---|---|---|---|
minimax/minimax-h3-highspeed | 768P only | 4–15 | — |
minimax/minimax-h3-lite | 480P or 768P | 4–15 | With reference inputs, ratio must be an explicit ratio: it can be neither adaptive nor left out. |
minimax/minimax-h3-max | 480P or 768P | 5–15 | Optional prompt_expansion_mode: disabled, balanced (default) or quality; MiniMax's native extra.prompt_expansion_mode is accepted too. Only the first 2 reference images are free, and reference video has its own per-second rate. |
Billing is per output second at the rate for the chosen size; 2K costs more per second
than 768P. On top of that, reference video is billed per input second at the same rate as
the output (each clip rounded up to a whole second), the first 5 reference images are free
and each one after that is billed, and reference audio is free. See the
model page (and each variant's own page) for the current
rates. One video per job (n must be 1).
Not supported on the H3 family through RouteMux: callback_url (poll the job instead). A last
frame needs a first frame. Invalid combinations are rejected with 400
MODEL_PARAMETER_UNSUPPORTED before a job is created (and nothing is billed): seconds
outside the model's range or not a whole number, an unsupported size or ratio, adaptive
without an input image or video, first/last frames combined with references, more than 9
reference images, more than 12 input files, prompt_expansion_mode on a model other than
H3 Max, or reference clips outside the limits above. A GIF image, or a video or
audio file in another format, returns 415 REQUEST_MEDIA_TYPE_UNSUPPORTED.
xAI Grok Imagine Video 1.5 (xai/grok-imagine-video-1.5) parameters. The output video
has sound.
| Field | Values | Default |
|---|---|---|
size (alias resolution) | 480p, 720p or 1080p. A width×height such as 1280x720 is also accepted: it sets the ratio and maps to the tier of its shorter side. | 480p |
seconds (alias duration) | Any whole number from 1 to 15 | 8 |
ratio (alias aspect_ratio) | 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, 5:2. Ignored with a first frame: the video follows the image. | 16:9 |
Inputs on Grok Imagine Video 1.5 can be combined in one request:
| Input | Limit |
|---|---|
| First frame, last frame | One each. The last frame can also be used alone. |
keyframes | Up to 4. timestamp_s must be greater than 0 and less than seconds. Timestamps snap to a 1/3-second grid, so keep keyframes at least 1/3 s apart. |
reference_images | Up to 14. Refer to them in the prompt as <IMAGE_0>, <IMAGE_1>, …; with a first frame, the first frame is <IMAGE_0> and reference images start at <IMAGE_1>. |
reference_audios | Up to 3 preset voices such as eve, ara, rex, sal, leo. Refer to them as <AUDIO_0>, <AUDIO_1>, …. Custom voice audio (url) is not available. An unknown voice fails the job, and nothing is billed. |
With reference images or voices the video is capped at 720p; 1080p is rejected with a 400.
Billing is per output second at the rate for the chosen size, plus a charge for each input
image (first frame, last frame, keyframe or reference image); voices are free. See the
model page for the current rates. One
video per job (n must be 1), and a prompt is required with input images too. Video
edit / extend is not available (xAI offers it only on the older grok-imagine-video).
Invalid values (seconds outside 1–15 or not a whole number, another size or ratio,
too many inputs, a keyframe time outside the clip) are rejected with 400
MODEL_PARAMETER_UNSUPPORTED before a job is created, and nothing is billed. Video
generation on this model also has a per-account daily allowance: past it, requests return
429 LIMIT_VIDEO_DAILY_CAP until 00:00 UTC.
Authorization
bearerAuth Authorization: Bearer <your RouteMux API key>.
Create keys at https://routemux.com/console/keys. New keys use the sk- prefix;
the legacy rmx_live_ prefix is still accepted.
The Anthropic SDK's x-api-key and the Google SDK's x-goog-api-key are accepted too.
Sending several key headers with different values returns 400 AUTH_AMBIGUOUS_API_KEY.
In: header
TypeScript Definitions
Use the request body type in TypeScript.
Request and response bodies match the upstream provider's official format verbatim —
RouteMux passes them through untouched. See the provider's own docs for field definitions;
the gateway itself only reads model and stream.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/videos" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax/minimax-h3", "prompt": "A drone shot over a coastline", "seconds": 6 }'{ "model": "string", "stream": true}