v4

latestOpenAPI 3.1.02026-07-31155218294.8 KB
Image Generation

Openai Images Generations

Generate image using OpenAI Images API

post/v1/images/generations

Headers

xi-api-keystring nullable
x-api-keystring nullable

Request body

modelstring required

The model to use for image generation.

ninteger

The number of images to generate.

response_format'b64_json'
sizestring

The size of the generated images. Available sizes depend on the model.

userstring nullable

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

promptstring required

A text description of desired image(s).

qualitystring nullable

The quality of the image that will be generated.

stylestring nullable

The style of the generated images.

Example request

{
  "model": "black-forest-labs/FLUX-1-schnell",
  "prompt": "A photo of an astronaut riding a horse on Mars."
}

Response

Successful Response

createdinteger

Unix timestamp of when the images were created