providerOptions.decart when generating videos. These options allow you to control video generation behavior beyond the standard AI SDK options.
Overview
Provider options are passed through theproviderOptions parameter in video generation calls:
Available Options
trajectory
Array<{ frame: number; x: number; y: number }>
Defines a motion path for the
lucy-motion model. Each point specifies a frame number and normalized x,y coordinates (0.0 to 1.0).- frame: The frame number (0-based)
- x: Horizontal position (0.0 = left, 1.0 = right)
- y: Vertical position (0.0 = top, 1.0 = bottom)
The
trajectory option is only supported by the lucy-motion model. It will be ignored for other video models.orientation
'landscape' | 'portrait'
Explicitly sets the video orientation. This overrides the orientation derived from the
aspectRatio parameter.The
orientation option takes precedence over aspectRatio. If both are provided, orientation will be used.pollIntervalMs
number
default:"1500"
The interval in milliseconds between status polling requests when checking video generation job status.
pollTimeoutMs
number
default:"300000"
The maximum time in milliseconds to wait for video generation to complete. Default is 300,000ms (5 minutes).
If a timeout occurs, you’ll receive an
AI_APICallError with a message indicating the timeout duration. See Error Handling for more details.Complete Example
Here’s a comprehensive example using all provider options:Polling Behavior
The Decart API uses an asynchronous job-based system for video generation:- Submit Job: The SDK sends a POST request to
/v1/jobs/{modelId}with your parameters - Receive Job ID: The API returns a job ID immediately
- Poll Status: The SDK repeatedly checks
/v1/jobs/{jobId}until the status iscompletedorfailed - Download Video: Once complete, the SDK downloads the video from
/v1/jobs/{jobId}/content
Model Support
Different options are supported by different models:Related Resources
- Configuration - Learn about provider-level configuration
- Error Handling - Learn how to handle polling timeouts and other errors
- Video Models - Learn about available video models and their capabilities