Create image variation
Deprecated
images.create_variation(**kwargs) -> ImagesResponse { created, background, data, 4 more }
POST/images/variations
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.
Parameters
image: FileInput
The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
user: String
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
Create image variation
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
images_response = openai.images.create_variation(image: StringIO.new("Example data"))
puts(images_response){
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
Returns Examples
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}