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(**kwargs) -> ImagesResponse { created, background, data, 4 more }
POST/images/variations
Create image edit
images.edit(**kwargs) -> ImagesResponse { created, background, data, 4 more }
POST/images/edits
Create image
images.generate(**kwargs) -> ImagesResponse { created, background, data, 4 more }
POST/images/generations
ModelsExpand Collapse
class Image { b64_json, revised_prompt, url }

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

class ImageEditCompletedEvent { b64_json, background, created_at, 5 more }

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

class ImageEditPartialImageEvent { b64_json, background, created_at, 5 more }

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

ImageEditStreamEvent = ImageEditPartialImageEvent { b64_json, background, created_at, 5 more } | ImageEditCompletedEvent { b64_json, background, created_at, 5 more }

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

class ImageGenCompletedEvent { b64_json, background, created_at, 5 more }

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

class ImageGenPartialImageEvent { b64_json, background, created_at, 5 more }

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

ImageGenStreamEvent = ImageGenPartialImageEvent { b64_json, background, created_at, 5 more } | ImageGenCompletedEvent { b64_json, background, created_at, 5 more }

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

ImageModel = :"gpt-image-1" | :"gpt-image-1-mini" | :"gpt-image-2" | 5 more
class ImagesResponse { created, background, data, 4 more }

The response from the image generation endpoint.