v1

latestOpenAPI 3.0.32026-07-132681171.6 KB

Create image

Generate images from a text prompt using image generation models

post/v1/images/generations

Request body

modelstring required

The model to use for image generation

promptstring required

A text description of the desired image

ninteger

The number of images to generate

size'1024x1024' | '1536x1024' | '1024x1536'

The size of the generated images

quality'auto' | 'high' | 'medium' | 'low'

The quality of the generated image

response_format'url' | 'b64_json'

The format in which the generated images are returned

background'auto' | 'transparent' | 'opaque'

The background type for the generated image

output_format'png' | 'jpeg' | 'webp'

The file format of the generated image

Example request

{
  "model": "azure/openai/gpt-image-1",
  "prompt": "A watercolor painting of a Japanese garden in autumn",
  "n": 1,
  "size": "1024x1024",
  "quality": "auto",
  "response_format": "url",
  "background": "auto",
  "output_format": "png"
}

Response

Image generation response

createdinteger required

The Unix timestamp of when the image was created

Example response

{
  "created": 1719000000
}