ImageEvent

@Serializable
data class ImageEvent(val type: String, val b64JSON: String? = null, val partialImageIndex: Int? = null, val createdAt: Long? = null, val background: ImageBackground? = null, val outputFormat: ImageOutputFormat? = null, val quality: Quality? = null, val size: ImageSize? = null, val safetyIdentifier: String? = null, val usage: ImageUsage? = null, val error: OpenAIErrorDetails? = null, val code: String? = null, val message: String? = null, val param: String? = null)

A partial, completed, or error event from image generation/editing. Check type before reading fields.

Constructors

Link copied to clipboard
constructor(type: String, b64JSON: String? = null, partialImageIndex: Int? = null, createdAt: Long? = null, background: ImageBackground? = null, outputFormat: ImageOutputFormat? = null, quality: Quality? = null, size: ImageSize? = null, safetyIdentifier: String? = null, usage: ImageUsage? = null, error: OpenAIErrorDetails? = null, code: String? = null, message: String? = null, param: String? = null)

Properties

Link copied to clipboard
@SerialName(value = "b64_json")
val b64JSON: String? = null

Image data present on partial/completed events.

Link copied to clipboard
@SerialName(value = "background")
val background: ImageBackground? = null

Background of the output.

Link copied to clipboard
@SerialName(value = "code")
val code: String? = null

Error code on an error event.

Link copied to clipboard
@SerialName(value = "created_at")
val createdAt: Long? = null

Creation time in Unix seconds.

Link copied to clipboard
@SerialName(value = "error")
val error: OpenAIErrorDetails? = null

Nested service error, when supplied.

Link copied to clipboard
@SerialName(value = "message")
val message: String? = null

Error explanation on an error event.

Link copied to clipboard
@SerialName(value = "output_format")
val outputFormat: ImageOutputFormat? = null

Image encoding.

Link copied to clipboard
@SerialName(value = "param")
val param: String? = null

Invalid parameter on an error event.

Link copied to clipboard
@SerialName(value = "partial_image_index")
val partialImageIndex: Int? = null

Index of the partial image.

Link copied to clipboard
@SerialName(value = "quality")
val quality: Quality? = null

Effective quality.

Link copied to clipboard
@SerialName(value = "safety_identifier")
val safetyIdentifier: String? = null

Effective safety identifier.

Link copied to clipboard
@SerialName(value = "size")
val size: ImageSize? = null

Effective dimensions.

Link copied to clipboard
@SerialName(value = "type")
val type: String

Service event name, including image_generation/image_edit partial_image and completed variants.

Link copied to clipboard
@SerialName(value = "usage")
val usage: ImageUsage? = null

Final token accounting.