POST
/
v1
/
images
/
generations

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for image generation

model
string
required

The model to use for image generation.

prompt
string
required

A text description of the desired image(s). The maximum length is 1000 characters.

n
integer | null

The number of images to generate. Defaults to 1.

Required range: x > 0
quality
string | null

The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image.

response_format
string | null

The format in which the generated images are returned.

size
string | null

The size of the generated images.

style
string | null

The style of the generated images.

user
string | null

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

Response

200 - application/json

Response format for image generation

created
integer
required
data
object[]
required