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.
Function Signature
function createDecart ( options ?: DecartProviderSettings ) : DecartProvider
Creates and configures a Decart provider instance with custom settings. Use this when you need to configure API keys, base URLs, or other provider-level settings.
Parameters
options
DecartProviderSettings
default: "{}"
Optional configuration object for the provider Show DecartProviderSettings properties
API key for authentication. If not provided, will load from DECART_API_KEY environment variable.
Base URL for API requests. Defaults to https://api.decart.ai.
Custom headers to include with every request.
Custom fetch implementation for making HTTP requests.
Returns
A configured provider instance with methods to create image and video models. See DecartProvider for full interface details.
Examples
Default Configuration
import { createDecart } from '@decartai/ai-sdk-provider' ;
const decart = createDecart ();
// Uses DECART_API_KEY from environment
Custom API Key
import { createDecart } from '@decartai/ai-sdk-provider' ;
const decart = createDecart ({
apiKey: 'your-api-key-here'
});
Custom Base URL
import { createDecart } from '@decartai/ai-sdk-provider' ;
const decart = createDecart ({
baseURL: 'https://custom-api.example.com' ,
apiKey: 'your-api-key-here'
});
import { createDecart } from '@decartai/ai-sdk-provider' ;
const decart = createDecart ({
headers: {
'X-Custom-Header' : 'value'
}
});
Default Instance
A default pre-configured instance is also exported:
import { decart } from '@decartai/ai-sdk-provider' ;
// Equivalent to createDecart()
const model = decart . image ( 'lucy-pro-t2i' );
VERSION Export
The package version is also exported for runtime version checking:
import { VERSION } from '@decartai/ai-sdk-provider' ;
console . log ( `Using Decart provider version: ${ VERSION } ` );
The current version of the @decartai/ai-sdk-provider package.