Images

Create image variation

Changed on

This endpoint is retired and no longer available. Use the image edits endpoint with a GPT Image model and a prompt to create a variation of an image. The request and response schemas below describe the legacy contract.

post/images/variations

Request

  • Base URL
    https://api.openai.com/v1
  • URL
    https://api.openai.com/v1/images/variations
  • Auth
    HTTP bearer

Request body multipart/form-data

imagestring binary required

The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.

ninteger nullable

The number of images to generate. Must be between 1 and 10.

response_format'url' | 'b64_json' | 'null' nullable

The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

size'256x256' | '512x512' | '1024x1024' | 'null' nullable

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

userstring

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Example request

{
  "n": 1,
  "response_format": "url",
  "size": "1024x1024",
  "user": "user-1234"
}

Response

OK

safety_identifierstring nullable

The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.

createdinteger required

The Unix timestamp (in seconds) of when the image was created.

background'transparent' | 'opaque'

The background parameter used for the image generation. Either transparent or opaque.

output_format'png' | 'webp' | 'jpeg'

The output format of the image generation. Either png, webp, or jpeg.

quality'low' | 'medium' | 'high' | 'xhigh' | 'max'

The quality of the image generated. One of low, medium, high, xhigh, or max.

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status