Request parameters for generating images using AI models
The model to use for image generation (e.g., "dall-e-2", "dall-e-3", "imagen-3.0-generate-001").
A text description of the desired image(s).
The background color to use for transparency. Defaults to "auto". OpenAI only.
The moderation level to apply to the generated image. OpenAI only.
The number of images to generate.
x >= 0The compression level for the output image, ranging from 0 to 100. Higher values mean more compression. OpenAI only.
x >= 0The format of the output image (e.g., "png", "jpeg"). OpenAI only.
The quality of the image that will be generated. "hd" creates images with finer details and greater consistency. Not supported for all models.
The format in which the generated images are returned. Must be one of "url" or "b64_json". URLs are only valid for 60 minutes after the image is generated.
The size of the generated images. Not supported for all models.
The style of the generated images. Must be one of "vivid" or "natural". Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. Not supported for all models.
Image generated successfully
Response from an image generation request
Array containing the generated image(s).
The background color used for transparency. OpenAI only.
The Unix timestamp (in seconds) of when the image was generated.
x >= 0The format of the output image. OpenAI only.
The quality setting used for image generation. OpenAI only.
The size of the generated image. OpenAI only.
Token usage information for the image generation request. OpenAI only.