AigenwayDocumentation

OpenAI Images / DALL·E 2 / Text to image

openai_image/dall-e-2/text_to_image
Async

Generate an image from a text prompt (OpenAI Images API).

Parameters

NameTypeRequiredDescriptionAllowed valuesBundle dim.
modestringnoQuality tier. gpt-image-2 and gpt-image-1: low | medium | high | auto. dall-e-3: standard | hd. dall-e-2: ignored.auto, low, medium, high, standard, hd
stylestringnodall-e-3 only: rendering style.vivid, natural
promptstring
yes
Text prompt describing the desired output.
backgroundstringnogpt-image-1 / gpt-image-2 only: background handling.auto, transparent, opaque
resolutionstringnoOutput size. gpt-image-2: 1024x1024 | 1024x1536 | 1536x1024 | 2048x2048 | 3840x2160 | 2160x3840 | auto. gpt-image-1: 1024x1024 | 1024x1536 | 1536x1024 | auto. dall-e-3: 1024x1024 | 1024x1792 | 1792x1024. dall-e-2: 256x256 | 512x512 | 1024x1024.auto, 256x256, 512x512, 1024x1024, 1024x1536, 1536x1024, 1024x1792, 1792x1024, 2048x2048, 3840x2160, 2160x3840
aspect_ratiostringnoCosmetic; OpenAI selects rendering size from `resolution`.1:1, 3:4, 4:3, 9:16, 16:9
callback_urlstringnoWebhook URL invoked when async task completes.
images_countintegernoNumber of images to generate. dall-e-3 must be 1.

Example request

{
  "provider": "openai_image",
  "model": "dall-e-2",
  "method": "text_to_image",
  "params": {
    "mode": "medium",
    "prompt": "A studio-photo close-up of a glass of cold espresso, dramatic side lighting",
    "resolution": "1024x1024",
    "images_count": 1
  }
}

Example response

null
Pricing: see your dashboard (auth required).