Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lemondata.cc/llms.txt

Use this file to discover all available pages before exploring further.

Overview

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

Request Body

Synchronous request timeout: Some routed image providers return the final image inline and wait for generation to finish. High-resolution or high-quality requests can take close to a minute or longer, so set your HTTP client timeout to at least 120s. If the create response includes status: "pending", task_id, or poll_url, follow the returned poll_url instead.
image
file
required
The image to use as the basis for the variation. Must be a valid PNG file, less than 50MB, 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 "image=@cat.png" \
  -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.