Skip to content

Video

Video generation usually takes time. Create a task, save the returned task ID, and use that ID to check the result.

POST /v1/video/generations
Authorization: Bearer OMROUTER_API_KEY
Content-Type: application/json
Terminal window
curl --silent --show-error \
'https://omrouter.com/v1/video/generations' \
--header "Authorization: Bearer $OMROUTER_API_KEY" \
--header 'Content-Type: application/json' \
--data "{
\"model\": \"$OMROUTER_MODEL_ID\",
\"prompt\": \"A short establishing shot of a city at sunrise\"
}"

A successful submission returns a task identifier and initial status:

{
"task_id": "task-id",
"status": "submitted"
}

Optional fields such as image input, duration, dimensions, frame rate, and seed depend on the model. Follow the selected video model’s documentation.

GET /v1/video/generations/{task_id}
Authorization: Bearer OMROUTER_API_KEY
Terminal window
curl --silent --show-error \
"https://omrouter.com/v1/video/generations/$TASK_ID" \
--header "Authorization: Bearer $OMROUTER_API_KEY"

Terminal responses can contain a result URL or an error:

{
"task_id": "task-id",
"status": "succeeded",
"url": "https://...",
"format": "mp4"
}
  • Check every few seconds instead of sending requests continuously.
  • Set a maximum wait time.
  • Stop checking after a failed result and show the error.
  • Do not automatically create another task; that can create a duplicate charge.
  • Result URLs can expire, so save the result promptly.

Omrouter also provides OpenAI-style /v1/videos routes. If a client uses that endpoint, follow the client’s task parameter format.