Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DecartAI/ai-sdk-provider/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Get started with the Decart AI SDK Provider by installing the package and configuring your API credentials.Prerequisites
Before you begin, ensure you have:- Node.js 18 or higher installed on your system
- npm, yarn, or pnpm package manager
- A Decart API key (see Getting Your API Key below)
Install the Package
Install the Decart AI SDK Provider using your preferred package manager:The
ai package is a peer dependency that provides the core AI SDK functionality like generateImage() and experimental_generateVideo().Getting Your API Key
To use the Decart AI SDK Provider, you’ll need an API key from Decart:Visit Decart
Go to decart.ai and create an account if you don’t have one
Configure Your API Key
There are two ways to provide your API key to the Decart provider:Environment Variable (Recommended)
Set theDECART_API_KEY environment variable:
.env file:
.env
Programmatic Configuration
Alternatively, pass the API key directly when creating a custom provider instance:Advanced Configuration
For advanced use cases, you can customize the provider with additional options:Configuration Options
-
apiKey
stringYour Decart API key. Defaults to theDECART_API_KEYenvironment variable. -
baseURL
stringCustom API endpoint URL. Defaults tohttps://api.decart.ai. Useful for proxy servers or testing. -
headers
Record<string, string>Additional HTTP headers to include in every request. -
fetch
FetchFunctionCustom fetch implementation. Useful for middleware, request interception, or testing.
Verification
Verify your installation by running a simple test:Next Steps
Quickstart Guide
Learn how to generate your first images and videos with practical examples