Video Generation
Video generation is an experimental feature. The API may change in future
versions.
experimental_generateVideo
function to generate videos based on a given prompt using a video model.
base64 or uint8Array properties:
Settings
Aspect Ratio
The aspect ratio is specified as a string in the format{width}:{height}.
Models only support a few aspect ratios, and the supported aspect ratios are different for each model and provider.
Resolution
The resolution is specified as a string in the format{width}x{height}.
Models only support specific resolutions, and the supported resolutions are different for each model and provider.
Duration
Some video models support specifying the duration of the generated video in seconds.Frames Per Second (FPS)
Some video models allow you to specify the frames per second for the generated video.Generating Multiple Videos
experimental_generateVideo supports generating multiple videos at once:
experimental_generateVideo will automatically call the model as often as
needed (in parallel) to generate the requested number of videos.Provider Options
Video model settings can be configured usingproviderOptions for provider-specific parameters:
Response Information
Theexperimental_generateVideo function returns comprehensive response information:
Retries
Theexperimental_generateVideo function accepts an optional maxRetries parameter
that you can use to set the maximum number of retries.
It defaults to 2 retries (3 attempts in total). You can set it to 0 to disable retries.
Abort Signals and Timeouts
Theexperimental_generateVideo function accepts an optional abortSignal parameter of
type AbortSignal
that you can use to abort the generation process or set a timeout.
Custom Headers
Theexperimental_generateVideo function accepts an optional headers parameter
that you can use to add custom headers to the request.