Interface GenerateVideoOptions

Options for a generateVideo call.

At minimum, a prompt is required. The provider is resolved from opts.provider, opts.apiKey, or the first video-capable env var found (RUNWAY_API_KEY -> REPLICATE_API_TOKEN -> FAL_API_KEY).

interface GenerateVideoOptions {
    prompt: string;
    image?: Buffer<ArrayBufferLike>;
    provider?: string;
    model?: string;
    durationSec?: number;
    aspectRatio?: VideoAspectRatio;
    resolution?: string;
    negativePrompt?: string;
    seed?: number;
    timeoutMs?: number;
    onProgress?: ((event) => void);
    apiKey?: string;
    baseUrl?: string;
    providerPreferences?: MediaProviderPreference;
    usageLedger?: AgentOSUsageLedgerOptions;
}

Properties

prompt: string

Text prompt describing the desired video content.

image?: Buffer<ArrayBufferLike>

Source image for image-to-video generation. When provided, the request is dispatched to imageToVideo() instead of generateVideo(). Accepts a raw Buffer.

provider?: string

Explicit provider identifier (e.g. "runway", "replicate", "fal"). When omitted, auto-detection from environment variables is used.

model?: string

Model identifier within the provider (e.g. "gen3a_turbo", "klingai/kling-v1"). When omitted, the provider's default model is used.

durationSec?: number

Desired output duration in seconds.

aspectRatio?: VideoAspectRatio

Desired aspect ratio (e.g. "16:9", "9:16").

resolution?: string

Desired output resolution (e.g. "1280x720", "720p").

negativePrompt?: string

Negative prompt describing content to avoid.

seed?: number

Random seed for reproducible generation (provider-dependent).

timeoutMs?: number

Maximum time in milliseconds to wait for generation to complete. Provider-dependent — not all providers honour client-side timeouts.

onProgress?: ((event) => void)

Optional progress callback invoked during long-running generation. Called with a VideoProgressEvent at each status transition.

Type declaration

apiKey?: string

Override the provider API key instead of reading from env vars.

baseUrl?: string

Override the provider base URL.

providerPreferences?: MediaProviderPreference

Provider preferences for reordering or filtering the fallback chain. When supplied, the available video providers are reordered according to preferred and filtered by blocked before building the chain.

Optional durable usage ledger configuration for accounting.