Skip to content

Images

The Images API allows you to access DALL-E models for creating and modifying images.

  • Creating images
  • Analyzing images (Vision)
  • Create variations on an image
  • Perform inpainting
  • Perform outpainting

Config

A default config file is provided for Chat endpoints at config/prompts/images.yml.

There you can define:

  • The model and fallback models used by chat, eg dall-e-3
  • Options to pass to OpenAI, eg size or quality

Most image requests are quite simple so don’t need a lot of configuration.

File storage

One drawback of OpenAIs image APIs is that any images created by them are deleted after 1 hour. To counter this in StartKit.AI the image is automatically uploaded to S3 after it is returned by OpenAI, and the resulting image URL is returned instead.

You can disable this by passing upload: false to any of our image functions.

File uploads

To analyze an image with Vision, the AI needs access to an uploaded file. When the /api/images/detect endpoint is called, we upload the image directly to S3 and pass the resulting URL to OpenAI Vision automatically.

The other image endpoints require base64 encoded images to be passed, so these images are not stored.

Image sizes

OpenAIs image endpoints are very strict on the images that are sent to create variations, inpainting, and outpainting. They must be .png format, they must be square, and they must be below 4MB.