Native OpenAI Format
Generate Image
- Create an image from a given prompt. Learn more.
POST
Authorizations
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Body
string
default:"gpt-image-1.5"
Model used for image generation. One of
dall-e-2, dall-e-3, or gpt-image-1. Defaults to dall-e-2 unless a gpt-image-1-specific parameter is used.Example: gpt-image-1.5string
required
Text description of the desired image. The maximum length is 32,000 characters for
gpt-image-1, 1,000 characters for dall-e-2, and 4,000 characters for dall-e-3.integer
Number of images to generate. Must be between 1 and 10. For
dall-e-3, only n=1 is supported.string
Size of the generated image. For
gpt-image-1, it must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default). For dall-e-2, it must be one of 256x256, 512x512, or 1024x1024. For dall-e-3, it must be one of 1024x1024, 1792x1024, or 1024x1792.string
Allows setting background transparency for the generated image. This parameter is only supported by
gpt-image-1. Must be one of transparent, opaque, or auto (default). When using auto, the model automatically determines the best background for the image.If the background is transparent, the output format must support transparency, so set it to png (default) or webp.string
Controls the content moderation level for images generated by
gpt-image-1. Use low for less restrictive filtering or auto (default).string
The quality of the generated image.
string
string
string
Response
integer