Create video
POST https://api.fastapi.ai/v1/videos
Create a new video generation job from a prompt and optional reference assets.
Request body
prompt string Required
Text prompt that describes the video to generate.
input_reference file Optional
Optional image reference that guides generation.
model string Optional Defaults to sora-2
The video generation model to use (allowed values: sora-2, sora-2-pro).
seconds string Optional Defaults to 4
Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.
size string Optional
Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.
Returns
Returns the newly created video job.
Example
Request
bash
curl https://api.fastapi.ai/v1/videos \
-H "Authorization: Bearer $FAST_API_KEY" \
-F "model=sora-2" \
-F "prompt=A calico cat playing a piano on stage"Response
bash
{
"id": "video_123",
"object": "video",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1712697600,
"size": "1024x1792",
"seconds": "8",
"quality": "standard"
}