An interface for the Dall-E API Wrapper.

interface DallEAPIWrapperParams {
    apiKey?: string;
    baseUrl?: string;
    callbacks?: Callbacks;
    dallEResponseFormat?: "url" | "b64_json";
    metadata?: Record<string, unknown>;
    model?: string;
    modelName?: string;
    n?: number;
    openAIApiKey?: string;
    organization?: string;
    quality?: "standard" | "hd";
    responseFormat?: any;
    size?:
        | "256x256"
        | "512x512"
        | "1024x1024"
        | "1792x1024"
        | "1024x1792";
    style?: "natural" | "vivid";
    tags?: string[];
    user?: string;
    verbose?: boolean;
    verboseParsingErrors?: boolean;
}

Hierarchy (view full)

Properties

apiKey?: string

The OpenAI API key

baseUrl?: string

The base URL of the OpenAI API.

callbacks?: Callbacks
dallEResponseFormat?: "url" | "b64_json"

The format in which the generated images are returned. Must be one of "url" or "b64_json".

"url"
metadata?: Record<string, unknown>
model?: string

The model to use.

"dall-e-2" | "dall-e-3"

"dall-e-3"
modelName?: string

The model to use. Alias for model

"dall-e-2" | "dall-e-3"

"dall-e-3"
n?: number

The number of images to generate. Must be between 1 and 10. For dall-e-3, only n: 1 is supported.

1
openAIApiKey?: string

The OpenAI API key Alias for apiKey

organization?: string

The organization to use

quality?: "standard" | "hd"

The quality of the image that will be generated. ‘hd’ creates images with finer details and greater consistency across the image.

"standard"
responseFormat?: any

Use dallEResponseFormat instead for the Dall-E response type.

size?:
    | "256x256"
    | "512x512"
    | "1024x1024"
    | "1792x1024"
    | "1024x1792"

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for DALL·E-2 models. Must be one of 1024x1024, 1792x1024, or 1024x1792 for DALL·E-3 models.

"1024x1024"
style?: "natural" | "vivid"

The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.

"vivid"
tags?: string[]
user?: string

A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.

verbose?: boolean
verboseParsingErrors?: boolean

Whether to show full details in the thrown parsing errors.

false