Skip to content

Function: imageGenerationTool()

@providerprotocol/ai


@providerprotocol/ai / openai / imageGenerationTool

imageGenerationTool(options?): OpenAIImageGenerationTool

Defined in: src/providers/openai/types.ts:1476

Creates an image generation tool configuration for the Responses API.

The image generation tool allows the model to generate images based on prompts.

Optional image generation settings

"auto" | "transparent" | "opaque"

string

"jpeg" | "png" | "webp"

number

"auto" | "low" | "medium" | "high"

"auto" | "1024x1024" | "1024x1536" | "1536x1024"

OpenAIImageGenerationTool

An image generation tool configuration object

// Default configuration
const imageGen = imageGenerationTool();
// With custom settings
const customImageGen = imageGenerationTool({
quality: 'high',
size: '1024x1024',
background: 'transparent'
});