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
$ openai images create-variation
POST/images/variations
Create image edit
$ openai images edit
POST/images/edits
Create image
$ openai images generate
POST/images/generations
ModelsExpand Collapse
image: object { b64_json, revised_prompt, url }

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

image_edit_completed_event: object { b64_json, background, created_at, 5 more }

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

image_edit_partial_image_event: object { b64_json, background, created_at, 5 more }

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

image_edit_stream_event: 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.

image_gen_completed_event: object { b64_json, background, created_at, 5 more }

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

image_gen_partial_image_event: object { b64_json, background, created_at, 5 more }

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

image_gen_stream_event: 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.

image_model: "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 5 more
images_response: object { created, background, data, 4 more }

The response from the image generation endpoint.