Naar inhoud springen

GPT Image 2 API

Integreren

Model-ID 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"

Deze request: ≈$ 0,106 106 API-tegoed Op deze pagina uitvoeren

API-sleutel ophalen
OpenAI Tekst naar afbeelding #gpt-image-2#openai#typography#chatgpt-images-2

GPT Image 2 text-to-image met flexibele afmetingen tot 3840px per rand, gericht op verfijnde typografie

Gemaakt op Doitong

Openbare werken gemaakt met GPT Image 2 API door de Doitong-community. Gebruik een prompt opnieuw met één klik.

Getoonde openbare werken: 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,...

Een aanvraag samenstellen

Besturingselementen worden gegenereerd op basis van het modelschema. De code en de prijs worden bijgewerkt terwijl je ze wijzigt.

•verplicht 88 / 32000

Prompt die is gebruikt om afbeeldingen te genereren.

image_size standaard landscape_4_3

Uitvoerafmetingen accepteren een presetnaam, een object {width, height} of 'auto' voor de beste groottekeuze van het model. Alle concrete groottes vereisen dimensies die deelbaar zijn door 16, zijden van maximaal 3840px, een beeldverhouding van maximaal 3:1 en in totaal 655.360–8.294.400 pixels.

num_images standaard 1

Aantal te produceren afbeeldingen.

Geavanceerd background · quality · output_format · enable_safety_checker
background standaard auto

Achtergrond van de resulterende afbeelding.

quality standaard high

Selectie van afbeeldingskwaliteit, inclusief 'auto' voor een promptafhankelijke keuze van de beste kwaliteit door het model.

output_format standaard png

Bestandsindeling van de uitvoerafbeeldingen.

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

Deze request uitvoeren

Je sleutel blijft in deze browser: hij wordt alleen naar de Doitong API verzonden en alleen in localStorage opgeslagen als je Onthouden aanvinkt. API-sleutel ophalen

Over GPT Image 2 API

Genereert afbeeldingen uit een prompt van maximaal 32000 tekens. `image_size` accepteert voorinstellingen, auto of expliciete breedte en hoogte; beide dimensies moeten veelvouden van 16 zijn, met een maximale zijde van 3840px. De kwaliteit kan auto, low, medium of high zijn, met maximaal 4 afbeeldingen per request in png, jpeg of webp.

Parameters

Stuur de canonieke naam of de oorspronkelijke naam, niet beide. Canonieke namen

NaamType StandaardToegestaan Beschrijving
promptverplicht
Typestring
≤ 32.000 tekens≥ 2 tekens
Prompt die is gebruikt om afbeeldingen te genereren.
image_sizeoptioneel
Typeobject
Standaardlandscape_4_3
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9auto
Uitvoerafmetingen accepteren een presetnaam, een object {width, height} of 'auto' voor de beste groottekeuze van het model. Alle concrete groottes vereisen dimensies die deelbaar zijn door 16, zijden van maximaal 3840px, een beeldverhouding van maximaal 3:1 en in totaal 655.360–8.294.400 pixels.
backgroundoptioneel
Typeenum
Standaardauto
autotransparentopaque
Achtergrond van de resulterende afbeelding.
qualityoptioneel
Typeenum
Standaardhigh
autolowmediumhigh
Selectie van afbeeldingskwaliteit, inclusief 'auto' voor een promptafhankelijke keuze van de beste kwaliteit door het model.
num_imagesoptioneel num_outputs
Typeinteger
Standaard1
1 – 4
Aantal te produceren afbeeldingen.
output_formatoptioneel
Typeenum
Standaardpng
jpegpngwebp
Bestandsindeling van de uitvoerafbeeldingen.
enable_safety_checkeroptioneel
Typeboolean
Standaardtrue
Screening kan worden versoepeld door false in te stellen, mits de aanroeper is geautoriseerd.
verplicht Canonieke naam, ook geaccepteerd

Uitvoer

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"
  }
}
Jouw bestanden, jouw keuzeElke outputs[].url is een kopie in onze opslag: voor altijd bewaard (betaald per GB-maand) of 7 dagen gratis, volgens je accountinstelling of ?storage=.
Dezelfde structuur voor elk modeltype, url, content_type, width, height en duration, voor afbeeldingen, video en audio. output is het eigen resultaatobject van het model.
Velden van de uitvoer
images
array of object {url, content_type, file_name, file_size, width, height}Afbeeldingen die door het model zijn geproduceerd.

Meer modellen: Tekst naar afbeelding

Voor AI-agents: deze pagina als Markdown staat op https://doitong.com/nl/developers/models/openai/gpt-image-2.md. Alle modellen en handleidingen: https://doitong.com/developers/llms.txt