Images
Given a prompt and/or an input image, the model will generate a new image.
Models
Image object { b64_json, revised_prompt, url } Represents the content or the URL of an image generated by the OpenAI API.
Image object { b64_json, revised_prompt, url }
Represents the content or the URL of an image generated by the OpenAI API.
b64_json: optional string The base64-encoded JSON of the generated image. Returned by default for GPT image models, or when response_format is set to b64_json for models that support that parameter.
revised_prompt: optional string The revised prompt used to generate the image, for models that support prompt revision. Not returned by GPT image models.
url: optional string The URL of the generated image when response_format is set to url for models that support that parameter. Unsupported for GPT image models.
formaturi
ImageEditCompletedEvent object { b64_json, background, created_at, 6 more } Emitted when image editing has completed and the final image is available.
ImageEditCompletedEvent object { b64_json, background, created_at, 6 more }
Emitted when image editing has completed and the final image is available.
b64_json: string Base64-encoded final edited image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the edited image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the edited image.
One of the following: "png" "webp" "jpeg" quality: "low" or "medium" or "high" or 3 more The quality setting for the edited image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_edit.completed" The type of the event. Always image_edit.completed.
usage: { input_tokens, input_tokens_details, output_tokens, total_tokens } For the GPT image models only, the token usage information for the image generation.
input_tokens: integer The number of tokens (images and text) in the input prompt.
input_tokens_details: { image_tokens, text_tokens } The input tokens detailed information for the image generation.
image_tokens: integer The number of image tokens in the input prompt.
text_tokens: integer The number of text tokens in the input prompt.
output_tokens: integer The number of image tokens in the output image.
total_tokens: integer The total number of tokens (images and text) used for the image generation.
safety_identifier: optional string or null The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.
ImageEditPartialImageEvent object { b64_json, background, created_at, 5 more } Emitted when a partial image is available during image editing streaming.
ImageEditPartialImageEvent object { b64_json, background, created_at, 5 more }
Emitted when a partial image is available during image editing streaming.
b64_json: string Base64-encoded partial image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the requested edited image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the requested edited image.
One of the following: "png" "webp" "jpeg" partial_image_index: integer 0-based index for the partial image (streaming).
quality: "low" or "medium" or "high" or 3 more The quality setting for the requested edited image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_edit.partial_image" The type of the event. Always image_edit.partial_image.
ImageEditStreamEvent = ImageEditPartialImageEvent { b64_json, background, created_at, 5 more } or ImageEditCompletedEvent { b64_json, background, created_at, 6 more } Emitted when a partial image is available during image editing streaming.
ImageEditStreamEvent = ImageEditPartialImageEvent { b64_json, background, created_at, 5 more } or ImageEditCompletedEvent { b64_json, background, created_at, 6 more }
Emitted when a partial image is available during image editing streaming.
One of the following: ImageEditPartialImageEvent { b64_json, background, created_at, 5 more } Emitted when a partial image is available during image editing streaming.
b64_json: string Base64-encoded partial image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the requested edited image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the requested edited image.
One of the following: "png" "webp" "jpeg" partial_image_index: integer 0-based index for the partial image (streaming).
quality: "low" or "medium" or "high" or 3 more The quality setting for the requested edited image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_edit.partial_image" The type of the event. Always image_edit.partial_image.
ImageEditCompletedEvent { b64_json, background, created_at, 6 more } Emitted when image editing has completed and the final image is available.
b64_json: string Base64-encoded final edited image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the edited image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the edited image.
One of the following: "png" "webp" "jpeg" quality: "low" or "medium" or "high" or 3 more The quality setting for the edited image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_edit.completed" The type of the event. Always image_edit.completed.
usage: { input_tokens, input_tokens_details, output_tokens, total_tokens } For the GPT image models only, the token usage information for the image generation.
input_tokens: integer The number of tokens (images and text) in the input prompt.
input_tokens_details: { image_tokens, text_tokens } The input tokens detailed information for the image generation.
image_tokens: integer The number of image tokens in the input prompt.
text_tokens: integer The number of text tokens in the input prompt.
output_tokens: integer The number of image tokens in the output image.
total_tokens: integer The total number of tokens (images and text) used for the image generation.
safety_identifier: optional string or null The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.
ImageGenCompletedEvent object { b64_json, background, created_at, 6 more } Emitted when image generation has completed and the final image is available.
ImageGenCompletedEvent object { b64_json, background, created_at, 6 more }
Emitted when image generation has completed and the final image is available.
b64_json: string Base64-encoded image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the generated image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the generated image.
One of the following: "png" "webp" "jpeg" quality: "low" or "medium" or "high" or 3 more The quality setting for the generated image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_generation.completed" The type of the event. Always image_generation.completed.
usage: { input_tokens, input_tokens_details, output_tokens, total_tokens } For the GPT image models only, the token usage information for the image generation.
input_tokens: integer The number of tokens (images and text) in the input prompt.
input_tokens_details: { image_tokens, text_tokens } The input tokens detailed information for the image generation.
image_tokens: integer The number of image tokens in the input prompt.
text_tokens: integer The number of text tokens in the input prompt.
output_tokens: integer The number of image tokens in the output image.
total_tokens: integer The total number of tokens (images and text) used for the image generation.
safety_identifier: optional string or null The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.
ImageGenPartialImageEvent object { b64_json, background, created_at, 5 more } Emitted when a partial image is available during image generation streaming.
ImageGenPartialImageEvent object { b64_json, background, created_at, 5 more }
Emitted when a partial image is available during image generation streaming.
b64_json: string Base64-encoded partial image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the requested image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the requested image.
One of the following: "png" "webp" "jpeg" partial_image_index: integer 0-based index for the partial image (streaming).
quality: "low" or "medium" or "high" or 3 more The quality setting for the requested image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_generation.partial_image" The type of the event. Always image_generation.partial_image.
ImageGenStreamEvent = ImageGenPartialImageEvent { b64_json, background, created_at, 5 more } or ImageGenCompletedEvent { b64_json, background, created_at, 6 more } Emitted when a partial image is available during image generation streaming.
ImageGenStreamEvent = ImageGenPartialImageEvent { b64_json, background, created_at, 5 more } or ImageGenCompletedEvent { b64_json, background, created_at, 6 more }
Emitted when a partial image is available during image generation streaming.
One of the following: ImageGenPartialImageEvent { b64_json, background, created_at, 5 more } Emitted when a partial image is available during image generation streaming.
b64_json: string Base64-encoded partial image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the requested image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the requested image.
One of the following: "png" "webp" "jpeg" partial_image_index: integer 0-based index for the partial image (streaming).
quality: "low" or "medium" or "high" or 3 more The quality setting for the requested image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_generation.partial_image" The type of the event. Always image_generation.partial_image.
ImageGenCompletedEvent { b64_json, background, created_at, 6 more } Emitted when image generation has completed and the final image is available.
b64_json: string Base64-encoded image data, suitable for rendering as an image.
background: "transparent" or "opaque" or "auto" The background setting for the generated image.
One of the following: "transparent" "opaque" "auto" created_at: integer The Unix timestamp when the event was created.
formatunixtime output_format: "png" or "webp" or "jpeg" The output format for the generated image.
One of the following: "png" "webp" "jpeg" quality: "low" or "medium" or "high" or 3 more The quality setting for the generated image.
One of the following: "low" "medium" "high" "xhigh" "max" "auto" size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" or "auto" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" "auto" type: "image_generation.completed" The type of the event. Always image_generation.completed.
usage: { input_tokens, input_tokens_details, output_tokens, total_tokens } For the GPT image models only, the token usage information for the image generation.
input_tokens: integer The number of tokens (images and text) in the input prompt.
input_tokens_details: { image_tokens, text_tokens } The input tokens detailed information for the image generation.
image_tokens: integer The number of image tokens in the input prompt.
text_tokens: integer The number of text tokens in the input prompt.
output_tokens: integer The number of image tokens in the output image.
total_tokens: integer The total number of tokens (images and text) used for the image generation.
safety_identifier: optional string or null The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.
ImageModel = "gpt-image-1.5" or "gpt-image-2" or "gpt-image-2-2026-04-21" or 11 more
ImageModel = "gpt-image-1.5" or "gpt-image-2" or "gpt-image-2-2026-04-21" or 11 more
One of the following: "gpt-image-1.5" "gpt-image-2" "gpt-image-2-2026-04-21" "gpt-image-2.5-sunburst" "gpt-image-2.5-sunburst-2026-09-08" "gpt-image-2.5-flare" "gpt-image-2.5-flare-2026-09-08" "gpt-image-2.6-sunburst" "gpt-image-2.6-flare" "gpt-image-1-mini" "chatgpt-image-latest" "gpt-image-1" Deprecated. GPT Image 1 was shut down on October 23, 2026. Use gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
"dall-e-2" Deprecated. This model was retired on May 12, 2026. Use a GPT image model instead.
"dall-e-3" Deprecated. This model was retired on May 12, 2026. Use a GPT image model instead.
ImagesResponse object { created, background, data, 6 more } The response from the image generation endpoint.
ImagesResponse object { created, background, data, 6 more }
The response from the image generation endpoint.
created: integer The Unix timestamp (in seconds) of when the image was created.
formatunixtime background: optional "transparent" or "opaque" The background parameter used for the image generation. Either transparent or opaque.
One of the following: "transparent" "opaque" data: optional array of Image { b64_json, revised_prompt, url } The list of generated images.
b64_json: optional string The base64-encoded JSON of the generated image. Returned by default for GPT image models, or when response_format is set to b64_json for models that support that parameter.
revised_prompt: optional string The revised prompt used to generate the image, for models that support prompt revision. Not returned by GPT image models.
url: optional string The URL of the generated image when response_format is set to url for models that support that parameter. Unsupported for GPT image models.
formaturi output_format: optional "png" or "webp" or "jpeg" or 2 more The output format of the generated or edited image.
One of the following: "png" "webp" "jpeg" "gif" "svg" quality: optional "low" or "medium" or "high" or 2 more The quality of the image generated. One of low, medium, high, xhigh, or max.
One of the following: "low" "medium" "high" "xhigh" "max" safety_identifier: optional string or null The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: string "1024x1024" or "1024x1536" or "1536x1024" The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
One of the following: "1024x1024" "1024x1536" "1536x1024" svg_usage: optional { input_tokens, model, output_tokens, 2 more } Token usage for SVG authoring, separate from image rendering usage.
input_tokens: integer model: string output_tokens: integer reasoning_tokens: integer total_tokens: integer usage: optional { input_tokens, input_tokens_details, output_tokens, 2 more } Token usage information for image generation with GPT Image models.
input_tokens: integer The number of tokens (images and text) in the input prompt.
input_tokens_details: { image_tokens, text_tokens } The input tokens detailed information for the image generation.
image_tokens: integer The number of image tokens in the input prompt.
text_tokens: integer The number of text tokens in the input prompt.
output_tokens: integer The number of output tokens generated by the model.
total_tokens: integer The total number of tokens (images and text) used for the image generation.
output_tokens_details: optional { image_tokens, text_tokens } The output token details for the image generation.
image_tokens: integer The number of image output tokens generated by the model.
text_tokens: integer The number of text output tokens generated by the model.