Emitted when image generation has completed and the final image is available.

interface ImageGenCompletedEvent {
    b64_json: string;
    background: "auto" | "transparent" | "opaque";
    created_at: number;
    output_format: "jpeg" | "png" | "webp";
    quality:
        | "low"
        | "medium"
        | "high"
        | "auto";
    size:
        | "auto"
        | "1024x1024"
        | "1536x1024"
        | "1024x1536";
    type: "image_generation.completed";
    usage: OpenAIClient.Images.ImageGenCompletedEvent.Usage;
}

Properties

b64_json: string

Base64-encoded image data, suitable for rendering as an image.

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

The background setting for the generated image.

created_at: number

The Unix timestamp when the event was created.

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

The output format for the generated image.

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

The quality setting for the generated image.

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

The size of the generated image.

type: "image_generation.completed"

The type of the event. Always image_generation.completed.

For gpt-image-1 only, the token usage information for the image generation.