Overview
Generate images from text prompts. Pure image generation models only (DALL-E, GPT Image). For multimodal models like gemini-2.5-flash-image, use/v1/chat/completions.
Method Signature
Parameters
A text description of the desired image(s). Maximum lengths:
gpt-image-1: 32000 charactersdall-e-2: 1000 charactersdall-e-3: 4000 characters
Set transparency for the background of generated images. Only supported for
gpt-image-1.Options: transparent, opaque, or auto (default)If transparent, the output format must support transparency (png or webp).The model to use for image generation:
openai/dall-e-2openai/dall-e-3openai/gpt-image-1
openai/dall-e-2 unless a parameter specific to gpt-image-1 is used.Content moderation level for
gpt-image-1 images. Options: low (less restrictive) or auto (default).Number of images to generate (1-10). For
dall-e-3, only n=1 is supported.Compression level (0-100%) for generated images. Only supported for
gpt-image-1 with webp or jpeg formats. Defaults to 100.Format for generated images. Only supported for
gpt-image-1. Options: png, jpeg, or webp.Number of partial images to generate for streaming (0-3). When set to 0, a single image is sent in one streaming event.The final image may be sent before all partial images are generated.
Image quality setting:
auto(default): Automatically select best quality for the modelhigh,medium,low: Supported forgpt-image-1hd,standard: Supported fordall-e-3standard: Only option fordall-e-2
Format for
dall-e-2 and dall-e-3 images: url or b64_json. URLs are valid for 60 minutes.Not supported for gpt-image-1 which always returns base64-encoded images.Size of generated images:
gpt-image-1:1024x1024,1536x1024(landscape),1024x1536(portrait), orauto(default)dall-e-2:256x256,512x512, or1024x1024dall-e-3:1024x1024,1792x1024, or1024x1792
Generate image in streaming mode. Defaults to
false. Only supported for gpt-image-1.Style of generated images. Only supported for
dall-e-3:vivid: Hyper-real and dramatic imagesnatural: More natural, less hyper-real images
Unique identifier for your end-user, for monitoring and abuse detection.
Response
Unix timestamp when the images were created.
List of generated images.