Images
Given a prompt and/or an input image, the model will generate a new image.
Create image variation
Create image edit
Create image
ModelsExpand Collapse
Image object { b64_json, revised_prompt, url } Represents the content or the URL of an image generated by the OpenAI API.
Represents the content or the URL of an image generated by the OpenAI API.
The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if response_format is set to b64_json for dall-e-2 and dall-e-3.
ImageEditCompletedEvent object { b64_json, background, created_at, 5 more } Emitted when image editing has completed and the final image is available.
Emitted when image editing has completed and the final image is available.
size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
ImageEditPartialImageEvent object { b64_json, background, created_at, 5 more } Emitted when a partial image is available during image editing streaming.
Emitted when a partial image is available during image editing streaming.
background: "transparent" or "opaque" or "auto"The background setting for the requested edited image.
The background setting for the requested edited image.
ImageEditStreamEvent = ImageEditPartialImageEvent { b64_json, background, created_at, 5 more } or ImageEditCompletedEvent { b64_json, background, created_at, 5 more } Emitted when a partial image is available during image editing streaming.
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.
Emitted when a partial image is available during image editing streaming.
background: "transparent" or "opaque" or "auto"The background setting for the requested edited image.
The background setting for the requested edited image.
ImageEditCompletedEvent object { b64_json, background, created_at, 5 more } Emitted when image editing has completed and the final image is available.
Emitted when image editing has completed and the final image is available.
size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
ImageGenCompletedEvent object { b64_json, background, created_at, 5 more } Emitted when image generation has completed and the final image is available.
Emitted when image generation has completed and the final image is available.
size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
ImageGenPartialImageEvent object { b64_json, background, created_at, 5 more } Emitted when a partial image is available during image generation streaming.
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, 5 more } Emitted when a partial image is available during image generation streaming.
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.
Emitted when a partial image is available during image generation streaming.
ImageGenCompletedEvent object { b64_json, background, created_at, 5 more } Emitted when image generation has completed and the final image is available.
Emitted when image generation has completed and the final image is available.
size: string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
ImagesResponse object { created, background, data, 4 more } The response from the image generation endpoint.
The response from the image generation endpoint.
background: optional "transparent" or "opaque"The background parameter used for the image generation. Either transparent or opaque.
The background parameter used for the image generation. Either transparent or opaque.
The list of generated images.
The list of generated images.
The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if response_format is set to b64_json for dall-e-2 and dall-e-3.
output_format: optional "png" or "webp" or "jpeg"The output format of the image generation. Either png, webp, or jpeg.
The output format of the image generation. Either png, webp, or jpeg.
quality: optional "low" or "medium" or "high" or 2 moreThe quality of the image generated. One of low, medium, high, xhigh, or max.
The quality of the image generated. One of low, medium, high, xhigh, or max.
size: optional string or "1024x1024" or "1024x1536" or "1536x1024"The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.
The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.