Video Generation
Generate videos with any video model available on ImageRouter.
Videos are in Beta, this API can change later.
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"}'const url = 'https://api.imagerouter.io/v1/openai/videos/generations'const payload = { prompt: 'YOUR_PROMPT', model: 'ir/test-video', size: 'auto'}
const response = await fetch(url, { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify(payload)})
const data = await response.json()console.log(data)import requests
url = "https://api.imagerouter.io/v1/openai/videos/generations"payload = { "prompt": "YOUR_PROMPT", "model": "ir/test-video", "size": "auto"}headers = { "Authorization": "Bearer YOUR_API_KEY"}
response = requests.post(url, json=payload, headers=headers)print(response.json())Parameters
Section titled “Parameters”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)
response_formaturl[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.
image[]One or more input images.