ImageGenerationRequest

@Serializable
data class ImageGenerationRequest(val prompt: String, val n: Int? = null, val size: ImageSize? = null, val user: String? = null, val model: ModelId, val quality: Quality? = null, val style: Style? = null, val background: ImageBackground? = null, val moderation: ImageModeration? = null, val outputCompression: Int? = null, val outputFormat: ImageOutputFormat? = null, val partialImages: Int? = null, val safetyIdentifier: String? = null)

Image generation request.

Constructors

Link copied to clipboard
constructor(prompt: String, n: Int? = null, size: ImageSize? = null, user: String? = null, model: ModelId, quality: Quality? = null, style: Style? = null, background: ImageBackground? = null, moderation: ImageModeration? = null, outputCompression: Int? = null, outputFormat: ImageOutputFormat? = null, partialImages: Int? = null, safetyIdentifier: String? = null)

Properties

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

Background transparency.

Link copied to clipboard
@SerialName(value = "model")
val model: ModelId

The image model. Supply an explicit current GPT Image model for generation.

Link copied to clipboard
@SerialName(value = "moderation")
val moderation: ImageModeration? = null

Image moderation level.

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

The number of images to generate. Must be between 1 and 10.

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

JPEG or WebP compression from 0 to 100.

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

Encoded image format.

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

Number of partial images requested during streaming, from 0 to 3.

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

A text description of the desired image(s). GPT Image accepts up to 32000 characters.

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

Image quality. Supported values depend on the chosen model.

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

Stable, non-identifying end-user identifier.

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

The size of the generated images.

Link copied to clipboard
@SerialName(value = "style")
val style: Style? = null

The style of the generated images. Must be one of Style.Vivid or [Style.Natural]. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for dall-e-3.

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

Deprecated end-user identifier; prefer safetyIdentifier.