Ir al contenido

GPT Image 2 API · Edit

Integrar

ID del modelo openai/gpt-image-2/edit
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/openai/gpt-image-2/edit?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "images": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Esta solicitud: ≈0,222 $ 222 créditos de API Ejecutar en esta página

Obtener clave de API
OpenAI Edición de imágenes #gpt-image-2#openai#chatgpt-images-2

Edición con GPT Image 2 y hasta 16 imágenes de referencia, con máscara opcional

Creado en Doitong

Trabajos públicos creados con GPT Image 2 API por la comunidad de Doitong. Reutiliza un prompt con un solo clic.

Trabajos públicos mostrados: 16
Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое наполь...

Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое напольное зеркало в тонкой арочной раме. Спиной к камере у зеркала стоит взрослая девушка-, корпус развёрнут к своему отражению, голова слегка повёрнута в профиль, взгляд направлен в зеркало на свою...

Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое наполь...

Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое напольное зеркало в тонкой арочной раме. Спиной к камере у зеркала стоит взрослая девушка-, корпус развёрнут к своему отражению, голова слегка повёрнута в профиль, взгляд направлен в зеркало на свою...

Create image: ultra realistic image: man 35 years old sitting in super luxury house (ref4). Luxur...

Create image: ultra realistic image: man 35 years old sitting in super luxury house (ref4). Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a luxurious sofa. The...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furni...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a luxurious sofa. The man is...

Сделай этикетку на продукцию оформленную красиво и стильно в соответствии с составом. Можешь орие...

Сделай этикетку на продукцию оформленную красиво и стильно в соответствии с составом. Можешь ориентироваться по стилю на фото 1. Текст на этикетке: производитель ИП Стрини Ю.Л. «соломка горбуши», состав: рыба горбуша, соль, сахар, специи. Срок хранения при t не от 0 до -3 60 суток. Вес: 500гр

Create image: ultra realistic image: man 35 years old (attached reference ) sitting in super luxu...

Create image: ultra realistic image: man 35 years old (attached reference ) sitting in super luxury house. Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furni...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a luxurious sofa. The man is...

Art style: 3D stylized animation. Вид сверху: босые ступни стоят на стильных электронных весах. Э...

Art style: 3D stylized animation. Вид сверху: босые ступни стоят на стильных электронных весах. Экран мягко подсвечивает цифру 70кг. Светлое пушистое ковровое покрытие с фото 2, виднеющееся по краям, озарено тёплым солнечным светом. Кадр лаконичен и целиком сосредоточен на дисплее....

Crear una solicitud

Los controles se generan a partir del esquema del modelo. El código y el precio se actualizan al modificarlos.

•obligatorio 88 / 32000

Prompt utilizado para generar imágenes.

•obligatorio image_urls
Suelta un archivo o · hasta 16

URL de imágenes de referencia para la generación, limitadas a 16 imágenes.

image_size predeterminado auto

Dimensiones de salida, inferidas a partir de las imágenes proporcionadas cuando se establece 'auto'.

num_images predeterminado 1

Número de imágenes que se producirán.

Avanzado mask · background · quality · output_format · enable_safety_checker
mask_url
Suelta un archivo o

URL de una imagen de máscara que identifica la región que se editará durante la generación.

background predeterminado auto

Fondo de la imagen resultante.

quality predeterminado high

Selección de calidad de imagen, incluido 'auto' para que el modelo elija la mejor calidad según el prompt.

output_format predeterminado png

Formato de archivo de las imágenes de salida.

POST /run/openai/gpt-image-2/edit?wait=20 presupuesto → 0,222 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/openai/gpt-image-2/edit?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "images": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Ejecutar esta solicitud

Tu clave permanece en este navegador: solo se envía a la Doitong API y solo se guarda en localStorage si marcas Recordar. Obtener una clave de API

Acerca de GPT Image 2 API · Edit

Edita o compone imágenes a partir de hasta 16 URL en `image_urls`, guiado por un prompt de hasta 32000 caracteres. Una `mask_url` limita la edición a una región. `image_size` usa auto de forma predeterminada, que infiere el tamaño a partir de las entradas. La calidad va de auto a high, con hasta 4 resultados en png, jpeg o webp.

Parámetros

Envía el nombre canónico o el nombre nativo, pero no ambos. Nombres canónicos

NombreTipo PredeterminadoPermitido Descripción
promptobligatorio
Tipostring
≤ 32.000 caracteres≥ 2 caracteres
Prompt utilizado para generar imágenes.
image_urlsobligatorio images
Tipourl[] · image
≤ 16 elementos
URL de imágenes de referencia para la generación, limitadas a 16 imágenes.
image_sizeopcional
Tipoobject
Predeterminadoauto
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9auto
Dimensiones de salida, inferidas a partir de las imágenes proporcionadas cuando se establece 'auto'.
backgroundopcional
Tipoenum
Predeterminadoauto
autotransparentopaque
Fondo de la imagen resultante.
qualityopcional
Tipoenum
Predeterminadohigh
autolowmediumhigh
Selección de calidad de imagen, incluido 'auto' para que el modelo elija la mejor calidad según el prompt.
num_imagesopcional num_outputs
Tipointeger
Predeterminado1
1 – 4
Número de imágenes que se producirán.
output_formatopcional
Tipoenum
Predeterminadopng
jpegpngwebp
Formato de archivo de las imágenes de salida.
enable_safety_checkeropcional
Tipoboolean
Predeterminadotrue
La moderación puede relajarse estableciendo false, siempre que la persona que realiza la solicitud esté autorizada.
mask_urlopcional mask
Tipourl · image
URL de una imagen de máscara que identifica la región que se editará durante la generación.
obligatorio Nombre canónico, también aceptado

Los parámetros de archivo aceptan una URL pública https://, un URI data: de hasta 10 MB o el file_url de una subida. Archivos

Salida

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "openai/gpt-image-2/edit",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 222,
    "usd": "0.222",
    "charged": 222,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Tus archivos, tú eligesCada outputs[].url es una copia en nuestro almacenamiento: conservada para siempre (con pago por GB-mes) o 7 días gratis, según la configuración de tu cuenta o ?storage=.
La misma estructura en todos los modelostype, url, content_type, width, height y duration, tanto para imágenes como para vídeo y audio. output es el objeto de resultado propio del modelo.
Campos de salida
images
array of object {url, content_type, file_name, file_size, width, height}Imágenes producidas por el modelo.

Más modelos: Edición de imágenes

Para agentes de IA: esta página en Markdown está en https://doitong.com/es-ES/developers/models/openai/gpt-image-2/edit.md. Todos los modelos y guías: https://doitong.com/developers/llms.txt