Skip to content

Video Generation

Generate videos with any model available on ImageRouter.

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"
}'
  • prompt* Text prompt for generating the video.
  • model* Video model to use.
  • size - Accepted values are different for each model.
    • auto [default] - Uses the default recommended size for each model.
    • WIDTHxHEIGHT (eg 1024x576)
  • seconds - 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
    • url [default] - Returns the video URL hosted on ImageRouter’s servers. The video is accessible 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.

Generate a video from one or more input images using any video model that supports Image-to-Video generation on ImageRouter.

Image-to-Video is in Beta, this API can change later.

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 'image[]=@your_image1.webp'