Skip to content

Video Generation

Generate videos with any model available on ImageRouter.

Supports both Text-to-Video and Image-to-Video generation. Requests are encoded as multipart/form-data.

Terminal window
curl 'https://api.imagerouter.io/v1/openai/videos/generations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'prompt=YOUR_PROMPT' \
-F 'model=ir/test-video' \
-F 'size=auto' \
-F 'seconds=auto' \
-F 'response_format=url' \
-F 'image[]=@your_image1.webp'
  • model required Video model to use for generation.

  • prompt optional Text input for generating videos. Many models require prompt, but not all.

  • size optional Accepted values are different for each model. Some models and providers completely ignore size.

    • auto [default] - Uses the default recommended size for each model.
    • WIDTHxHEIGHT (eg 1024x576)
  • seconds optional Duration of the video in seconds. Accepted values vary by model.

    • auto [default] - Uses a default duration for each model.
    • Numeric value (eg 5, 10) - Specific duration in seconds (check model details page for supported values).
  • response_format optional

    • url [default] - Returns the video URL hosted on ImageRouter’s servers. The video is saved in your logs. and is publicly accessible with the URL if you share it.
    • b64_json - Returns the video as base64-encoded JSON data. The video is saved in your logs. and is publicly accessible with the URL if you share it.
    • b64_ephemeral - Same as b64_json but the video is not saved in our system. The provider may still have it.
  • image[] optional Input file for Image-to-Video generation. (Supported models have “image-to-video” label here.)

The OpenAI compatible response makes sure you can use ImageRouter anywhere GPT-Image is already implemented.

{
"created": 1769286389027, // timestamp
"data":[
{
"url": "https://storage.imagerouter.io/fffb4426-efbd-4bcc-87d5-47e6936bf0bb.mp4"
// or "b64_json": "...", if you select a different response_format
}
],
"latency": 6942,
"cost": 0.004
}

This endpoint exists for compatibility reasons (so ImageRouter can be used with the OpenAI SDK). File uploads are not possible with application/json encoding, so Image-to-Video generation is not supported for this endpoint.

DetailUnified endpointJSON endpoint
Text-to-Video
Image-to-Video
Request encodingmultipart/form-dataapplication/json
Compatible withGPT Image (edit)GPT Image
Terminal window
curl 'https://api.imagerouter.io/v1/openai/videos/generations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--json '{
"prompt": "YOUR_PROMPT",
"model": "ir/test-video",
"size": "auto",
"seconds": "auto",
"response_format": "url"
}'

Same as the parameters for the Unified Form-Data endpoint, except image parameters are not supported.

Same as the response for Unified Form-Data endpoint.