Create image variation
POST
https://api.openai.com/v1/images/variationsCreates a variation of a given image.
Request
Header Params
Authorization
string
optional
Example:
Bearer {{YOUR_API_KEY}}
Body Params 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.
Example:
cmMtdXBsb2FkLTE2ODc4MzMzNDc3NTEtMjc=/31225951_59371037e9_small.png
n
string
optional
The number of images to generate. Must be between 1 and 10.
Example:
2
size
string
optional
The size of the generated images. Must be one of 256x256
, 512x512
, or 1024x1024
.
Example:
1024x1024
response_format
string
optional
The format in which the generated images are returned. Must be one of url
or b64_json
.
Example:
url
user
string
optional
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
Request samples
Responses
成功(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
created
integer
required
data
array [object {1}]
required
url
string
required
Example成功示例
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
Last modified: a year ago