Package-level declarations

Types

Link copied to clipboard
@Serializable
value class ImageBackground(val value: String)

Background of a generated image. Arbitrary future values are accepted.

Link copied to clipboard
class ImageCreation(val prompt: String, val n: Int? = null, val size: ImageSize? = null, val user: String? = null, val model: ModelId? = null, val quality: Quality? = null, val style: Style? = null)

Image generation request.

Link copied to clipboard

Builder of ImageCreation instances.

Link copied to clipboard
class ImageEdit(val image: FileSource, val mask: FileSource, val prompt: String, val n: Int? = null, val size: ImageSize? = null, val user: String? = null, val model: ModelId? = null)

Image edit request.

Link copied to clipboard

Builder of ImageEdit instances.

Link copied to clipboard
@Serializable
data class ImageEditRequest(val images: List<ImageReference>, val prompt: String, val model: ModelId? = null, val n: Int? = null, val size: ImageSize? = null, val quality: Quality? = null, val inputFidelity: ImageInputFidelity? = null, val mask: ImageReference? = null, val markup: ImageReference? = 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, val user: String? = null)

Edits one to sixteen referenced images using the current JSON image API.

Link copied to clipboard
@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.

Link copied to clipboard
@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.

Link copied to clipboard
Link copied to clipboard
@Serializable
value class ImageInputFidelity(val value: String)

Fidelity to the input images on models supporting this control. Arbitrary future values are accepted.

Link copied to clipboard
@Serializable
data class ImageJSON(val b64JSON: String, val revisedPrompt: String? = null)

Generated image JSON (base 64).

Link copied to clipboard
@Serializable
value class ImageModeration(val value: String)

Moderation level for generated images. Arbitrary future values are accepted.

Link copied to clipboard
@Serializable
value class ImageOutputFormat(val value: String)

Encoding format of a generated image. Arbitrary future values are accepted.

Link copied to clipboard
@Serializable
class ImageReference

A source image referenced by exactly one uploaded file ID or URL/data URL.

Link copied to clipboard
@Serializable
data class ImageResponse(val created: Long, val data: List<ImageJSON> = emptyList(), val background: ImageBackground? = null, val outputFormat: ImageOutputFormat? = null, val quality: Quality? = null, val size: ImageSize? = null, val safetyIdentifier: String? = null, val usage: ImageUsage? = null)

Images and metadata returned by generation or editing.

Link copied to clipboard
@Serializable
value class ImageSize(val size: String)

The size of the generated images.

Link copied to clipboard
@Serializable
data class ImageTokenDetails(val textTokens: Int? = null, val imageTokens: Int? = null)

Token counts split by modality.

Link copied to clipboard
@Serializable
data class ImageURL(val url: String, val revisedPrompt: String? = null)

Generated image URL.

Link copied to clipboard
@Serializable
data class ImageUsage(val inputTokens: Int, val outputTokens: Int, val totalTokens: Int, val inputTokensDetails: ImageTokenDetails? = null, val outputTokensDetails: ImageTokenDetails? = null)

Token accounting for image generation or editing.

Link copied to clipboard
class ImageVariation(val image: FileSource, val n: Int? = null, val size: ImageSize? = null, val user: String? = null, val model: ModelId? = null)

Image variant request.

Link copied to clipboard

Builder of ImageVariation instances.

Link copied to clipboard
@Serializable
value class Quality(val value: String)

The quality of the image that will be generated

Link copied to clipboard
@Serializable
value class Style(val value: String)

The style of the generated images.

Functions

Link copied to clipboard

Image generation request.

Link copied to clipboard

Image edit request.

Link copied to clipboard

Image generation request.

Link copied to clipboard

Image variant request.