class

OpenAI::ImagesResponse

Inherits JSON::Serializable < Reference < Object

The response from the image generation endpoint.

Constructors

new(created : Int64 = 0, data : Array(Image) | Nil = nil, background : ImagesResponseBackground | Nil = nil, output_format : ImagesResponseOutputFormat | Nil = nil, size : ImagesResponseSize | Nil = nil, quality : ImagesResponseQuality | Nil = nil, usage : ImageGenUsage | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

background

The background parameter used for the image generation. Either transparent or opaque.

Source
background=(background : ImagesResponseBackground | Nil)

The background parameter used for the image generation. Either transparent or opaque.

Source
created

The Unix timestamp (in seconds) of when the image was created.

Source
created=(created : Int64)

The Unix timestamp (in seconds) of when the image was created.

Source
data

The list of generated images.

Source
data=(data : Array(Image) | Nil)

The list of generated images.

Source
output_format

The output format of the image generation. Either png, webp, or jpeg.

Source
output_format=(output_format : ImagesResponseOutputFormat | Nil)

The output format of the image generation. Either png, webp, or jpeg.

Source
quality

The quality of the image generated. Either low, medium, or high.

Source
quality=(quality : ImagesResponseQuality | Nil)

The quality of the image generated. Either low, medium, or high.

Source
size

The size of the image generated. Either 1024x1024, 1024x1536, or 1536x1024.

Source
size=(size : ImagesResponseSize | Nil)

The size of the image generated. Either 1024x1024, 1024x1536, or 1536x1024.

Source
usage
Source
usage=(usage : ImageGenUsage | Nil)
Source