Skip to main content
POST
OpenAI SDK — images.generate (sync)

Authorizations

Authorization
string
header
required

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

Body

application/json
model
string
required
Example:

"gpt-image-2"

prompt
string
required
n
integer

Maps to num_images

size
string
Example:

"1024x1024"

quality
enum<string>
Available options:
low,
medium,
high
output_format
enum<string>
Available options:
png,
jpeg,
webp

Response

OpenAI ImagesResponse (data[].b64_json)

created
integer
data
object[]