Share via


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.

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.

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 image. One of 1024x1024, 1024x1536, 1536x1024, or auto. Default: auto.

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"

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"

Property Value

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

moderation

Moderation level for the generated image. Default: auto.

moderation?: "low" | "auto"

Property Value

"low" | "auto"

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?: "low" | "medium" | "high" | "auto"

Property Value

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

size

The size of the generated image. One of 1024x1024, 1024x1536, 1536x1024, or auto. Default: auto.

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

Property Value

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

type

The type of the image generation tool. Always image_generation.

type: "image_generation"

Property Value

"image_generation"