Pular para o conteúdo principal
POST
Create image variation
Guia relacionado: guia de Multimodal. Consulte o guia de Multimodal para um passo a passo com exemplos.

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Corpo

multipart/form-data

input

model
string
obrigatório

The model to use for image generation.

Exemplo:

"openai/gpt-image-2"

image
file

The image to vary. Must be a supported image file. It should be a png, webp, or jpg file less than 50MB.

n
number | null
padrão:1

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

Intervalo obrigatório: 1 <= x <= 10
response_format
enum<string>
padrão:url

The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

Opções disponíveis:
url,
b64_json
size
enum<string>
padrão:1024x1024

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

Opções disponíveis:
256x256,
512x512,
1024x1024
user
string

A unique identifier representing your end-user, which can help to monitor and detect abuse.

name
string

The name to display on the trace. If not specified, the default system name will be used.

fallback_on_codes
integer[]

HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].

Maximum array length: 20
Intervalo obrigatório: 400 <= x <= 599
fallbacks
object[]

Array of fallback models to use if primary model fails

retry
object

Retry configuration for the request

cache
object

Cache configuration for the request.

load_balancer
object

Load balancer configuration for the request.

timeout
object

Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.

orq
object

Resposta

Represents an image variation response from the API.

created
number
obrigatório

The Unix timestamp (in seconds) of when the image was created.

data
object[]
obrigatório

The list of generated images.

output_format
string

The output format of the image generation

size
string

The size of the image generated

quality
string

The quality of the image generated

usage
object

The token usage information for the image generation.