View Source OpenAi.Images (OpenAI REST API Client v1.0.0)

Provides API endpoints related to images

Summary

Functions

Creates an image given a prompt. Learn more.

Creates an edited or extended image given one or more source images and a prompt. This endpoint only supports gpt-image-1 and dall-e-2.

Creates a variation of a given image. This endpoint only supports dall-e-2.

Functions

Link to this function

create_image(body, opts \\ [])

View Source
@spec create_image(body :: OpenAi.Image.CreateRequest.t(), opts :: keyword()) ::
  {:ok, OpenAi.Image.Response.t()} | {:error, OpenAi.Error.error()}

Creates an image given a prompt. Learn more.

Link to this function

create_image_edit(body, opts \\ [])

View Source
@spec create_image_edit(body :: OpenAi.Image.EditCreateRequest.t(), opts :: keyword()) ::
  {:ok, OpenAi.Image.Response.t()} | {:error, OpenAi.Error.error()}

Creates an edited or extended image given one or more source images and a prompt. This endpoint only supports gpt-image-1 and dall-e-2.

Link to this function

create_image_variation(body, opts \\ [])

View Source
@spec create_image_variation(
  body :: OpenAi.Image.VariationCreateRequest.t(),
  opts :: keyword()
) ::
  {:ok, OpenAi.Image.Response.t()} | {:error, OpenAi.Error.error()}

Creates a variation of a given image. This endpoint only supports dall-e-2.