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
Theme

Images

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

Create image variation
Deprecated
images.create_variation(**kwargs) -> ImagesResponse
POST
/images/variations
Create image edit
images.edit(**kwargs) -> ImagesResponse
POST
/images/edits
Create image
images.generate(**kwargs) -> ImagesResponse
POST
/images/generations
Models
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.5", "gpt-image-2", "gpt-image-2-2026-04-21", 11 more]
class ImagesResponse: …

The response from the image generation endpoint.