OP Inference

Video

Generate video from text or from images.

POST /v1/videos submits a video job. It answers 202 with a job; see How media jobs work for polling and output. Video jobs take longer than images, so a webhook is often easier than polling.

curl https://api.opinference.com/v1/videos \
  -H "Authorization: Bearer $OP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "pruna-ai/p-video-2",
    "prompt": "A paper boat drifting down a rain-soaked street, slow motion.",
    "duration_seconds": 5
  }'

Inputs

InputMeaning
promptWhat should happen
duration_secondsLength of the clip
resolution, or width and heightFrame size, as the model accepts it
first_frameAn image to start from, as an https URL
last_frameAn image to end on
generate_audioWhether to add a soundtrack, where the model can
seedRepeat a result

Inputs and ranges differ a lot between video models, and some combinations exclude each other (a model may refuse width alongside first_frame). The model's page at opinference.com/models lists what it accepts.

Output

An output[] entry per clip, usually video/mp4. Video is priced per request or per second of output, depending on the model; the price is on the model's page.

On this page