Skip to main content
POST
/
v1
/
images
/
variations
curl -X POST "https://api.lemondata.cc/v1/images/variations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "[email protected]" \
  -F "n=2" \
  -F "size=1024x1024"
{
  "created": 1706000000,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}

Overview

Creates a variation of a given image. Requires multipart/form-data content type.

Request Body

image
file
required
The image to use as the basis for the variation. Must be a valid PNG file, less than 4MB, and square.
model
string
default:"dall-e-2"
The model to use for image variations. Currently only dall-e-2 is supported.
n
integer
default:"1"
The number of images to generate. Must be between 1 and 10.
size
string
The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
response_format
string
default:"url"
The format in which the generated images are returned. Must be url or b64_json.
user
string
A unique identifier representing your end-user for abuse monitoring.

Response

created
integer
Unix timestamp of when the images were created.
data
array
Array of generated image variations.Each object contains:
  • url (string): URL of the variation image (if response_format is url)
  • b64_json (string): Base64-encoded image (if response_format is b64_json)
curl -X POST "https://api.lemondata.cc/v1/images/variations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "[email protected]" \
  -F "n=2" \
  -F "size=1024x1024"
{
  "created": 1706000000,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}

Notes

Image variations are only available with DALL-E 2. The model will generate new images that are similar in style and content to the original image.

Body

application/json
image
file
required

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

model
string

The model to use for image variations. Currently only dall-e-2 is supported.

n
integer

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

size
string

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

response_format
string

The format in which the generated images are returned. Must be url or b64_json .

user
string

A unique identifier representing your end-user for abuse monitoring.

Response

200 - application/json

Response 200

created
integer

Unix timestamp of when the images were created.

data
object[]

Array of generated image variations. Each object contains: url (string): URL of the variation image (if response_format is url ) b64_json (string): Base64-encoded image (if response_format is b64_json )