Class BetaTool.ImageGeneration.Builder
-
- All Implemented Interfaces:
public final class BetaTool.ImageGeneration.BuilderA builder for ImageGeneration.
-
-
Method Summary
-
-
Method Detail
-
type
final BetaTool.ImageGeneration.Builder type(JsonValue type)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("image_generation")This method is primarily for setting the field to an undocumented or not yet supported value.
-
action
final BetaTool.ImageGeneration.Builder action(BetaTool.ImageGeneration.Action action)
Whether to generate a new image or edit an existing image. Default:
auto.
-
action
final BetaTool.ImageGeneration.Builder action(JsonField<BetaTool.ImageGeneration.Action> action)
Sets Builder.action to an arbitrary JSON value.
You should usually call Builder.action with a well-typed Action value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
background
final BetaTool.ImageGeneration.Builder background(BetaTool.ImageGeneration.Background background)
Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.
-
background
final BetaTool.ImageGeneration.Builder background(JsonField<BetaTool.ImageGeneration.Background> background)
Sets Builder.background to an arbitrary JSON value.
You should usually call Builder.background with a well-typed Background value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inputFidelity
final BetaTool.ImageGeneration.Builder inputFidelity(BetaTool.ImageGeneration.InputFidelity inputFidelity)
Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.
-
inputFidelity
final BetaTool.ImageGeneration.Builder inputFidelity(Optional<BetaTool.ImageGeneration.InputFidelity> inputFidelity)
Alias for calling Builder.inputFidelity with
inputFidelity.orElse(null).
-
inputFidelity
final BetaTool.ImageGeneration.Builder inputFidelity(JsonField<BetaTool.ImageGeneration.InputFidelity> inputFidelity)
Sets Builder.inputFidelity to an arbitrary JSON value.
You should usually call Builder.inputFidelity with a well-typed InputFidelity value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inputImageMask
final BetaTool.ImageGeneration.Builder inputImageMask(BetaTool.ImageGeneration.InputImageMask inputImageMask)
Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).
-
inputImageMask
final BetaTool.ImageGeneration.Builder inputImageMask(JsonField<BetaTool.ImageGeneration.InputImageMask> inputImageMask)
Sets Builder.inputImageMask to an arbitrary JSON value.
You should usually call Builder.inputImageMask with a well-typed InputImageMask value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final BetaTool.ImageGeneration.Builder model(BetaTool.ImageGeneration.Model model)
The image generation model to use. Default:
gpt-image-1.
-
model
final BetaTool.ImageGeneration.Builder model(JsonField<BetaTool.ImageGeneration.Model> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed Model value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final BetaTool.ImageGeneration.Builder model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed Model constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
moderation
final BetaTool.ImageGeneration.Builder moderation(BetaTool.ImageGeneration.Moderation moderation)
Moderation level for the generated image. Default:
auto.
-
moderation
final BetaTool.ImageGeneration.Builder moderation(JsonField<BetaTool.ImageGeneration.Moderation> moderation)
Sets Builder.moderation to an arbitrary JSON value.
You should usually call Builder.moderation with a well-typed Moderation value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
outputCompression
final BetaTool.ImageGeneration.Builder outputCompression(Long outputCompression)
Compression level for the output image. Default: 100.
-
outputCompression
final BetaTool.ImageGeneration.Builder outputCompression(JsonField<Long> outputCompression)
Sets Builder.outputCompression to an arbitrary JSON value.
You should usually call Builder.outputCompression with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
outputFormat
final BetaTool.ImageGeneration.Builder outputFormat(BetaTool.ImageGeneration.OutputFormat outputFormat)
The output format of the generated image. One of
png,webp, orjpeg. Default:png.
-
outputFormat
final BetaTool.ImageGeneration.Builder outputFormat(JsonField<BetaTool.ImageGeneration.OutputFormat> outputFormat)
Sets Builder.outputFormat to an arbitrary JSON value.
You should usually call Builder.outputFormat with a well-typed OutputFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
partialImages
final BetaTool.ImageGeneration.Builder partialImages(Long partialImages)
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
partialImages
final BetaTool.ImageGeneration.Builder partialImages(JsonField<Long> partialImages)
Sets Builder.partialImages to an arbitrary JSON value.
You should usually call Builder.partialImages with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
quality
final BetaTool.ImageGeneration.Builder quality(BetaTool.ImageGeneration.Quality quality)
The quality of the generated image. One of
low,medium,high, orauto. Default:auto.
-
quality
final BetaTool.ImageGeneration.Builder quality(JsonField<BetaTool.ImageGeneration.Quality> quality)
Sets Builder.quality to an arbitrary JSON value.
You should usually call Builder.quality with a well-typed Quality value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
size
final BetaTool.ImageGeneration.Builder size(BetaTool.ImageGeneration.Size size)
The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.
-
size
final BetaTool.ImageGeneration.Builder size(JsonField<BetaTool.ImageGeneration.Size> size)
Sets Builder.size to an arbitrary JSON value.
You should usually call Builder.size with a well-typed Size value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
size
final BetaTool.ImageGeneration.Builder size(String value)
Sets size to an arbitrary String.
You should usually call size with a well-typed Size constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final BetaTool.ImageGeneration.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final BetaTool.ImageGeneration.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final BetaTool.ImageGeneration.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final BetaTool.ImageGeneration.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final BetaTool.ImageGeneration.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final BetaTool.ImageGeneration build()
Returns an immutable instance of ImageGeneration.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-