APIFree
APIFree
Video Generation

POST /v1/videos

Create an asynchronous video generation task.

Create a new asynchronous video generation task.

Description

This endpoint starts a video generation job and returns a task object immediately. The task runs asynchronously, so you should poll the status endpoint until the task completes.

This endpoint is also available through the compatibility route POST /v1/openai/videos with identical behavior.

Content types

  • application/json
  • multipart/form-data

Use multipart/form-data when uploading an input_reference image for image-guided video generation.

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the format Bearer YOUR_API_KEY.
Content-TypestringYesapplication/json or multipart/form-data.

Request body parameters

NameTypeRequiredDescription
modelstringYesVideo model ID to use.
promptstringYesText prompt describing the target video.
sizestringNoOutput size such as 1280x720 or 720x1280.
secondsstring / integerNoTarget video duration in seconds.
input_referencefileNoReference image file used as input for image-guided generation.
streambooleanNoOptional flag if supported by the selected model or upstream.

Example request

curl https://api.apifree.ai/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "video-model-id",
    "prompt": "A cinematic drone shot over a misty lake at sunrise",
    "size": "1280x720",
    "seconds": 8
  }'
curl https://api.apifree.ai/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=video-model-id" \
  -F "prompt=A cinematic drone shot over a misty lake at sunrise" \
  -F "size=1280x720" \
  -F "seconds=8" \
  -F "input_reference=@/path/to/reference.png"

Response schema

A successful response returns a task object. Typical fields include:

FieldTypeDescription
idstringVideo task ID.
objectstringObject type, typically video.
created_atintegerUnix timestamp for task creation time.
statusstringInitial task status such as queued or in_progress.
modelstringModel used for generation.
progressintegerTask progress percentage when available.
secondsstring / integerRequested duration.
sizestringRequested output size.

Example response:

{
  "id": "video_abc123",
  "object": "video",
  "created_at": 1758941485,
  "status": "queued",
  "model": "video-model-id",
  "progress": 0,
  "seconds": "8",
  "size": "1280x720"
}

Next step

After creating a task, call GET /v1/videos/{task_id} to monitor progress.

Errors

Typical error cases include:

  • Missing or invalid model
  • Missing prompt
  • Invalid JSON or multipart payload
  • Authentication failure
  • Upstream task creation failure