Skip to main content
POST
/
images
/
variations
Create image variations
curl --request POST \
  --url https://api.anyapi.ai/v1/images/variations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form image=@example-file \
  --form n=2 \
  --form size=1024x1024
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Get your API key from the dashboard.

Body

multipart/form-data
image
file
required

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

model
string

The model to use for image variation generation

Example:

"dall-e-2"

n
integer
default:1

The number of images to generate

Required range: 1 <= x <= 10
response_format
enum<string>
default:url

The format in which the generated images are returned

Available options:
url,
b64_json
size
enum<string>
default:1024x1024

The size of the generated images

Available options:
256x256,
512x512,
1024x1024
user
string

A unique identifier representing your end-user

Response

Successful response

created
integer
required

The Unix timestamp (in seconds) of when the images were generated

data
object[]
required

Array of generated image objects

I