Skip to main content
The Decart provider supports model-specific options that can be passed via 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 the providerOptions 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).
The trajectory array controls camera or subject movement over time. Each point in the array represents a keyframe:
  • frame: The frame number (0-based)
  • x: Horizontal position (0.0 = left, 1.0 = right)
  • y: Vertical position (0.0 = top, 1.0 = bottom)
Example - Diagonal Movement:
Example - Circular Motion:
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.
Example:
The orientation option takes precedence over aspectRatio. If both are provided, orientation will be used.
Orientation vs. Aspect Ratio:

pollIntervalMs

number
default:"1500"
The interval in milliseconds between status polling requests when checking video generation job status.
Video generation is asynchronous. After submitting a job, the SDK polls the API to check when the video is ready. This option controls how frequently those checks occur. Example - Faster Polling:
Example - Slower Polling:
Setting pollIntervalMs too low may result in unnecessary API calls and increased costs. The default of 1500ms is recommended for most use cases.

pollTimeoutMs

number
default:"300000"
The maximum time in milliseconds to wait for video generation to complete. Default is 300,000ms (5 minutes).
If the video generation job doesn’t complete within this time, the SDK will throw a timeout error. Example - Extended Timeout:
Example - Short Timeout:
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:
  1. Submit Job: The SDK sends a POST request to /v1/jobs/{modelId} with your parameters
  2. Receive Job ID: The API returns a job ID immediately
  3. Poll Status: The SDK repeatedly checks /v1/jobs/{jobId} until the status is completed or failed
  4. Download Video: Once complete, the SDK downloads the video from /v1/jobs/{jobId}/content
The polling options control steps 3 and 4:

Model Support

Different options are supported by different models:
  • 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