Interface GenerateImageOptions

Options for a generateImage call.

interface GenerateImageOptions {
    provider?: string;
    model?: string;
    prompt: string;
    modalities?: ImageModality[];
    n?: number;
    size?: string;
    aspectRatio?: string;
    quality?: string;
    background?: ImageBackground;
    outputFormat?: ImageOutputFormat;
    outputCompression?: number;
    responseFormat?: ImageResponseFormat;
    apiKey?: string;
    baseUrl?: string;
    userId?: string;
    seed?: number;
    negativePrompt?: string;
    providerOptions?: Record<string, unknown> | ImageProviderOptionBag;
    providerPreferences?: MediaProviderPreference;
    policyTier?: "safe" | "standard" | "mature" | "private-adult";
    usageLedger?: AgentOSUsageLedgerOptions;
}

Properties

provider?: string

Provider name. When supplied without model, the default image model for the provider is resolved automatically from the built-in defaults registry.

Example

`"openai"`, `"stability"`, `"replicate"`
model?: string

Model in provider:model format (legacy) or plain model name when provider is set.

Example

`"openai:dall-e-3"`, `"stability:stable-diffusion-xl-1024-v1-0"`

Either `provider` or `model` (or an API key env var for auto-detection) is required.
prompt: string

Text description of the desired image.

modalities?: ImageModality[]

Output modalities requested from the provider (provider-dependent).

n?: number

Number of images to generate. Defaults to 1 for most providers.

size?: string

Pixel dimensions string, e.g. "1024x1024". Provider-dependent.

aspectRatio?: string

Aspect ratio string, e.g. "16:9". Used by some providers instead of size.

quality?: string

Quality hint forwarded to the provider (e.g. "hd" for DALL-E 3).

background?: ImageBackground

Background style for transparent-capable providers.

outputFormat?: ImageOutputFormat

Desired output file format (e.g. "png", "jpeg", "webp").

outputCompression?: number

Compression level (0–100) for lossy output formats.

responseFormat?: ImageResponseFormat

Whether the provider should return a URL or base64-encoded data.

apiKey?: string

Override the provider API key instead of reading from environment variables.

baseUrl?: string

Override the provider base URL.

userId?: string

Optional user identifier forwarded to the provider for moderation tracking.

seed?: number

Random seed for reproducible generation (provider-dependent support).

negativePrompt?: string

Negative prompt describing content to avoid (provider-dependent support).

providerOptions?: Record<string, unknown> | ImageProviderOptionBag

Arbitrary provider-specific options not covered by the standard fields.

providerPreferences?: MediaProviderPreference

Provider preferences for reordering or filtering the fallback chain. When supplied, the available image providers are reordered according to preferred and filtered by blocked before building the chain.

policyTier?: "safe" | "standard" | "mature" | "private-adult"

Content policy tier. When mature or private-adult, the image provider chain is reordered to prefer uncensored providers (Replicate, Fal) over censored ones (DALL-E, Stability safe mode).

Optional durable usage ledger configuration for helper-level accounting.