Images

Image Generation

Generates images based on the prompt using OpenAI's image generation API.

post/v1/images/generations

Request

  • Base URL: https://apipie.ai
  • URL: https://apipie.ai/v1/images/generations
  • Auth: one of:
    • HTTP bearer
    • API key in header x-api-key

Request body

promptstring required

Text description of the desired image(s)

modelstring

The model to use for image generation

ninteger

The number of images to generate, we currently only support one at a time

sizestring

The size of the generated images

qualitystring

The quality of the image that will be generated

response_formatstring

The format in which the generated images are returned, we support either b64_json or "url"

stylestring

The style of the generated images the options are vivid and natural and does not apply to all providers

imagestring

The URL to an image you want the image model to update (Not supported by Dall-e-3)

seedinteger

A randomness initializer for image reproducibility. Check specific models for compatibility.

stepsinteger

Amount of computational iterations to run. More is typically higher quality. Check specific models for compatibility.

lorasstring[]

Augment the output with a LoRa model. Check specific models for compatibility.

strengthnumber

Controls the strength of the applied effect. Check specific models for compatibility.

aspect_ratio'9:21' | '21:9'

Aspect Ratio. Check specific models for compatibility.

Example request

{
  "prompt": "Its a picture of a dog, driving a car",
  "model": "dall-e-3",
  "n": 1,
  "size": "1024x1024 is supported by all models",
  "quality": "standard or hd",
  "response_format": "url",
  "style": "vivid",
  "image": "https://apipie.ai/temp/47g43g6f476vf.jpg"
}

Response

Result of the Image Generation

createdinteger required

UTC timestamp of when the image was created

Example response

{
  "data": [
    {
      "url": "https://...",
      "revised_prompt": "A labrador retriever with lush chocolate fur is driving a red 1974 Stingray and..."
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.