Quickstart Guide
Get up and running quickly with the Decart AI SDK Provider. This guide will walk you through generating your first image and video.Prerequisites
Make sure you’ve completed the Installation steps:- Installed
@decartai/ai-sdk-providerandaipackages - Set up your
DECART_API_KEYenvironment variable - Using Node.js 18 or higher
Generate Your First Image
Let’s create a simple image from a text prompt:1
Import the required functions
2
Generate an image
3
Save the image
Complete Example
image-generation.ts
The
image.uint8Array property contains the raw image data in PNG format.Generate Your First Video
Now let’s create a video from a text prompt:1
Import the required functions
2
Generate a video
3
Save the video
Complete Example
video-generation.ts
The
experimental_generateVideo function is part of the AI SDK’s experimental API for video generation.Customizing Generation
Control Aspect Ratio
Both image and video generation support aspect ratio customization:Reproducible Results with Seeds
Use a seed value to get consistent outputs:Video Resolution
Control video quality with the resolution parameter:1280x720(720p, default)854x480(480p)
Next Steps
Now that you’ve generated your first image and video, explore more advanced features:Image Generation
Deep dive into text-to-image generation with lucy-pro-t2i
Video Generation
Learn about text-to-video and image-to-video generation
Motion Control
Control camera movement with trajectory-based generation
API Reference
Explore all available models and settings