Skip to main content
The Queue API is the primary way to process videos with the Android SDK. Submit jobs that are processed asynchronously, then poll for status or observe progress as a Kotlin Flow.
All video processing (video editing, restyling, motion control) uses the Queue API. For realtime camera transformation, use the Realtime API.

Overview

The Queue API provides five methods:

Quick Start

Submit a Job

Submit a video processing job and receive a job ID immediately:
Returns: JobSubmitResponse
  • jobId: String - Unique job identifier
  • status: JobStatus - Initial status (PENDING)

Check Job Status

Poll the status of a submitted job:
Status Values:

Get Job Result

Download the completed video as raw bytes:
Returns: ByteArray - The output video (MP4).

Submit and Poll

The easiest way to use the Queue API. Submit a job and automatically poll until completion:
Parameters:
  • model (required) - Video model from VideoModels
  • input (required) - Typed input (e.g., VideoEditInput, TextToVideoInput)
  • onStatusChange (optional) - Callback invoked on each status change
submitAndPoll does not throw on job failure — it returns QueueJobResult.Failed. It will throw QueueSubmitException, QueueStatusException, or QueueResultException on network/API errors.

Submit and Observe (Flow)

Get a reactive Flow of progress updates, ideal for Jetpack Compose UIs:
Emits:
  1. QueueJobResult.InProgress - On each poll while pending/processing
  2. QueueJobResult.Completed - Terminal: contains the video bytes
  3. QueueJobResult.Failed - Terminal: contains the error message
submitAndObserve() returns a cold Flow that runs on Dispatchers.IO. Collect it in viewModelScope or lifecycleScope for automatic cancellation.

Input Types

Each model category has a typed input class that enforces required fields at compile time.

VideoEditInput

For video-to-video editing models: LUCY_2_1, LUCY_CLIP.
String
required
Text prompt describing the desired edit. Max 1000 characters. Can be empty string.
FileInput
required
Video file to transform.
FileInput
Optional reference image for style guidance.
Int
Seed for reproducible output (0–4294967295).
String
default:"720p"
Output resolution.
Boolean
default:"true"
Whether to AI-enhance the prompt.

VideoRestyleInput

For video restyling: LUCY_RESTYLE_2. Must provide exactly one of prompt or referenceImage (mutually exclusive).
prompt and referenceImage are mutually exclusive. Providing both throws an IllegalArgumentException. When using referenceImage, enhancePrompt must not be true.

FileInput

FileInput is a sealed class that wraps common Android file sources. All queue input types use it for file fields.
fromUri() and fromFile() stream directly from disk into the HTTP body without buffering in memory, avoiding OOM errors on large video files.

Error Handling

Queue methods throw typed exceptions on network/API errors:
Exception hierarchy: All queue exceptions include an optional statusCode: Int? for HTTP errors.

Manual Polling

For custom polling logic, combine submit(), status(), and result():

Supported Models


API Reference

client.queue.submit(model, input)

Submit a job for processing. Suspend function. Parameters:
  • model: VideoModel - Video model from VideoModels
  • input: QueueJobInput - Typed input (e.g., VideoEditInput)
Returns: JobSubmitResponse
  • jobId: String - Unique job identifier
  • status: JobStatus - Initial status (PENDING)
Throws: InvalidInputException, QueueSubmitException

client.queue.status(jobId)

Check the status of a job. Suspend function. Parameters:
  • jobId: String - Job ID from submit()
Returns: JobStatusResponse
  • jobId: String - Job identifier
  • status: JobStatus - Current status
Throws: QueueStatusException

client.queue.result(jobId)

Download the result of a completed job. Suspend function. Parameters:
  • jobId: String - Job ID from submit()
Returns: ByteArray - Output video bytes (MP4) Throws: QueueResultException

client.queue.submitAndPoll(model, input, onStatusChange?)

Submit a job and auto-poll until completion. Suspend function. Parameters:
  • model: VideoModel - Video model
  • input: QueueJobInput - Typed input
  • onStatusChange: ((JobStatusResponse) -> Unit)? - Optional status callback
Returns: QueueJobResult.Completed or QueueJobResult.Failed Throws: QueueSubmitException, QueueStatusException, QueueResultException on network errors

client.queue.submitAndObserve(model, input)

Submit a job and return a Flow of progress updates. Parameters:
  • model: VideoModel - Video model
  • input: QueueJobInput - Typed input
Returns: Flow<QueueJobResult> - Emits InProgress, then Completed or Failed

client.queue.release()

Release HTTP resources held by the queue client.

Next Steps

Realtime API

Transform camera video streams in realtime with WebRTC

SDK Overview

Installation, setup, and Android SDK fundamentals