Images
Given a prompt and/or an input image, the model will generate a new image.
Create image variation
ModelsExpand Collapse
class Image: …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.
class ImageEditCompletedEvent: …Emitted when image editing has completed and the final image is available.
Emitted when image editing has completed and the final image is available.
class ImageEditPartialImageEvent: …Emitted when a partial image is available during image editing streaming.
Emitted when a partial image is available during image editing streaming.
background: Literal["transparent", "opaque", "auto"]The background setting for the requested edited image.
The background setting for the requested edited image.
quality: Literal["low", "medium", "high", "auto"]The quality setting for the requested edited image.
The quality setting for the requested edited image.
Emitted when a partial image is available during image editing streaming.
Emitted when a partial image is available during image editing streaming.
class ImageEditPartialImageEvent: …Emitted when a partial image is available during image editing streaming.
Emitted when a partial image is available during image editing streaming.
background: Literal["transparent", "opaque", "auto"]The background setting for the requested edited image.
The background setting for the requested edited image.
quality: Literal["low", "medium", "high", "auto"]The quality setting for the requested edited image.
The quality setting for the requested edited image.
class ImageEditCompletedEvent: …Emitted when image editing has completed and the final image is available.
Emitted when image editing has completed and the final image is available.
class ImageGenCompletedEvent: …Emitted when image generation has completed and the final image is available.
Emitted when image generation has completed and the final image is available.
The type of the event. Always image_generation.completed.
class ImageGenPartialImageEvent: …Emitted when a partial image is available during image generation streaming.
Emitted when a partial image is available during image generation streaming.
Emitted when a partial image is available during image generation streaming.
Emitted when a partial image is available during image generation streaming.
class ImageGenPartialImageEvent: …Emitted when a partial image is available during image generation streaming.
Emitted when a partial image is available during image generation streaming.
class ImageGenCompletedEvent: …Emitted when image generation has completed and the final image is available.
Emitted when image generation has completed and the final image is available.
The type of the event. Always image_generation.completed.
class ImagesResponse: …The response from the image generation endpoint.
The response from the image generation endpoint.
background: Optional[Literal["transparent", "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[Literal["png", "webp", "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[Literal["low", "medium", "high"]]The quality of the image generated. Either low, medium, or high.
The quality of the image generated. Either low, medium, or high.
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024"]]The size of the image generated. Either 1024x1024, 1024x1536, or 1536x1024.
The size of the image generated. Either 1024x1024, 1024x1536, or 1536x1024.