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 immediatelystatus()- Check the status of a submitted jobresult()- Retrieve the completed videosubmitAndPoll()- Submit and automatically poll until completion
Submit a Job
Submit a video editing job and receive a job ID immediately:job_id- Unique identifier for the jobstatus- Initial status ("pending")
Check Job Status
Poll the status of a submitted job:Get Job Result
Retrieve the video once the job is completed:status- Either"completed"or"failed"data- Video Blob (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:- All standard model parameters (prompt, resolution, etc.)
onStatusChange(optional) - Callback function called on each status change
TypeScript Types
Complete Example
Node.js
Video Editing with Queue
Transform videos with style transfer:Cancellation with AbortSignal
Cancel queue operations using AbortController:Manual Polling
For custom polling logic, you can manually poll for status:Error Handling
Supported Models
All non-realtime video models support queue processing:Latest aliases
Latest aliases
Previous generation models
Previous generation models
API Reference
client.queue.submit(options)
Submit a job for processing.
Parameters:
options: QueueSubmitOptions- Model and input parametersmodel- Model frommodels.video()signal?: AbortSignal- Optional abort signal- Additional model-specific parameters
Promise<JobSubmitResponse>
job_id: string- Unique job identifierstatus: JobStatus- Initial status (“pending”)
client.queue.status(jobId)
Check the status of a job.
Parameters:
jobId: string- The job identifier
Promise<JobStatusResponse>
job_id: string- Job identifierstatus: JobStatus- Current status
client.queue.result(jobId)
Get the result of a completed job.
Parameters:
jobId: string- The job identifier
Promise<QueueJobResult>
- When completed:
{ status: "completed", data: Blob } - When failed:
{ status: "failed", error: string }
client.queue.submitAndPoll(options)
Submit a job and poll until completion.
Parameters:
options: QueueSubmitAndPollOptions- Model and input parametersonStatusChange?: (job: JobStatusResponse) => void- Status change callbacksignal?: AbortSignal- Optional abort signal- Additional model-specific parameters
Promise<QueueJobResult>
Next Steps
Process API
Synchronous image editing
Realtime API
Transform video streams in realtime with WebRTC