ImageGenTool interface

A tool that generates images using the GPT image models.

Extends

Properties

action

Whether to generate a new image or edit an existing image. Default: auto.

background

Background type for the generated image. One of transparent, opaque, or auto. Default: auto.

description

Deprecated. This property is deprecated and will be removed in a future version.

input_fidelity

The fidelity level for input image processing.

input_image_mask

Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional).

model

The model to use for image generation.

moderation

Moderation level for the generated image. Default: auto.

name

Deprecated. This property is deprecated and will be removed in a future version.

output_compression

Compression level for the output image. Default: 100.

output_format

The output format of the generated image. One of png, webp, or jpeg. Default: png.

partial_images

Number of partial images to generate in streaming mode, from 0 (default value) to 3.

quality

The quality of the generated image. One of low, medium, high, or auto. Default: auto.

size

The size of the generated images. For gpt-image-2 and gpt-image-2-2026-04-21, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing. For dall-e-2, use one of 256x256, 512x512, or 1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or 1024x1792.

tool_configs

Deprecated. This property is deprecated and will be removed in a future version.

type

The type of the image generation tool. Always image_generation.

Property Details

action

Whether to generate a new image or edit an existing image. Default: auto.

action?: ImageGenAction

Property Value

background

Background type for the generated image. One of transparent, opaque, or auto. Default: auto.

background?: "auto" | "transparent" | "opaque"

Property Value

"auto" | "transparent" | "opaque"

description

Deprecated. This property is deprecated and will be removed in a future version.

description?: string

Property Value

string

input_fidelity

The fidelity level for input image processing.

input_fidelity?: InputFidelity

Property Value

input_image_mask

Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional).

input_image_mask?: ImageGenToolInputImageMask

Property Value

model

The model to use for image generation.

model?: "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-1.5"

Property Value

"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-1.5"

moderation

Moderation level for the generated image. Default: auto.

moderation?: "auto" | "low"

Property Value

"auto" | "low"

name

Deprecated. This property is deprecated and will be removed in a future version.

name?: string

Property Value

string

output_compression

Compression level for the output image. Default: 100.

output_compression?: number

Property Value

number

output_format

The output format of the generated image. One of png, webp, or jpeg. Default: png.

output_format?: "png" | "webp" | "jpeg"

Property Value

"png" | "webp" | "jpeg"

partial_images

Number of partial images to generate in streaming mode, from 0 (default value) to 3.

partial_images?: number

Property Value

number

quality

The quality of the generated image. One of low, medium, high, or auto. Default: auto.

quality?: "auto" | "low" | "medium" | "high"

Property Value

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

size

The size of the generated images. For gpt-image-2 and gpt-image-2-2026-04-21, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing. For dall-e-2, use one of 256x256, 512x512, or 1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or 1024x1792.

size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024"

Property Value

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

tool_configs

Deprecated. This property is deprecated and will be removed in a future version.

tool_configs?: Record<string, ToolConfig>

Property Value

Record<string, ToolConfig>

type

The type of the image generation tool. Always image_generation.

type: "image_generation"

Property Value

"image_generation"