Skip to main content
The Queue API is the primary way to process videos with the Python SDK. Submit jobs that are processed asynchronously in the background, then poll for status and retrieve results when complete.
All video processing (video editing, restyling, motion control) uses the Queue API. For image editing, use the Process API.

Overview

The Queue API provides four main methods:
  • submit() - Submit a job and get a job ID immediately
  • status() - Check the status of a submitted job
  • result() - Retrieve the completed video
  • submit_and_poll() - Submit and automatically poll until completion

Submit a Job

Submit a video editing job and receive a job ID immediately:
Returns:
  • job_id - Unique identifier for the job
  • status - Initial status ("pending")

Check Job Status

Poll the status of a submitted job:
Status Values:

Get Job Result

Retrieve the video once the job is completed:
Returns:
  • status - Either "completed" or "failed"
  • data - Video bytes (when completed)
  • error - Error message (when failed)

Submit and Poll

The easiest way to use the Queue API - submit a job and automatically poll until completion:
Parameters:
  • All standard model parameters (prompt, resolution, etc.)
  • on_status_change (optional) - Callback function called on each status change

Complete Example

Output:

Video Editing with Queue

Transform videos with style transfer:

Manual Polling

For custom polling logic, you can manually poll for status:

Error Handling


Supported Models

All non-realtime video models support queue processing:

API Reference

client.queue.submit(options)

Submit a job for processing. Parameters:
  • options: dict - Model and input parameters
Returns: JobSubmitResponse
  • job_id: str - Unique job identifier
  • status: str - Initial status (“pending”)

client.queue.status(job_id)

Check the status of a job. Parameters:
  • job_id: str - The job identifier
Returns: JobStatusResponse
  • job_id: str - Job identifier
  • status: str - Current status

client.queue.result(job_id)

Get the result of a completed job. Parameters:
  • job_id: str - The job identifier
Returns: QueueJobResult
  • status: str - “completed” or “failed”
  • data: bytes - Video data (when completed)
  • error: str - Error message (when failed)

client.queue.submit_and_poll(options)

Submit a job and poll until completion. Parameters:
  • options: dict - Model and input parameters
    • on_status_change: Callable (optional) - Status change callback
Returns: QueueJobResult

Next Steps

Process API

Synchronous image editing

Realtime API

Transform video streams in realtime with WebRTC