Перейти к содержимому
Главная

GPT Image 2 Edit

gpt_image_2_edit

Image editing model for generating high-quality edited images from input images and text prompts.

POST /v1/queue/gpt_image_2_edit # Создать задачу
GET /v1/queue/gpt_image_2_edit/requests/{request_id}/status # Проверить статус
GET /v1/queue/gpt_image_2_edit/requests/{request_id}/response # Получить результат
PUT /v1/queue/gpt_image_2_edit/requests/{request_id}/cancel # Отменить задачу
Окно терминала
curl --location "https://odirouter.ai/model/v1/queue/gpt_image_2_edit" \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "Replace the background with a clean white studio setup while preserving the product details.",
"images": ["https://example.com/input.png"],
"n": 1,
"size": "1024x1024",
"quality": "medium",
"background": "auto",
"output_format": "jpeg",
"output_compression": 90,
"moderation": "auto"
}'
prompt string обязательно

Text description of the desired edited image, with a maximum length of 32000 characters.

images any обязательно

Input image references for editing, with up to 16 input images supported.

mask any

Mask image for selecting editable regions. Transparent areas are treated as editable. The mask should match the edited image format and dimensions and include an alpha channel. If omitted, the whole image can be edited.

n int

Number of edited images to generate.

Range: 1 - 10

Default: 1

size string

Output image size.

Supports auto, common fixed sizes such as 1024x1024, 1024x1536, and 1536x1024, or a custom WIDTHxHEIGHT value that satisfies GPT Image 2 size constraints.

Custom size requirements: width and height must both be multiples of 16; aspect ratio must not exceed 3:1; the longest side must not exceed 3840px; total pixels must be between 655360 and 8294400.

Default: auto

quality string

Image quality level.

Options: low, medium, high, auto

Default: auto

background string

Background setting. GPT Image 2 currently does not support transparent transparent backgrounds. If transparent is passed, the service may accept the request, but transparent output is not guaranteed and may be ignored upstream or handled as a non-transparent background.

Options: auto, opaque

Default: auto

output_format string

Returned image format.

Options: png, jpeg, webp

Default: png

output_compression int

Output compression level. Only applies when output_format is jpeg or webp. For example, output_compression=50 compresses the output image by 50%.

Range: 0 - 100

Default: 100

moderation string

Content moderation strictness for GPT Image generation requests.

Options: auto, low

Default: auto

user string

Unique identifier representing the end user.

{
"request_id": "mmsu_01hxyz...",
"response_url": "https://odirouter.ai/model/v1/queue/gpt_image_2_edit/requests/mmsu_01hxyz.../response",
"status_url": "https://odirouter.ai/model/v1/queue/gpt_image_2_edit/requests/mmsu_01hxyz.../status",
"cancel_url": "https://odirouter.ai/model/v1/queue/gpt_image_2_edit/requests/mmsu_01hxyz.../cancel",
"queue_position": 0
}
ПолеТипОписание
request_idstringИдентификатор задачи, используемый во всех последующих операциях.
response_urlstringURL для получения итогового результата.
status_urlstringURL для проверки статуса задачи.
cancel_urlstringURL для отмены задачи.
queue_positionintТекущая позиция в очереди.