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.
Interface
interface DecartProvider extends ProviderV2 {
image(modelId: DecartImageModelId): ImageModelV2;
imageModel(modelId: DecartImageModelId): ImageModelV2;
video(modelId: DecartVideoModelId): Experimental_VideoModelV3;
videoModel(modelId: DecartVideoModelId): Experimental_VideoModelV3;
}
The DecartProvider interface extends the AI SDK’s ProviderV2 and provides methods to instantiate image and video generation models.
Methods
image()
image(modelId: DecartImageModelId): ImageModelV2
Creates an image generation model instance.
modelId
DecartImageModelId
required
The identifier of the image model to use.See Image Models for available model IDs.
An image model instance compatible with AI SDK’s generateImage() function.
imageModel()
imageModel(modelId: DecartImageModelId): ImageModelV2
Alias for image(). Creates an image generation model instance.
modelId
DecartImageModelId
required
The identifier of the image model to use.
An image model instance compatible with AI SDK’s generateImage() function.
video()
video(modelId: DecartVideoModelId): Experimental_VideoModelV3
Creates a video generation model instance.
modelId
DecartVideoModelId
required
The identifier of the video model to use.See Video Models for available model IDs.
return
Experimental_VideoModelV3
A video model instance compatible with AI SDK’s experimental_generateVideo() function.
videoModel()
videoModel(modelId: DecartVideoModelId): Experimental_VideoModelV3
Alias for video(). Creates a video generation model instance.
modelId
DecartVideoModelId
required
The identifier of the video model to use.
return
Experimental_VideoModelV3
A video model instance compatible with AI SDK’s experimental_generateVideo() function.
Examples
Creating an Image Model
import { createDecart } from '@decartai/ai-sdk-provider';
import { generateImage } from 'ai';
const decart = createDecart();
const { image } = await generateImage({
model: decart.image('lucy-pro-t2i'),
prompt: 'A serene mountain landscape'
});
Creating a Video Model
import { createDecart } from '@decartai/ai-sdk-provider';
import { experimental_generateVideo } from 'ai';
const decart = createDecart();
const { video } = await experimental_generateVideo({
model: decart.video('lucy-pro-t2v'),
prompt: 'Waves crashing on a beach at sunset'
});
Using Both Methods
import { createDecart } from '@decartai/ai-sdk-provider';
const decart = createDecart();
// These are equivalent
const imageModel1 = decart.image('lucy-pro-t2i');
const imageModel2 = decart.imageModel('lucy-pro-t2i');
// These are equivalent
const videoModel1 = decart.video('lucy-pro-t2v');
const videoModel2 = decart.videoModel('lucy-pro-t2v');
Unsupported Methods
The Decart provider does not support language or text embedding models. Calling these methods will throw a NoSuchModelError:
languageModel(modelId: string) - Not supported
textEmbeddingModel(modelId: string) - Not supported