v1

latestOpenAPI 3.1.0Apache-2.02026-07-13136499.6 KB
Images

Create image

This endpoint processes requests to generate images using AI models by forwarding them to the appropriate AI node. The request metadata and compute units have already been validated by middleware before reaching this handler.

Errors

  • Returns various status codes based on the underlying handle_image_generation_response:
    • INTERNAL_SERVER_ERROR - If there's an error communicating with the AI node
post/v1/images/generations

Request body

modelstring required

The model to use for image generation.

ninteger nullable

The number of images to generate. Defaults to 1.

promptstring required

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

qualitystring nullable

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

response_formatstring nullable

The format in which the generated images are returned.

sizestring nullable

The size of the generated images.

stylestring nullable

The style of the generated images.

userstring nullable

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

Example request

{
  "model": "black-forest-labs/FLUX.1-schnell",
  "n": 1,
  "prompt": "A cute baby sea otter floating on its back",
  "quality": "hd",
  "response_format": "url",
  "size": "1024x1024",
  "style": "vivid",
  "user": "user-1234"
}

Response

Image generations

createdinteger required

Example response

{
  "created": 1677649420,
  "data": [
    {
      "revised_prompt": "A stunning image of a baby sea otter floating on its back in crystal clear blue water, with gentle ripples surrounding it. The otter's fur appears soft and well-detailed, and its expression is peaceful and content.",
      "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/image.png"
    }
  ]
}