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
| Input | Meaning |
|---|---|
prompt | What should happen |
duration_seconds | Length of the clip |
resolution, or width and height | Frame size, as the model accepts it |
first_frame | An image to start from, as an https URL |
last_frame | An image to end on |
generate_audio | Whether to add a soundtrack, where the model can |
seed | Repeat 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.