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
client.images.createVariation(ImageCreateVariationParams { image, model, n, 3 more } body, RequestOptionsoptions?): ImagesResponse { created, background, data, 4 more }
POST/images/variations
Create image edit
client.images.edit(ImageEditParamsbody, RequestOptionsoptions?): ImagesResponse { created, background, data, 4 more } | Stream<ImageEditStreamEvent>
POST/images/edits
Create image
client.images.generate(ImageGenerateParamsbody, RequestOptionsoptions?): ImagesResponse { created, background, data, 4 more } | Stream<ImageGenStreamEvent>
POST/images/generations
ModelsExpand Collapse
Image { b64_json, revised_prompt, url }

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

ImageEditCompletedEvent { b64_json, background, created_at, 5 more }

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

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.

ImageGenCompletedEvent { b64_json, background, created_at, 5 more }

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

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
ImagesResponse { created, background, data, 4 more }

The response from the image generation endpoint.