class

OpenAI::Image

Inherits JSON::Serializable < Reference < Object

Represents the content or the URL of an image generated by the OpenAI API.

Constructors

new(b64_json : String | Nil = nil, url : String | Nil = nil, revised_prompt : String | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

b64_json

The base64-encoded JSON of the generated image. Default value for gpt-image-1, and only present if response_format is set to b64_json for dall-e-2 and dall-e-3.

Source
b64_json=(b64_json : String | Nil)

The base64-encoded JSON of the generated image. Default value for gpt-image-1, and only present if response_format is set to b64_json for dall-e-2 and dall-e-3.

Source
revised_prompt

For dall-e-3 only, the revised prompt that was used to generate the image.

Source
revised_prompt=(revised_prompt : String | Nil)

For dall-e-3 only, the revised prompt that was used to generate the image.

Source
url

When using dall-e-2 or dall-e-3, the URL of the generated image if response_format is set to url (default value). Unsupported for gpt-image-1.

Source
url=(url : String | Nil)

When using dall-e-2 or dall-e-3, the URL of the generated image if response_format is set to url (default value). Unsupported for gpt-image-1.

Source