Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Images

Given a prompt and/or an input image, the model will generate a new image.

Create image variation
images.create_variation(ImageCreateVariationParams**kwargs) -> ImagesResponse
POST/images/variations
Create image edit
images.edit(ImageEditParams**kwargs) -> ImagesResponse
POST/images/edits
Create image
images.generate(ImageGenerateParams**kwargs) -> ImagesResponse
POST/images/generations
ModelsExpand Collapse
class Image:

Represents the content or the URL of an image generated by the OpenAI API.

class ImageEditCompletedEvent:

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.

class ImageGenCompletedEvent:

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

class ImageGenPartialImageEvent:

Emitted when a partial image is available during image generation streaming.

Emitted when a partial image is available during image generation streaming.

Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-2", 5 more]
class ImagesResponse:

The response from the image generation endpoint.