Ir al contenido

GPT Image 2 API

Integrar

Id del modelo openai/gpt-image-2
# 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?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"
  }'

# 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,106 $ 106 créditos de API Ejecutar en esta página

Obtener clave de API
OpenAI Texto a imagen #gpt-image-2#openai#typography#chatgpt-images-2

Texto a imagen de GPT Image 2 con tamaños flexibles de hasta 3840px por lado, orientado a una tipografía precisa

Creado en Doitong

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

Trabajos públicos mostrados: 16
A polished studio concept art board — a single composite page that reads as a high-end pre-produc...

A polished studio concept art board — a single composite page that reads as a high-end pre-production pitch deck for an animated short. NOT a vintage pencil sketch, NOT a finished movie frame, but a polished concept page in the visual treatment described below. Layout: TOP HEADER (left): bold...

Создай не меняя черты лица. Фотореалистичный винтажный 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...

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.

image_size predeterminado landscape_4_3

Las dimensiones de salida aceptan un nombre de ajuste preestablecido, un objeto {width, height} o 'auto' para que el modelo elija el mejor tamaño. Todos los tamaños concretos requieren dimensiones divisibles entre 16, bordes de no más de 3840px, una relación de aspecto máxima de 3:1 y un recuento total de píxeles de 655,360–8,294,400.

num_images predeterminado 1

Cantidad de imágenes que se producirán.

Avanzado background · quality · output_format · enable_safety_checker
background predeterminado auto

Fondo de la imagen resultante.

quality predeterminado high

Selección de calidad de imagen, incluida '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?wait=20 cotización → 0,106 $
# 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?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"
  }'

# 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 se guarda (localStorage) únicamente si marcas Recordar. Obtener una clave de API

Acerca de GPT Image 2 API

Genera imágenes a partir de un prompt de hasta 32000 caracteres. `image_size` acepta preajustes, auto o un ancho y una altura explícitos; ambas dimensiones deben ser múltiplos de 16, con un lado máximo de 3840px. La calidad puede ser auto, low, medium o high, con hasta 4 imágenes por llamada en png, jpeg o webp.

Parámetros

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

NombreTipo PredeterminadoPermitido Descripción
promptobligatorio
Tipostring
≤ 32.000 caracteres≥ 2 caracteres
Prompt utilizado para generar imágenes.
image_sizeopcional
Tipoobject
Predeterminadolandscape_4_3
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9auto
Las dimensiones de salida aceptan un nombre de ajuste preestablecido, un objeto {width, height} o 'auto' para que el modelo elija el mejor tamaño. Todos los tamaños concretos requieren dimensiones divisibles entre 16, bordes de no más de 3840px, una relación de aspecto máxima de 3:1 y un recuento total de píxeles de 655,360–8,294,400.
backgroundopcional
Tipoenum
Predeterminadoauto
autotransparentopaque
Fondo de la imagen resultante.
qualityopcional
Tipoenum
Predeterminadohigh
autolowmediumhigh
Selección de calidad de imagen, incluida 'auto' para que el modelo elija la mejor calidad según el prompt.
num_imagesopcional num_outputs
Tipointeger
Predeterminado1
1 – 4
Cantidad 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 el autor de la llamada esté autorizado.
obligatorio Nombre canónico, también aceptado

Salida

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "openai/gpt-image-2",
  "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": 106,
    "usd": "0.106",
    "charged": 106,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "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 (se cobra 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: Texto a imagen

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