Skip to content

Commit 085ea7d

Browse files
authored
docs: clarify image transparency and Realtime audio delta behavior (#918)
## Summary Updates Java SDK documentation to note that transparent backgrounds are in preview for gpt-image-2 and gpt-image-2-2026-04-21, with png or webp required for transparent output. Also clarifies that Realtime translation audio deltas contain variable-length PCM16 chunks that clients should decode and queue in full. No API signatures or runtime behavior change. Co-authored-by: apcha-oai <228803254+apcha-oai@users.noreply.github.com>
1 parent 715a304 commit 085ea7d

8 files changed

Lines changed: 146 additions & 224 deletions

File tree

‎.castiron.stats.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
schema_version: 1
2-
generation_id: 39f410ad-4a12-4b68-83fb-a8f8910269c3
3-
openapi_spec_hash: a85edbfc22ff719d064bce2705c7394e
4-
openapi_transformed_spec_hash: f8e7644df5aee22dfcd0ea2b70942054
5-
config_hash: 85382dd94c503b5d225adc7636a77c9f
6-
codegen_sha: 22efddac3ef54c84888af2bcaf836358ecc6c728
7-
codegen_hash: 2b381e76f9cb96c14cfaad5973e6f1bde237796fc22583eee2ed857e16587cb5
8-
public_codegen_sha: 073a9e1da881c9dce551ca447b52045c93ee161a
2+
generation_id: d8a1420b-a1ed-40ae-8675-e79d0e6fe5ce
3+
openapi_spec_hash: 92700e1a33a4f6174a01b46648c8186a
4+
openapi_transformed_spec_hash: e37bbe0f04caa6093f1cb5d65d23ad03
5+
config_hash: d13c582815d0db08c374985806be7352
6+
codegen_sha: 48b2b7ead2af6d92c34149aa44744f7e2ae4367a
7+
codegen_hash: f7d9f64ad58ebcf8291c4168c4322d6cc0c5ef1fe934f58dd7f785338920a919
8+
public_codegen_sha: ad61fb7c99fae3ed2d764fc4eb31db395ea44b33

‎api_reference/openapi.transformed.yml‎

Lines changed: 36 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -33071,18 +33071,14 @@ components:
3307133071
nullable: true
3307233072
description: |
3307333073
Allows to set transparency for the background of the generated image(s).
33074-
This parameter is only supported for GPT image models that support
33075-
transparent backgrounds. Must be one of `transparent`, `opaque`, or
33076-
`auto` (default value). When `auto` is used, the model will
33077-
automatically determine the best background for the image.
33078-
33079-
`gpt-image-2` and `gpt-image-2-2026-04-21` do not support
33080-
transparent backgrounds. Requests with `background` set to
33081-
`transparent` will return an error for these models; use `opaque` or
33082-
`auto` instead.
33083-
33084-
If `transparent`, the output format needs to support transparency,
33085-
so it should be set to either `png` (default value) or `webp`.
33074+
Must be one of `transparent`, `opaque`, or `auto` (default value). When
33075+
`auto` is used, the model will automatically determine the best
33076+
background for the image.
33077+
33078+
Transparent backgrounds are available for supported GPT Image models.
33079+
For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
33080+
preview. When using `transparent`, set the output format to `png` or
33081+
`webp`.
3308633082
model:
3308733083
anyOf:
3308833084
- type: string
@@ -33310,18 +33306,14 @@ components:
3331033306
nullable: true
3331133307
description: |
3331233308
Allows to set transparency for the background of the generated image(s).
33313-
This parameter is only supported for GPT image models that support
33314-
transparent backgrounds. Must be one of `transparent`, `opaque`, or
33315-
`auto` (default value). When `auto` is used, the model will
33316-
automatically determine the best background for the image.
33317-
33318-
`gpt-image-2` and `gpt-image-2-2026-04-21` do not support
33319-
transparent backgrounds. Requests with `background` set to
33320-
`transparent` will return an error for these models; use `opaque` or
33321-
`auto` instead.
33322-
33323-
If `transparent`, the output format needs to support transparency,
33324-
so it should be set to either `png` (default value) or `webp`.
33309+
Must be one of `transparent`, `opaque`, or `auto` (default value). When
33310+
`auto` is used, the model will automatically determine the best
33311+
background for the image.
33312+
33313+
Transparent backgrounds are available for supported GPT Image models.
33314+
For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
33315+
preview. When using `transparent`, set the output format to `png` or
33316+
`webp`.
3332533317
style:
3332633318
type: string
3332733319
enum:
@@ -35512,7 +35504,7 @@ components:
3551235504
- type: 'null'
3551335505
default: auto
3551435506
example: transparent
35515-
description: Background behavior for generated image output.
35507+
description: Set the background of the generated image output. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`.
3551635508
stream:
3551735509
anyOf:
3551835510
- type: boolean
@@ -39198,18 +39190,14 @@ components:
3919839190
- auto
3919939191
description: |
3920039192
Allows to set transparency for the background of the generated image(s).
39201-
This parameter is only supported for GPT image models that support
39202-
transparent backgrounds. Must be one of `transparent`, `opaque`, or
39203-
`auto` (default value). When `auto` is used, the model will
39204-
automatically determine the best background for the image.
39205-
39206-
`gpt-image-2` and `gpt-image-2-2026-04-21` do not support
39207-
transparent backgrounds. Requests with `background` set to
39208-
`transparent` will return an error for these models; use `opaque` or
39209-
`auto` instead.
39210-
39211-
If `transparent`, the output format needs to support transparency,
39212-
so it should be set to either `png` (default value) or `webp`.
39193+
Must be one of `transparent`, `opaque`, or `auto` (default value). When
39194+
`auto` is used, the model will automatically determine the best
39195+
background for the image.
39196+
39197+
Transparent backgrounds are available for supported GPT Image models.
39198+
For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
39199+
preview. When using `transparent`, set the output format to `png` or
39200+
`webp`.
3921339201
default: auto
3921439202
input_fidelity:
3921539203
anyOf:
@@ -51417,8 +51405,9 @@ components:
5141751405
RealtimeTranslationServerEventSessionOutputAudioDelta:
5141851406
type: object
5141951407
description: |
51420-
Returned when translated output audio is available. Output audio deltas are
51421-
200 ms frames of PCM16 audio.
51408+
Returned when translated output audio is available. The `delta` contains a
51409+
PCM16 audio chunk whose length can vary. Clients should decode and queue the
51410+
complete delta instead of assuming a fixed byte or sample count.
5142251411
properties:
5142351412
event_id:
5142451413
type: string
@@ -68577,18 +68566,14 @@ components:
6857768566
- auto
6857868567
description: |
6857968568
Allows to set transparency for the background of the generated image(s).
68580-
This parameter is only supported for GPT image models that support
68581-
transparent backgrounds. Must be one of `transparent`, `opaque`, or
68582-
`auto` (default value). When `auto` is used, the model will
68583-
automatically determine the best background for the image.
68584-
68585-
`gpt-image-2` and `gpt-image-2-2026-04-21` do not support
68586-
transparent backgrounds. Requests with `background` set to
68587-
`transparent` will return an error for these models; use `opaque` or
68588-
`auto` instead.
68589-
68590-
If `transparent`, the output format needs to support transparency,
68591-
so it should be set to either `png` (default value) or `webp`.
68569+
Must be one of `transparent`, `opaque`, or `auto` (default value). When
68570+
`auto` is used, the model will automatically determine the best
68571+
background for the image.
68572+
68573+
Transparent backgrounds are available for supported GPT Image models.
68574+
For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
68575+
preview. When using `transparent`, set the output format to `png` or
68576+
`webp`.
6859268577
default: auto
6859368578
input_fidelity:
6859468579
anyOf:

‎openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaTool.kt‎

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5110,17 +5110,13 @@ private constructor(
51105110
fun action(): Optional<Action> = action.getOptional("action")
51115111

51125112
/**
5113-
* Allows to set transparency for the background of the generated image(s). This parameter
5114-
* is only supported for GPT image models that support transparent backgrounds. Must be one
5115-
* of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model
5116-
* will automatically determine the best background for the image.
5113+
* Allows to set transparency for the background of the generated image(s). Must be one of
5114+
* `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will
5115+
* automatically determine the best background for the image.
51175116
*
5118-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds.
5119-
* Requests with `background` set to `transparent` will return an error for these models;
5120-
* use `opaque` or `auto` instead.
5121-
*
5122-
* If `transparent`, the output format needs to support transparency, so it should be set to
5123-
* either `png` (default value) or `webp`.
5117+
* Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2`
5118+
* and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set
5119+
* the output format to `png` or `webp`.
51245120
*
51255121
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
51265122
* server responded with an unexpected value).
@@ -5392,18 +5388,13 @@ private constructor(
53925388
fun action(action: JsonField<Action>) = apply { this.action = action }
53935389

53945390
/**
5395-
* Allows to set transparency for the background of the generated image(s). This
5396-
* parameter is only supported for GPT image models that support transparent
5397-
* backgrounds. Must be one of `transparent`, `opaque`, or `auto` (default value). When
5398-
* `auto` is used, the model will automatically determine the best background for the
5399-
* image.
5400-
*
5401-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds.
5402-
* Requests with `background` set to `transparent` will return an error for these
5403-
* models; use `opaque` or `auto` instead.
5391+
* Allows to set transparency for the background of the generated image(s). Must be one
5392+
* of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model
5393+
* will automatically determine the best background for the image.
54045394
*
5405-
* If `transparent`, the output format needs to support transparency, so it should be
5406-
* set to either `png` (default value) or `webp`.
5395+
* Transparent backgrounds are available for supported GPT Image models. For
5396+
* `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using
5397+
* `transparent`, set the output format to `png` or `webp`.
54075398
*/
54085399
fun background(background: Background) = background(JsonField.of(background))
54095400

@@ -5846,17 +5837,13 @@ private constructor(
58465837
}
58475838

58485839
/**
5849-
* Allows to set transparency for the background of the generated image(s). This parameter
5850-
* is only supported for GPT image models that support transparent backgrounds. Must be one
5851-
* of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model
5852-
* will automatically determine the best background for the image.
5853-
*
5854-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds.
5855-
* Requests with `background` set to `transparent` will return an error for these models;
5856-
* use `opaque` or `auto` instead.
5840+
* Allows to set transparency for the background of the generated image(s). Must be one of
5841+
* `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will
5842+
* automatically determine the best background for the image.
58575843
*
5858-
* If `transparent`, the output format needs to support transparency, so it should be set to
5859-
* either `png` (default value) or `webp`.
5844+
* Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2`
5845+
* and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set
5846+
* the output format to `png` or `webp`.
58605847
*/
58615848
class Background @JsonCreator private constructor(private val value: JsonField<String>) :
58625849
Enum {

‎openai-java-core/src/main/kotlin/com/openai/models/images/ImageEditParams.kt‎

Lines changed: 26 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,13 @@ private constructor(
6868
fun prompt(): String = body.prompt()
6969

7070
/**
71-
* Allows to set transparency for the background of the generated image(s). This parameter is
72-
* only supported for GPT image models that support transparent backgrounds. Must be one of
71+
* Allows to set transparency for the background of the generated image(s). Must be one of
7372
* `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will
7473
* automatically determine the best background for the image.
7574
*
76-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds. Requests
77-
* with `background` set to `transparent` will return an error for these models; use `opaque` or
78-
* `auto` instead.
79-
*
80-
* If `transparent`, the output format needs to support transparency, so it should be set to
81-
* either `png` (default value) or `webp`.
75+
* Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and
76+
* `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the
77+
* output format to `png` or `webp`.
8278
*
8379
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
8480
* server responded with an unexpected value).
@@ -423,17 +419,13 @@ private constructor(
423419
fun prompt(prompt: MultipartField<String>) = apply { body.prompt(prompt) }
424420

425421
/**
426-
* Allows to set transparency for the background of the generated image(s). This parameter
427-
* is only supported for GPT image models that support transparent backgrounds. Must be one
428-
* of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model
429-
* will automatically determine the best background for the image.
430-
*
431-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds.
432-
* Requests with `background` set to `transparent` will return an error for these models;
433-
* use `opaque` or `auto` instead.
422+
* Allows to set transparency for the background of the generated image(s). Must be one of
423+
* `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will
424+
* automatically determine the best background for the image.
434425
*
435-
* If `transparent`, the output format needs to support transparency, so it should be set to
436-
* either `png` (default value) or `webp`.
426+
* Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2`
427+
* and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set
428+
* the output format to `png` or `webp`.
437429
*/
438430
fun background(background: Background?) = apply { body.background(background) }
439431

@@ -930,17 +922,13 @@ private constructor(
930922
fun prompt(): String = prompt.value.getRequired("prompt")
931923

932924
/**
933-
* Allows to set transparency for the background of the generated image(s). This parameter
934-
* is only supported for GPT image models that support transparent backgrounds. Must be one
935-
* of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model
936-
* will automatically determine the best background for the image.
937-
*
938-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds.
939-
* Requests with `background` set to `transparent` will return an error for these models;
940-
* use `opaque` or `auto` instead.
925+
* Allows to set transparency for the background of the generated image(s). Must be one of
926+
* `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will
927+
* automatically determine the best background for the image.
941928
*
942-
* If `transparent`, the output format needs to support transparency, so it should be set to
943-
* either `png` (default value) or `webp`.
929+
* Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2`
930+
* and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set
931+
* the output format to `png` or `webp`.
944932
*
945933
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
946934
* server responded with an unexpected value).
@@ -1332,18 +1320,13 @@ private constructor(
13321320
fun prompt(prompt: MultipartField<String>) = apply { this.prompt = prompt }
13331321

13341322
/**
1335-
* Allows to set transparency for the background of the generated image(s). This
1336-
* parameter is only supported for GPT image models that support transparent
1337-
* backgrounds. Must be one of `transparent`, `opaque`, or `auto` (default value). When
1338-
* `auto` is used, the model will automatically determine the best background for the
1339-
* image.
1323+
* Allows to set transparency for the background of the generated image(s). Must be one
1324+
* of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model
1325+
* will automatically determine the best background for the image.
13401326
*
1341-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds.
1342-
* Requests with `background` set to `transparent` will return an error for these
1343-
* models; use `opaque` or `auto` instead.
1344-
*
1345-
* If `transparent`, the output format needs to support transparency, so it should be
1346-
* set to either `png` (default value) or `webp`.
1327+
* Transparent backgrounds are available for supported GPT Image models. For
1328+
* `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using
1329+
* `transparent`, set the output format to `png` or `webp`.
13471330
*/
13481331
fun background(background: Background?) = background(MultipartField.of(background))
13491332

@@ -1969,17 +1952,13 @@ private constructor(
19691952
}
19701953

19711954
/**
1972-
* Allows to set transparency for the background of the generated image(s). This parameter is
1973-
* only supported for GPT image models that support transparent backgrounds. Must be one of
1955+
* Allows to set transparency for the background of the generated image(s). Must be one of
19741956
* `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will
19751957
* automatically determine the best background for the image.
19761958
*
1977-
* `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds. Requests
1978-
* with `background` set to `transparent` will return an error for these models; use `opaque` or
1979-
* `auto` instead.
1980-
*
1981-
* If `transparent`, the output format needs to support transparency, so it should be set to
1982-
* either `png` (default value) or `webp`.
1959+
* Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and
1960+
* `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the
1961+
* output format to `png` or `webp`.
19831962
*/
19841963
class Background @JsonCreator private constructor(private val value: JsonField<String>) : Enum {
19851964

0 commit comments

Comments
 (0)