Prerequisites
- A Decart API key
- Node.js 18+
Installation
Install both the Decart adapter and TanStack AI:Setup
Set your Decart API key as an environment variable:Image generation
Generate images withgenerateImage() and the decartImage() adapter:
With explicit API key
UsecreateDecartImage() to pass your API key directly:
Video generation
Video generation uses an async job and polling pattern — you submit a job, then poll for the result.Unlike
generateImage(), video generation is asynchronous. You submit a generation job with generateVideo(), then poll its status with getVideoJobStatus() until it completes.Models
Options
number
Seed value for reproducible results.
"720p" | "480p"
Output resolution. Defaults to
720p.Next steps
Models overview
Explore all available Decart models.
JavaScript SDK
Use Decart’s native SDK for full API access.
GitHub
View source code and contribute.