A tool that generates images using a model like gpt-image-1.

interface ImageGeneration {
    background?: "auto" | "transparent" | "opaque";
    input_image_mask?: InputImageMask;
    model?: "gpt-image-1";
    moderation?: "low" | "auto";
    output_compression?: number;
    output_format?: "png" | "webp" | "jpeg";
    partial_images?: number;
    quality?:
        | "low"
        | "medium"
        | "high"
        | "auto";
    size?:
        | "auto"
        | "1024x1024"
        | "1536x1024"
        | "1024x1536";
    type: "image_generation";
}

Properties

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

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

input_image_mask?: InputImageMask

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

model?: "gpt-image-1"

The image generation model to use. Default: gpt-image-1.

moderation?: "low" | "auto"

Moderation level for the generated image. Default: auto.

output_compression?: number

Compression level for the output image. Default: 100.

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

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

partial_images?: number

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

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

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

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

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

type: "image_generation"

The type of the image generation tool. Always image_generation.