Skip to main content

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

Returns

DecartProvider
DecartProvider
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'
});

Custom Headers

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}`);
VERSION
string
The current version of the @decartai/ai-sdk-provider package.