Saltar al cuntegna

GPT Image 2 API · Edit

Integrar

ID dal model 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"

Questa dumonda: ≈$0,222 222 credits API Lantschar sin questa pagina

Obtegna ina clav API
OpenAI Modificaziun da maletgs #gpt-image-2#openai#chatgpt-images-2

Editura da GPT Image 2 cun fin a 16 maletgs da referenza e mascrina opziunala

Fatg sin Doitong

Ovras publicas fatgas cun GPT Image 2 API da la communitad Doitong. Reutilisescha in prompt cun in clic.

Ovras publicas mussadas: 16
Art style: Реалистичный кулинарный блог. Финальный кадр, средний план ведущей. Она улыбается свое...

Art style: Реалистичный кулинарный блог. Финальный кадр, средний план ведущей. Она улыбается своей самой широкой и дружелюбной улыбкой, глядя в камеру. Она делает призывающий жест руками, словно приглашая к общению. Перед ней на столе по-прежнему лежат аппетитные булочки. Освещение становится...

Grungy analog photo of Daphne Blake (from Serial scooby doo) watching her own movie on a 90s CRT ...

Grungy analog photo of Daphne Blake (from Serial scooby doo) watching her own movie on a 90s CRT TV in a dimly lit bedroom. The TV clearly shows animated scene from scooby doo, with a cartoon-style Daphne in her classic clothes on screen, smiling. Daphne Blake is sitting cross-legged on the floor...

Fotografia realistica scattata dall’interno di un appartamento situato a un piano abbastanza alto...

Fotografia realistica scattata dall’interno di un appartamento situato a un piano abbastanza alto, guardando verso il basso attraverso una finestra aperta su una normale strada cittadina. In strada, una folla numerosa di manifestanti avanza compatta; alcune persone indossano passamontagna. Sul...

Art style: Disney-inspired. Золушка walking further back in the frame; Косметолог standing in the...

Art style: Disney-inspired. Золушка walking further back in the frame; Косметолог standing in the near foreground. The couch and strip of reflective floor separate them. Золушка is walking on glossy floor near the open doorway further back in the frame in the midground. Torso in three-quarter...

Art style: Реалистичный кулинарный блог. Экстремально крупный план рук ведущей, разламывающих гот...

Art style: Реалистичный кулинарный блог. Экстремально крупный план рук ведущей, разламывающих готовую, горячую булочку. Булочка имеет аппетитную золотисто-коричневую корочку, густо посыпанную поджаренным кунжутом. В месте разлома видна пористая, воздушная и очень мягкая текстура мякиша...

Art style: Реалистичный кулинарный блог. Финальный кадр, средний план ведущей. Она улыбается свое...

Art style: Реалистичный кулинарный блог. Финальный кадр, средний план ведущей. Она улыбается своей самой широкой и дружелюбной улыбкой, глядя в камеру. Она делает призывающий жест руками, словно приглашая к общению. Перед ней на столе по-прежнему лежат аппетитные булочки. Освещение становится...

Square album cover for an energetic house dance single. A dancing crowd silhouette in a night clu...

Square album cover for an energetic house dance single. A dancing crowd silhouette in a night club under warm orange and golden stage lights, flying sparks and flames rising from the dance floor, misty Scottish highland mountains faintly visible in the glowing background. Bold modern clean...

Medium shot of launch team executives in smart casual blazers over plain t-shirts, sitting in a m...

Medium shot of launch team executives in smart casual blazers over plain t-shirts, sitting in a modern conference room facing a large display showing the 'International AI Safety Report' document title from February 2026, professional lighting. Context markers: smart casual blazer, plain t-shirt,...

Construir ina dumonda

Ils controls vegnan generads dal schema dal model. Il code e ​​il pretsch s'actualiseschan durant che ti als midas.

•obligatori 88 / 32000

Prompt utilisà per generar maletgs.

•obligatori image_urls
Trametta in datoteca u · fin a 16

URLs da maletgs da referenza per la generaziun, limitadas a 16 maletgs.

image_size standard auto

Dimensiuns d’output, deducidas dals maletgs furnids sche 'auto' è tschernì.

num_images standard 1

Dumber da maletgs da producir.

Avanzà mask · background · quality · output_format · enable_safety_checker
mask_url
Trametta in datoteca u

URL per in maletg da mascrina che identifitgescha la regiun d'editto durant la generaziun.

background standard auto

Fund dal maletg resultant.

quality standard high

Selecziun da la qualitad dal maletg, inclus 'auto' per laschar il model tscherner la meglra qualitad tenor il prompt.

output_format standard png

Format da datoteca dals maletgs d'output.

POST /run/openai/gpt-image-2/edit?wait=20 calculaziun → $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"

Executar questa dumonda

Tia clav resta en quest browser: ella vegn tramessa mo al Doitong API e memorisada (localStorage) mo sch'ella scheccas Tiar a memoria. Obtegnair ina clav API

Davart GPT Image 2 API · Edit

Editegescha u cumpona maletgs da fin a 16 URLs en `image_urls`, guidà d'in prompt da fin a 32000 caracters. Ina `mask_url` limitescha l'editura ad ina regiun. `image_size` ha auto sco valur predefinida e deducescha la dimensiun da las entradas. La qualitad va da auto a high, cun fin a 4 outputs en png, jpeg u webp.

Parameters

Invia u il num canonic u il num nativ, betg omaduas. Nums canonics

NumTip StandardPermess Descripziun
promptobligatori
Tipstring
≤ 32 000 caracters≥ 2 caracters
Prompt utilisà per generar maletgs.
image_urlsobligatori images
Tipurl[] · image
≤ 16 elements
URLs da maletgs da referenza per la generaziun, limitadas a 16 maletgs.
image_sizeopziunal
Tipobject
Standardauto
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9auto
Dimensiuns d’output, deducidas dals maletgs furnids sche 'auto' è tschernì.
backgroundopziunal
Tipenum
Standardauto
autotransparentopaque
Fund dal maletg resultant.
qualityopziunal
Tipenum
Standardhigh
autolowmediumhigh
Selecziun da la qualitad dal maletg, inclus 'auto' per laschar il model tscherner la meglra qualitad tenor il prompt.
num_imagesopziunal num_outputs
Tipinteger
Standard1
1 – 4
Dumber da maletgs da producir.
output_formatopziunal
Tipenum
Standardpng
jpegpngwebp
Format da datoteca dals maletgs d'output.
enable_safety_checkeropziunal
Tipboolean
Standardtrue
La controlla po vegnir schluccada cun definir false, premess che l'appelant saja autorisà.
mask_urlopziunal mask
Tipurl · image
URL per in maletg da mascrina che identifitgescha la regiun d'editto durant la generaziun.
obligatori Num canonic, er acceptà

Ils parameters da datotecas acceptan ina URL publica https://, ina URI data: fin a 10 MB u il file_url d'ina chargiada. Datotecas

Output

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"
  }
}
Tias datotecas, tia decisiunMintga outputs[].url è ina copia en nossa memorisaziun: conservada per adina (pajà per GB-mes) u 7 dis gratuitamain, tenor la configuraziun dal conto u ?storage=.
La medema structura per mintga modeltype, url, content_type, width, height e duration, tant per maletgs sco per video e audio. output è l'object da resultat dal model sez.
Champs da l'output
images
array of object {url, content_type, file_name, file_size, width, height}Maletgs producids dal model.

Dapli models: Modificaziun da maletgs

Per agents AI: questa pagina sco Markdown è disponibla sut https://doitong.com/rm/developers/models/openai/gpt-image-2/edit.md. Tut ils models e las guidas: https://doitong.com/developers/llms.txt