diff --git a/.castiron.stats.yml b/.castiron.stats.yml index 9e8258a3d3..7ecbbca4e2 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: 7c85e3b8-1fd9-4422-9e62-0b845e4d0dd6 -openapi_spec_hash: 4e1ab2560f0c0f65641ea0a2d769a0d5 -openapi_transformed_spec_hash: 55e7b75c47c80e83f6e3c2970444e5ba -config_hash: dfe8a20c64cc5d852e69c441cbd28ae7 -codegen_sha: 1a2564e113780db175aecce7b826099172da9171 -codegen_hash: aee79621a90e3602ea790e7bc34cfc58368c4217f4d77921bc8960d65b4a8845 -public_codegen_sha: 5d5101490afb27fea944f63bc21b52140409bf4a +generation_id: c48dfb66-88a5-4465-96d1-0585b9ab8215 +openapi_spec_hash: 0ac5ea4ab2546a188a36a0d370367637 +openapi_transformed_spec_hash: 6be6c39576ec27111cab26c251d2ab65 +config_hash: d92ec885ac2a08b6a4c1ff90420f0327 +codegen_sha: 9a9f8502cf7f372b0bc13c052819b78d02991ca5 +codegen_hash: 82d1c3235b99cb90187912ae7dd653fba230efd59dbf3c947b6c522a1a801d85 +public_codegen_sha: db47bcd202616d35b583b2433270b565be76233a diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index dc2d4de4eb..1cc46fbb40 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -7792,7 +7792,7 @@ paths: tags: - Images summary: Create image edit - description: Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + description: Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. requestBody: required: true content: @@ -33170,13 +33170,15 @@ components: description: | The image(s) to edit. Must be a supported image file or an array of images. - For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, - `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, and - `chatgpt-image-latest`), each image should be a `png`, `webp`, or - `jpg` file less than 50MB. You can provide up to 16 images. + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image + should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to + 16 images. - For `dall-e-2`, you can only provide one image, and it should be a - square `png` file less than 4MB. + For `dall-e-2`, you can only provide one image, and it should be a square + `png` file less than 4MB. x-oaiMeta: exampleFilePath: otter.png prompt: @@ -33199,15 +33201,16 @@ components: example: transparent nullable: true description: | - Allows to set transparency for the background of the generated image(s). - Must be one of `transparent`, `opaque`, or `auto` (default value). When - `auto` is used, the model will automatically determine the best - background for the image. + Allows to set transparency for the background of the generated image(s). Must + be one of `transparent`, `opaque`, or `auto` (default value). When `auto` is + used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + 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`. model: anyOf: - type: string @@ -33217,12 +33220,16 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest - dall-e-2 x-stainless-const: true x-oaiTypeLabel: string - description: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. + description: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. nullable: true example: gpt-image-2 n: @@ -33244,7 +33251,7 @@ components: - 1536x1024 - 1024x1536 - auto - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. nullable: true response_format: type: string @@ -33303,12 +33310,14 @@ components: - low - medium - high + - xhigh + - max - auto default: auto example: high nullable: true description: | - The quality of the image that will be generated for GPT image models. Defaults to `auto`. + The quality of the image that will be generated for GPT image models. The GPT image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. Defaults to `auto`. required: - prompt - image @@ -33328,13 +33337,17 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest - dall-e-2 - dall-e-3 x-stainless-nominal: false x-oaiTypeLabel: string - description: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. + description: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. nullable: true example: gpt-image-2 n: @@ -33353,6 +33366,8 @@ components: - low - medium - high + - xhigh + - max - auto default: auto example: medium @@ -33360,8 +33375,11 @@ components: description: | The quality of the image that will be generated. - - `auto` (default value) will automatically select the best quality for the given model. + - `auto` (default value) will automatically select the best quality for the given + model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: @@ -33413,7 +33431,7 @@ components: - 512x512 - 1792x1024 - 1024x1792 - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. nullable: true moderation: type: string @@ -33434,15 +33452,16 @@ components: example: transparent nullable: true description: | - Allows to set transparency for the background of the generated image(s). - Must be one of `transparent`, `opaque`, or `auto` (default value). When - `auto` is used, the model will automatically determine the best - background for the image. + Allows to set transparency for the background of the generated image(s). Must + be one of `transparent`, `opaque`, or `auto` (default value). When `auto` is + used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + 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`. style: type: string enum: @@ -35529,6 +35548,10 @@ components: - gpt-image-1.5 - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1 - gpt-image-1-mini - chatgpt-image-latest @@ -35536,7 +35559,7 @@ components: x-oaiTypeLabel: string default: gpt-image-1.5 example: gpt-image-1.5 - description: The GPT image model to use for image editing, including `gpt-image-2` and its dated snapshot `gpt-image-2-2026-04-21`. + description: The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`. images: type: array minItems: 1 @@ -35570,12 +35593,16 @@ components: - low - medium - high + - xhigh + - max - auto - type: 'null' default: auto example: high description: | - Output quality for GPT image models. + Output quality for GPT image models. The GPT image models support `low`, `medium`, + and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. Defaults to `auto`. input_fidelity: anyOf: - type: string @@ -35586,6 +35613,7 @@ components: description: Controls fidelity to the original input image(s). This parameter is supported for GPT image models that support input fidelity. `gpt-image-2` and `gpt-image-2-2026-04-21` ignore this parameter. size: anyOf: + - type: string - type: string enum: - auto @@ -35595,7 +35623,7 @@ components: - type: 'null' default: auto example: 1024x1024 - description: Requested output image size. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. user: type: string example: user-1234 @@ -35641,7 +35669,7 @@ components: - type: 'null' default: auto example: transparent - 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`. + description: Set the background of the generated image output. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. 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`. stream: anyOf: - type: boolean @@ -38912,14 +38940,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the edited image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -38928,6 +38957,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -39000,14 +39031,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the requested edited image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -39016,6 +39048,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -39088,14 +39122,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the generated image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -39104,6 +39139,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -39176,14 +39213,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the requested image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -39192,6 +39230,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -39264,12 +39304,18 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest description: | The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: `gpt-image-1`. default: gpt-image-1 quality: @@ -39278,10 +39324,14 @@ components: - low - medium - high + - xhigh + - max - auto description: | - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The quality of the generated image. The GPT image models support `low`, + `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + including their `2026-09-08` snapshots, also support `xhigh` and `max`. + Default: `auto`. default: auto size: anyOf: @@ -39292,7 +39342,7 @@ components: - 1024x1536 - 1536x1024 - auto - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. default: auto output_format: type: string @@ -39326,15 +39376,16 @@ components: - opaque - auto description: | - Allows to set transparency for the background of the generated image(s). - Must be one of `transparent`, `opaque`, or `auto` (default value). When - `auto` is used, the model will automatically determine the best - background for the image. + Allows to set transparency for the background of the generated image(s). Must + be one of `transparent`, `opaque`, or `auto` (default value). When `auto` is + used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + 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`. default: auto input_fidelity: anyOf: @@ -39402,6 +39453,28 @@ components: description: | The generated image encoded in base64. - type: 'null' + size: + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - type: 'null' + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + quality: + anyOf: + - type: string + enum: + - low + - medium + - high + - xhigh + - max + - auto + - type: 'null' + description: The quality of the image generated by the image generation tool call. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. required: - type - id @@ -39461,19 +39534,23 @@ components: - webp - jpeg size: - type: string - description: The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string - description: The quality of the image generated. Either `low`, `medium`, or `high`. + description: The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or `max`. enum: - low - medium - high + - xhigh + - max usage: $ref: '#/components/schemas/ImageGenUsage' required: @@ -61679,8 +61756,8 @@ components: session_id: type: string description: | - The Transceiver `rtc_...` ID of the pending SIP session. The same - value appears as `call_id` in `realtime.call.incoming`. + The `live_...` ID of the pending SIP session. Forward this value + unchanged when accepting or rejecting the call through the Live API. sip_headers: type: array description: | @@ -61724,7 +61801,7 @@ components: "type": "live.call.incoming", "created_at": 1719168000, "data": { - "session_id": "rtc_479a275623b54bdb9b6fbae2f7cbd408", + "session_id": "live_u0_479a275623b54bdb9b6fbae2f7cbd408", "sip_headers": [ {"name": "Max-Forwards", "value": "63"}, {"name": "CSeq", "value": "851287 INVITE"}, @@ -61765,8 +61842,10 @@ components: call_id: type: string description: | - The Transceiver `rtc_...` ID of the pending SIP session. The same - value appears as `session_id` in `live.call.incoming`. + The Transceiver `rtc_...` ID of the pending SIP session. The paired + `live.call.incoming` event derives its `session_id` by replacing the + `rtc_` prefix with `live_`. Use the ID returned by the event with the + corresponding Realtime or Live API. sip_headers: type: array description: | @@ -66896,6 +66975,7 @@ components: - items: $ref: '#/components/schemas/InputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: @@ -66995,6 +67075,7 @@ components: - items: $ref: '#/components/schemas/InputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: @@ -68496,6 +68577,7 @@ components: - items: $ref: '#/components/schemas/BetaInputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: @@ -69613,12 +69695,18 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest description: | The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: `gpt-image-1`. default: gpt-image-1 quality: @@ -69627,10 +69715,14 @@ components: - low - medium - high + - xhigh + - max - auto description: | - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The quality of the generated image. The GPT image models support `low`, + `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + including their `2026-09-08` snapshots, also support `xhigh` and `max`. + Default: `auto`. default: auto size: anyOf: @@ -69641,7 +69733,7 @@ components: - 1024x1536 - 1536x1024 - auto - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. default: auto output_format: type: string @@ -69675,15 +69767,16 @@ components: - opaque - auto description: | - Allows to set transparency for the background of the generated image(s). - Must be one of `transparent`, `opaque`, or `auto` (default value). When - `auto` is used, the model will automatically determine the best - background for the image. + Allows to set transparency for the background of the generated image(s). Must + be one of `transparent`, `opaque`, or `auto` (default value). When `auto` is + used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + 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`. default: auto input_fidelity: anyOf: @@ -71691,6 +71784,28 @@ components: description: | The generated image encoded in base64. - type: 'null' + size: + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - type: 'null' + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + quality: + anyOf: + - type: string + enum: + - low + - medium + - high + - xhigh + - max + - auto + - type: 'null' + description: The quality of the image generated by the image generation tool call. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. required: - type - id @@ -73577,6 +73692,7 @@ components: - items: $ref: '#/components/schemas/BetaInputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: diff --git a/src/openai/resources/beta/responses/responses.py b/src/openai/resources/beta/responses/responses.py index e3c73c6be1..8f45bfdba7 100644 --- a/src/openai/resources/beta/responses/responses.py +++ b/src/openai/resources/beta/responses/responses.py @@ -4206,6 +4206,15 @@ async def recv_bytes(self) -> bytes: """ message = await self._connection.recv(decode=False) log.debug("Received WebSocket message: %i bytes", len(message)) + if self._reconnect_attempt: + # Account for raw application progress without changing frame delivery. + try: + event_data: object = json.loads(message) + except (ValueError, RecursionError): + return message + event_type = cast("dict[str, object]", event_data).get("type") if isinstance(event_data, dict) else None + if isinstance(event_type, str) and event_type and event_type != "error": + self._reconnect_attempt = 0 return message async def send(self, event: BetaResponsesClientEvent | BetaResponsesClientEventParam) -> None: @@ -4675,6 +4684,15 @@ def recv_bytes(self) -> bytes: """ message = self._connection.recv(decode=False) log.debug("Received WebSocket message: %i bytes", len(message)) + if self._reconnect_attempt: + # Account for raw application progress without changing frame delivery. + try: + event_data: object = json.loads(message) + except (ValueError, RecursionError): + return message + event_type = cast("dict[str, object]", event_data).get("type") if isinstance(event_data, dict) else None + if isinstance(event_type, str) and event_type and event_type != "error": + self._reconnect_attempt = 0 return message def send(self, event: BetaResponsesClientEvent | BetaResponsesClientEventParam) -> None: diff --git a/src/openai/resources/images.py b/src/openai/resources/images.py index 8081f3532c..62d00ef07b 100644 --- a/src/openai/resources/images.py +++ b/src/openai/resources/images.py @@ -139,7 +139,7 @@ def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -155,16 +155,17 @@ def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + This endpoint supports GPT Image models and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - 16 images. + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should + be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 + images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. @@ -176,9 +177,11 @@ def edit( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. input_fidelity: 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 @@ -192,7 +195,9 @@ def edit( model: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. n: The number of images to generate. Must be between 1 and 10. @@ -212,25 +217,28 @@ def edit( Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly. - quality: The quality of the image that will be generated for GPT image models. Defaults - to `auto`. + quality: The quality of the image that will be generated for GPT image models. The GPT + image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + `xhigh` and `max`. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) @@ -265,7 +273,7 @@ def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -280,16 +288,17 @@ def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + This endpoint supports GPT Image models and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - 16 images. + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should + be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 + images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. @@ -305,9 +314,11 @@ def edit( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. input_fidelity: 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 @@ -321,7 +332,9 @@ def edit( model: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. n: The number of images to generate. Must be between 1 and 10. @@ -341,25 +354,28 @@ def edit( Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly. - quality: The quality of the image that will be generated for GPT image models. Defaults - to `auto`. + quality: The quality of the image that will be generated for GPT image models. The GPT + image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + `xhigh` and `max`. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -390,7 +406,7 @@ def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -405,16 +421,17 @@ def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + This endpoint supports GPT Image models and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - 16 images. + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should + be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 + images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. @@ -430,9 +447,11 @@ def edit( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. input_fidelity: 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 @@ -446,7 +465,9 @@ def edit( model: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. n: The number of images to generate. Must be between 1 and 10. @@ -466,25 +487,28 @@ def edit( Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly. - quality: The quality of the image that will be generated for GPT image models. Defaults - to `auto`. + quality: The quality of the image that will be generated for GPT image models. The GPT + image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + `xhigh` and `max`. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -514,7 +538,7 @@ def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -583,7 +607,7 @@ def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, @@ -614,14 +638,18 @@ def generate( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - to the GPT image models is used. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + specific to the GPT image models is used. moderation: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default @@ -649,6 +677,8 @@ def generate( - `auto` (default value) will automatically select the best quality for the given model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. @@ -657,17 +687,18 @@ def generate( after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) @@ -705,7 +736,7 @@ def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, @@ -739,14 +770,18 @@ def generate( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - to the GPT image models is used. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + specific to the GPT image models is used. moderation: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default @@ -774,6 +809,8 @@ def generate( - `auto` (default value) will automatically select the best quality for the given model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. @@ -782,17 +819,18 @@ def generate( after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -826,7 +864,7 @@ def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, @@ -860,14 +898,18 @@ def generate( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - to the GPT image models is used. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + specific to the GPT image models is used. moderation: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default @@ -895,6 +937,8 @@ def generate( - `auto` (default value) will automatically select the best quality for the given model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. @@ -903,17 +947,18 @@ def generate( after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -946,7 +991,7 @@ def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, @@ -1114,7 +1159,7 @@ async def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -1130,16 +1175,17 @@ async def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + This endpoint supports GPT Image models and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - 16 images. + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should + be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 + images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. @@ -1151,9 +1197,11 @@ async def edit( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. input_fidelity: 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 @@ -1167,7 +1215,9 @@ async def edit( model: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. n: The number of images to generate. Must be between 1 and 10. @@ -1187,25 +1237,28 @@ async def edit( Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly. - quality: The quality of the image that will be generated for GPT image models. Defaults - to `auto`. + quality: The quality of the image that will be generated for GPT image models. The GPT + image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + `xhigh` and `max`. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) @@ -1240,7 +1293,7 @@ async def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -1255,16 +1308,17 @@ async def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + This endpoint supports GPT Image models and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - 16 images. + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should + be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 + images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. @@ -1280,9 +1334,11 @@ async def edit( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. input_fidelity: 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 @@ -1296,7 +1352,9 @@ async def edit( model: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. n: The number of images to generate. Must be between 1 and 10. @@ -1316,25 +1374,28 @@ async def edit( Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly. - quality: The quality of the image that will be generated for GPT image models. Defaults - to `auto`. + quality: The quality of the image that will be generated for GPT image models. The GPT + image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + `xhigh` and `max`. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -1365,7 +1426,7 @@ async def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -1380,16 +1441,17 @@ async def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + This endpoint supports GPT Image models and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - 16 images. + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should + be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 + images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. @@ -1405,9 +1467,11 @@ async def edit( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. input_fidelity: 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 @@ -1421,7 +1485,9 @@ async def edit( model: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. n: The number of images to generate. Must be between 1 and 10. @@ -1441,25 +1507,28 @@ async def edit( Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly. - quality: The quality of the image that will be generated for GPT image models. Defaults - to `auto`. + quality: The quality of the image that will be generated for GPT image models. The GPT + image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + `xhigh` and `max`. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -1489,7 +1558,7 @@ async def edit( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] | Omit = omit, @@ -1558,7 +1627,7 @@ async def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, @@ -1589,14 +1658,18 @@ async def generate( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - to the GPT image models is used. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + specific to the GPT image models is used. moderation: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default @@ -1624,6 +1697,8 @@ async def generate( - `auto` (default value) will automatically select the best quality for the given model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. @@ -1632,17 +1707,18 @@ async def generate( after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) @@ -1680,7 +1756,7 @@ async def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, @@ -1714,14 +1790,18 @@ async def generate( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - to the GPT image models is used. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + specific to the GPT image models is used. moderation: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default @@ -1749,6 +1829,8 @@ async def generate( - `auto` (default value) will automatically select the best quality for the given model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. @@ -1757,17 +1839,18 @@ async def generate( after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -1801,7 +1884,7 @@ async def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, @@ -1835,14 +1918,18 @@ async def generate( one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - to the GPT image models is used. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + specific to the GPT image models is used. moderation: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default @@ -1870,6 +1957,8 @@ async def generate( - `auto` (default value) will automatically select the best quality for the given model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. @@ -1878,17 +1967,18 @@ async def generate( after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images. - size: The size of the generated images. For `gpt-image-2` and - `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - strings, for example `1536x864`. Width and height must both be divisible by 16 - and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - `2560x1440` are experimental, and the maximum supported resolution is - `3840x2160`. The requested size must also satisfy the model's current pixel and - edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - supported by the GPT image models; `auto` is supported for models that allow - automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - `1024x1792`. + size: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + Width and height must both be divisible by 16 and the requested aspect ratio + must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + the maximum supported resolution is `3840x2160`. The requested size must also + satisfy the model's current pixel and edge limits. The standard sizes + `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + `1024x1024`, `1792x1024`, or `1024x1792`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -1921,7 +2011,7 @@ async def generate( output_compression: Optional[int] | Omit = omit, output_format: Optional[Literal["png", "jpeg", "webp"]] | Omit = omit, partial_images: Optional[int] | Omit = omit, - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] | Omit = omit, + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] | Omit = omit, response_format: Optional[Literal["url", "b64_json"]] | Omit = omit, size: Union[ str, diff --git a/src/openai/resources/realtime/realtime.py b/src/openai/resources/realtime/realtime.py index 9b96fb546e..f94000c978 100644 --- a/src/openai/resources/realtime/realtime.py +++ b/src/openai/resources/realtime/realtime.py @@ -352,6 +352,15 @@ async def recv_bytes(self) -> bytes: """ message = await self._connection.recv(decode=False) log.debug("Received WebSocket message: %i bytes", len(message)) + if self._reconnect_attempt: + # Account for raw application progress without changing frame delivery. + try: + event_data: object = json.loads(message) + except (ValueError, RecursionError): + return message + event_type = cast("dict[str, object]", event_data).get("type") if isinstance(event_data, dict) else None + if isinstance(event_type, str) and event_type and event_type != "error": + self._reconnect_attempt = 0 return message async def send(self, event: RealtimeClientEvent | RealtimeClientEventParam) -> None: @@ -846,6 +855,15 @@ def recv_bytes(self) -> bytes: """ message = self._connection.recv(decode=False) log.debug("Received WebSocket message: %i bytes", len(message)) + if self._reconnect_attempt: + # Account for raw application progress without changing frame delivery. + try: + event_data: object = json.loads(message) + except (ValueError, RecursionError): + return message + event_type = cast("dict[str, object]", event_data).get("type") if isinstance(event_data, dict) else None + if isinstance(event_type, str) and event_type and event_type != "error": + self._reconnect_attempt = 0 return message def send(self, event: RealtimeClientEvent | RealtimeClientEventParam) -> None: diff --git a/src/openai/resources/responses/responses.py b/src/openai/resources/responses/responses.py index 4db05d4443..1cb35e2371 100644 --- a/src/openai/resources/responses/responses.py +++ b/src/openai/resources/responses/responses.py @@ -4093,6 +4093,15 @@ async def recv_bytes(self) -> bytes: """ message = await self._connection.recv(decode=False) log.debug("Received WebSocket message: %i bytes", len(message)) + if self._reconnect_attempt: + # Account for raw application progress without changing frame delivery. + try: + event_data: object = json.loads(message) + except (ValueError, RecursionError): + return message + event_type = cast("dict[str, object]", event_data).get("type") if isinstance(event_data, dict) else None + if isinstance(event_type, str) and event_type and event_type != "error": + self._reconnect_attempt = 0 return message async def send(self, event: ResponsesClientEvent | ResponsesClientEventParam) -> None: @@ -4562,6 +4571,15 @@ def recv_bytes(self) -> bytes: """ message = self._connection.recv(decode=False) log.debug("Received WebSocket message: %i bytes", len(message)) + if self._reconnect_attempt: + # Account for raw application progress without changing frame delivery. + try: + event_data: object = json.loads(message) + except (ValueError, RecursionError): + return message + event_type = cast("dict[str, object]", event_data).get("type") if isinstance(event_data, dict) else None + if isinstance(event_type, str) and event_type and event_type != "error": + self._reconnect_attempt = 0 return message def send(self, event: ResponsesClientEvent | ResponsesClientEventParam) -> None: diff --git a/src/openai/types/beta/beta_response_input_item.py b/src/openai/types/beta/beta_response_input_item.py index a424d1283c..ae776df388 100644 --- a/src/openai/types/beta/beta_response_input_item.py +++ b/src/openai/types/beta/beta_response_input_item.py @@ -515,6 +515,15 @@ class ImageGenerationCall(BaseModel): agent: Optional[ImageGenerationCallAgent] = None """The agent that produced this item.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(BaseModel): """Execute a shell command on the server.""" diff --git a/src/openai/types/beta/beta_response_input_item_param.py b/src/openai/types/beta/beta_response_input_item_param.py index 061d8cd0d5..fe114e9ed9 100644 --- a/src/openai/types/beta/beta_response_input_item_param.py +++ b/src/openai/types/beta/beta_response_input_item_param.py @@ -514,6 +514,15 @@ class ImageGenerationCall(TypedDict, total=False): agent: Optional[ImageGenerationCallAgent] """The agent that produced this item.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(TypedDict, total=False): """Execute a shell command on the server.""" diff --git a/src/openai/types/beta/beta_response_input_param.py b/src/openai/types/beta/beta_response_input_param.py index 00378ab213..471ce35136 100644 --- a/src/openai/types/beta/beta_response_input_param.py +++ b/src/openai/types/beta/beta_response_input_param.py @@ -515,6 +515,15 @@ class ImageGenerationCall(TypedDict, total=False): agent: Optional[ImageGenerationCallAgent] """The agent that produced this item.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(TypedDict, total=False): """Execute a shell command on the server.""" diff --git a/src/openai/types/beta/beta_response_item.py b/src/openai/types/beta/beta_response_item.py index 52bbf71da7..35da9e3e5f 100644 --- a/src/openai/types/beta/beta_response_item.py +++ b/src/openai/types/beta/beta_response_item.py @@ -354,6 +354,15 @@ class ImageGenerationCall(BaseModel): agent: Optional[ImageGenerationCallAgent] = None """The agent that produced this item.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(BaseModel): """Execute a shell command on the server.""" diff --git a/src/openai/types/beta/beta_response_output_item.py b/src/openai/types/beta/beta_response_output_item.py index 5c52f5e19a..4f41ed3423 100644 --- a/src/openai/types/beta/beta_response_output_item.py +++ b/src/openai/types/beta/beta_response_output_item.py @@ -352,6 +352,15 @@ class ImageGenerationCall(BaseModel): agent: Optional[ImageGenerationCallAgent] = None """The agent that produced this item.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(BaseModel): """Execute a shell command on the server.""" diff --git a/src/openai/types/beta/beta_tool.py b/src/openai/types/beta/beta_tool.py index faa0ed24ee..68f79d83a1 100644 --- a/src/openai/types/beta/beta_tool.py +++ b/src/openai/types/beta/beta_tool.py @@ -261,14 +261,17 @@ class ImageGeneration(BaseModel): """Whether to generate a new image or edit an existing image. Default: `auto`.""" background: Optional[Literal["transparent", "opaque", "auto"]] = None - """ - Allows to set transparency for the background of the generated image(s). Must be - one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, - the model will automatically determine the best background for the image. + """Allows to set transparency for the background of the generated image(s). + + Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` + is used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. """ input_fidelity: Optional[Literal["high", "low"]] = None @@ -292,6 +295,10 @@ class ImageGeneration(BaseModel): "gpt-image-1-mini", "gpt-image-2", "gpt-image-2-2026-04-21", + "gpt-image-2.5-sunburst", + "gpt-image-2.5-sunburst-2026-09-08", + "gpt-image-2.5-flare", + "gpt-image-2.5-flare-2026-09-08", "gpt-image-1.5", "chatgpt-image-latest", ], @@ -300,7 +307,10 @@ class ImageGeneration(BaseModel): """The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: `gpt-image-1`. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: + `gpt-image-1`. """ moderation: Optional[Literal["auto", "low"]] = None @@ -321,25 +331,29 @@ class ImageGeneration(BaseModel): to 3. """ - quality: Optional[Literal["low", "medium", "high", "auto"]] = None + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None """The quality of the generated image. - One of `low`, `medium`, `high`, or `auto`. Default: `auto`. + The GPT image models support `low`, `medium`, and `high`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, also support `xhigh` and `max`. Default: `auto`. """ size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"], None] = None """The size of the generated images. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are - supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height - must both be divisible by 16 and the requested aspect ratio must be between 1:3 - and 3:1. Resolutions above `2560x1440` are experimental, and the maximum - supported resolution is `3840x2160`. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes `1024x1024`, - `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, use one of - `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, - `1792x1024`, or `1024x1792`. + For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and + `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be + divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above `2560x1440` are experimental, and the maximum supported + resolution is `3840x2160`. The requested size must also satisfy the model's + current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + `1024x1536` are supported by the GPT image models; `auto` is supported for + models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, + or `1024x1792`. """ diff --git a/src/openai/types/beta/beta_tool_param.py b/src/openai/types/beta/beta_tool_param.py index 86527185d2..9590d1aa92 100644 --- a/src/openai/types/beta/beta_tool_param.py +++ b/src/openai/types/beta/beta_tool_param.py @@ -260,14 +260,17 @@ class ImageGeneration(TypedDict, total=False): """Whether to generate a new image or edit an existing image. Default: `auto`.""" background: Literal["transparent", "opaque", "auto"] - """ - Allows to set transparency for the background of the generated image(s). Must be - one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, - the model will automatically determine the best background for the image. + """Allows to set transparency for the background of the generated image(s). + + Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` + is used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. """ input_fidelity: Optional[Literal["high", "low"]] @@ -291,6 +294,10 @@ class ImageGeneration(TypedDict, total=False): "gpt-image-1-mini", "gpt-image-2", "gpt-image-2-2026-04-21", + "gpt-image-2.5-sunburst", + "gpt-image-2.5-sunburst-2026-09-08", + "gpt-image-2.5-flare", + "gpt-image-2.5-flare-2026-09-08", "gpt-image-1.5", "chatgpt-image-latest", ], @@ -298,7 +305,10 @@ class ImageGeneration(TypedDict, total=False): """The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: `gpt-image-1`. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: + `gpt-image-1`. """ moderation: Literal["auto", "low"] @@ -319,25 +329,29 @@ class ImageGeneration(TypedDict, total=False): to 3. """ - quality: Literal["low", "medium", "high", "auto"] + quality: Literal["low", "medium", "high", "xhigh", "max", "auto"] """The quality of the generated image. - One of `low`, `medium`, `high`, or `auto`. Default: `auto`. + The GPT image models support `low`, `medium`, and `high`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, also support `xhigh` and `max`. Default: `auto`. """ size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] """The size of the generated images. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are - supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height - must both be divisible by 16 and the requested aspect ratio must be between 1:3 - and 3:1. Resolutions above `2560x1440` are experimental, and the maximum - supported resolution is `3840x2160`. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes `1024x1024`, - `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, use one of - `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, - `1792x1024`, or `1024x1792`. + For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and + `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be + divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above `2560x1440` are experimental, and the maximum supported + resolution is `3840x2160`. The requested size must also satisfy the model's + current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + `1024x1536` are supported by the GPT image models; `auto` is supported for + models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, + or `1024x1792`. """ diff --git a/src/openai/types/conversations/conversation_item.py b/src/openai/types/conversations/conversation_item.py index 16114d2df6..f3e6eb7b0c 100644 --- a/src/openai/types/conversations/conversation_item.py +++ b/src/openai/types/conversations/conversation_item.py @@ -59,6 +59,15 @@ class ImageGenerationCall(BaseModel): type: Literal["image_generation_call"] """The type of the image generation call. Always `image_generation_call`.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class AdditionalTools(BaseModel): id: str diff --git a/src/openai/types/image_edit_completed_event.py b/src/openai/types/image_edit_completed_event.py index 0b1f7fab69..ceee34cc11 100644 --- a/src/openai/types/image_edit_completed_event.py +++ b/src/openai/types/image_edit_completed_event.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. +from typing import Union from typing_extensions import Literal from .._models import BaseModel @@ -50,11 +51,11 @@ class ImageEditCompletedEvent(BaseModel): output_format: Literal["png", "webp", "jpeg"] """The output format for the edited image.""" - quality: Literal["low", "medium", "high", "auto"] + quality: Literal["low", "medium", "high", "xhigh", "max", "auto"] """The quality setting for the edited image.""" - size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"] - """The size of the edited image.""" + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" type: Literal["image_edit.completed"] """The type of the event. Always `image_edit.completed`.""" diff --git a/src/openai/types/image_edit_params.py b/src/openai/types/image_edit_params.py index 2f691d2795..e8420fc590 100644 --- a/src/openai/types/image_edit_params.py +++ b/src/openai/types/image_edit_params.py @@ -16,9 +16,11 @@ class ImageEditParamsBase(TypedDict, total=False): """The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - 16 images. + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should + be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 + images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. @@ -32,14 +34,17 @@ class ImageEditParamsBase(TypedDict, total=False): """ background: Optional[Literal["transparent", "opaque", "auto"]] - """ - Allows to set transparency for the background of the generated image(s). Must be - one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, - the model will automatically determine the best background for the image. + """Allows to set transparency for the background of the generated image(s). + + Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` + is used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. """ input_fidelity: Optional[Literal["high", "low"]] @@ -62,7 +67,9 @@ class ImageEditParamsBase(TypedDict, total=False): """The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, - `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. """ @@ -94,10 +101,12 @@ class ImageEditParamsBase(TypedDict, total=False): are generated if the full image is generated more quickly. """ - quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] + quality: Optional[Literal["standard", "low", "medium", "high", "xhigh", "max", "auto"]] """The quality of the image that will be generated for GPT image models. - Defaults to `auto`. + The GPT image models support `low`, `medium`, and `high`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, also support `xhigh` and `max`. Defaults to `auto`. """ response_format: Optional[Literal["url", "b64_json"]] @@ -112,16 +121,18 @@ class ImageEditParamsBase(TypedDict, total=False): size: Union[str, Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"], None] """The size of the generated images. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are - supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height - must both be divisible by 16 and the requested aspect ratio must be between 1:3 - and 3:1. Resolutions above `2560x1440` are experimental, and the maximum - supported resolution is `3840x2160`. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes `1024x1024`, - `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, use one of - `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, - `1792x1024`, or `1024x1792`. + For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and + `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be + divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above `2560x1440` are experimental, and the maximum supported + resolution is `3840x2160`. The requested size must also satisfy the model's + current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + `1024x1536` are supported by the GPT image models; `auto` is supported for + models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, + or `1024x1792`. """ user: str diff --git a/src/openai/types/image_edit_partial_image_event.py b/src/openai/types/image_edit_partial_image_event.py index e25691bbed..acdd5c87e8 100644 --- a/src/openai/types/image_edit_partial_image_event.py +++ b/src/openai/types/image_edit_partial_image_event.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. +from typing import Union from typing_extensions import Literal from .._models import BaseModel @@ -25,11 +26,11 @@ class ImageEditPartialImageEvent(BaseModel): partial_image_index: int """0-based index for the partial image (streaming).""" - quality: Literal["low", "medium", "high", "auto"] + quality: Literal["low", "medium", "high", "xhigh", "max", "auto"] """The quality setting for the requested edited image.""" - size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"] - """The size of the requested edited image.""" + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" type: Literal["image_edit.partial_image"] """The type of the event. Always `image_edit.partial_image`.""" diff --git a/src/openai/types/image_gen_completed_event.py b/src/openai/types/image_gen_completed_event.py index c97700724a..23a10ee818 100644 --- a/src/openai/types/image_gen_completed_event.py +++ b/src/openai/types/image_gen_completed_event.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. +from typing import Union from typing_extensions import Literal from .._models import BaseModel @@ -50,11 +51,11 @@ class ImageGenCompletedEvent(BaseModel): output_format: Literal["png", "webp", "jpeg"] """The output format for the generated image.""" - quality: Literal["low", "medium", "high", "auto"] + quality: Literal["low", "medium", "high", "xhigh", "max", "auto"] """The quality setting for the generated image.""" - size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"] - """The size of the generated image.""" + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" type: Literal["image_generation.completed"] """The type of the event. Always `image_generation.completed`.""" diff --git a/src/openai/types/image_gen_partial_image_event.py b/src/openai/types/image_gen_partial_image_event.py index 73027d0a0e..4ddeb4ad09 100644 --- a/src/openai/types/image_gen_partial_image_event.py +++ b/src/openai/types/image_gen_partial_image_event.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. +from typing import Union from typing_extensions import Literal from .._models import BaseModel @@ -25,11 +26,11 @@ class ImageGenPartialImageEvent(BaseModel): partial_image_index: int """0-based index for the partial image (streaming).""" - quality: Literal["low", "medium", "high", "auto"] + quality: Literal["low", "medium", "high", "xhigh", "max", "auto"] """The quality setting for the requested image.""" - size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"] - """The size of the requested image.""" + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" type: Literal["image_generation.partial_image"] """The type of the event. Always `image_generation.partial_image`.""" diff --git a/src/openai/types/image_generate_params.py b/src/openai/types/image_generate_params.py index 59cf4c191f..9a87bc87da 100644 --- a/src/openai/types/image_generate_params.py +++ b/src/openai/types/image_generate_params.py @@ -19,23 +19,27 @@ class ImageGenerateParamsBase(TypedDict, total=False): """ background: Optional[Literal["transparent", "opaque", "auto"]] - """ - Allows to set transparency for the background of the generated image(s). Must be - one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, - the model will automatically determine the best background for the image. + """Allows to set transparency for the background of the generated image(s). + + Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` + is used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. """ model: Union[str, ImageModel, None] """The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, - `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, or - `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific to - the GPT image models is used. + `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` + unless a parameter specific to the GPT image models is used. """ moderation: Optional[Literal["low", "auto"]] @@ -76,12 +80,14 @@ class ImageGenerateParamsBase(TypedDict, total=False): are generated if the full image is generated more quickly. """ - quality: Optional[Literal["standard", "hd", "low", "medium", "high", "auto"]] + quality: Optional[Literal["standard", "hd", "low", "medium", "high", "xhigh", "max", "auto"]] """The quality of the image that will be generated. - `auto` (default value) will automatically select the best quality for the given model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. """ @@ -102,16 +108,18 @@ class ImageGenerateParamsBase(TypedDict, total=False): ] """The size of the generated images. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are - supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height - must both be divisible by 16 and the requested aspect ratio must be between 1:3 - and 3:1. Resolutions above `2560x1440` are experimental, and the maximum - supported resolution is `3840x2160`. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes `1024x1024`, - `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, use one of - `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, - `1792x1024`, or `1024x1792`. + For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and + `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be + divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above `2560x1440` are experimental, and the maximum supported + resolution is `3840x2160`. The requested size must also satisfy the model's + current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + `1024x1536` are supported by the GPT image models; `auto` is supported for + models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, + or `1024x1792`. """ style: Optional[Literal["vivid", "natural"]] diff --git a/src/openai/types/image_model.py b/src/openai/types/image_model.py index 42f4e16609..21a2f2bb97 100644 --- a/src/openai/types/image_model.py +++ b/src/openai/types/image_model.py @@ -9,6 +9,10 @@ "gpt-image-1-mini", "gpt-image-2", "gpt-image-2-2026-04-21", + "gpt-image-2.5-sunburst", + "gpt-image-2.5-sunburst-2026-09-08", + "gpt-image-2.5-flare", + "gpt-image-2.5-flare-2026-09-08", "gpt-image-1.5", "chatgpt-image-latest", "dall-e-2", diff --git a/src/openai/types/images_response.py b/src/openai/types/images_response.py index 3c06e1b750..ea8d4be977 100644 --- a/src/openai/types/images_response.py +++ b/src/openai/types/images_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from typing_extensions import Literal from .image import Image @@ -66,14 +66,14 @@ class ImagesResponse(BaseModel): output_format: Optional[Literal["png", "webp", "jpeg"]] = None """The output format of the image generation. Either `png`, `webp`, or `jpeg`.""" - quality: Optional[Literal["low", "medium", "high"]] = None - """The quality of the image generated. Either `low`, `medium`, or `high`.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max"]] = None + """The quality of the image generated. - size: Optional[Literal["1024x1024", "1024x1536", "1536x1024"]] = None - """The size of the image generated. - - Either `1024x1024`, `1024x1536`, or `1536x1024`. + One of `low`, `medium`, `high`, `xhigh`, or `max`. """ + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + usage: Optional[Usage] = None """For `gpt-image-1` only, the token usage information for the image generation.""" diff --git a/src/openai/types/responses/response_input_item.py b/src/openai/types/responses/response_input_item.py index 2fad88bb39..ddb4d3b8a0 100644 --- a/src/openai/types/responses/response_input_item.py +++ b/src/openai/types/responses/response_input_item.py @@ -247,6 +247,15 @@ class ImageGenerationCall(BaseModel): type: Literal["image_generation_call"] """The type of the image generation call. Always `image_generation_call`.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(BaseModel): """Execute a shell command on the server.""" diff --git a/src/openai/types/responses/response_input_item_param.py b/src/openai/types/responses/response_input_item_param.py index db7a9350bd..47df7af7f2 100644 --- a/src/openai/types/responses/response_input_item_param.py +++ b/src/openai/types/responses/response_input_item_param.py @@ -246,6 +246,15 @@ class ImageGenerationCall(TypedDict, total=False): type: Required[Literal["image_generation_call"]] """The type of the image generation call. Always `image_generation_call`.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(TypedDict, total=False): """Execute a shell command on the server.""" diff --git a/src/openai/types/responses/response_input_param.py b/src/openai/types/responses/response_input_param.py index 982d37e23a..3aceb2c556 100644 --- a/src/openai/types/responses/response_input_param.py +++ b/src/openai/types/responses/response_input_param.py @@ -247,6 +247,15 @@ class ImageGenerationCall(TypedDict, total=False): type: Required[Literal["image_generation_call"]] """The type of the image generation call. Always `image_generation_call`.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(TypedDict, total=False): """Execute a shell command on the server.""" diff --git a/src/openai/types/responses/response_item.py b/src/openai/types/responses/response_item.py index 4d0b9a4dcc..df5bfc9885 100644 --- a/src/openai/types/responses/response_item.py +++ b/src/openai/types/responses/response_item.py @@ -108,6 +108,15 @@ class ImageGenerationCall(BaseModel): type: Literal["image_generation_call"] """The type of the image generation call. Always `image_generation_call`.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(BaseModel): """Execute a shell command on the server.""" diff --git a/src/openai/types/responses/response_output_item.py b/src/openai/types/responses/response_output_item.py index 8d9e15f929..402636062a 100644 --- a/src/openai/types/responses/response_output_item.py +++ b/src/openai/types/responses/response_output_item.py @@ -106,6 +106,15 @@ class ImageGenerationCall(BaseModel): type: Literal["image_generation_call"] """The type of the image generation call. Always `image_generation_call`.""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None + """The quality of the image generated by the image generation tool call. + + One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + """ + + size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024"], None] = None + """The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.""" + class LocalShellCallAction(BaseModel): """Execute a shell command on the server.""" diff --git a/src/openai/types/responses/tool.py b/src/openai/types/responses/tool.py index 3e815cceff..68e6d348ae 100644 --- a/src/openai/types/responses/tool.py +++ b/src/openai/types/responses/tool.py @@ -266,14 +266,17 @@ class ImageGeneration(BaseModel): """Whether to generate a new image or edit an existing image. Default: `auto`.""" background: Optional[Literal["transparent", "opaque", "auto"]] = None - """ - Allows to set transparency for the background of the generated image(s). Must be - one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, - the model will automatically determine the best background for the image. + """Allows to set transparency for the background of the generated image(s). + + Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` + is used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. """ input_fidelity: Optional[Literal["high", "low"]] = None @@ -297,6 +300,10 @@ class ImageGeneration(BaseModel): "gpt-image-1-mini", "gpt-image-2", "gpt-image-2-2026-04-21", + "gpt-image-2.5-sunburst", + "gpt-image-2.5-sunburst-2026-09-08", + "gpt-image-2.5-flare", + "gpt-image-2.5-flare-2026-09-08", "gpt-image-1.5", "chatgpt-image-latest", ], @@ -305,7 +312,10 @@ class ImageGeneration(BaseModel): """The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: `gpt-image-1`. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: + `gpt-image-1`. """ moderation: Optional[Literal["auto", "low"]] = None @@ -326,25 +336,29 @@ class ImageGeneration(BaseModel): to 3. """ - quality: Optional[Literal["low", "medium", "high", "auto"]] = None + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None """The quality of the generated image. - One of `low`, `medium`, `high`, or `auto`. Default: `auto`. + The GPT image models support `low`, `medium`, and `high`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, also support `xhigh` and `max`. Default: `auto`. """ size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"], None] = None """The size of the generated images. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are - supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height - must both be divisible by 16 and the requested aspect ratio must be between 1:3 - and 3:1. Resolutions above `2560x1440` are experimental, and the maximum - supported resolution is `3840x2160`. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes `1024x1024`, - `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, use one of - `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, - `1792x1024`, or `1024x1792`. + For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and + `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be + divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above `2560x1440` are experimental, and the maximum supported + resolution is `3840x2160`. The requested size must also satisfy the model's + current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + `1024x1536` are supported by the GPT image models; `auto` is supported for + models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, + or `1024x1792`. """ diff --git a/src/openai/types/responses/tool_param.py b/src/openai/types/responses/tool_param.py index a1fb90c8c3..860a255bda 100644 --- a/src/openai/types/responses/tool_param.py +++ b/src/openai/types/responses/tool_param.py @@ -266,14 +266,17 @@ class ImageGeneration(TypedDict, total=False): """Whether to generate a new image or edit an existing image. Default: `auto`.""" background: Literal["transparent", "opaque", "auto"] - """ - Allows to set transparency for the background of the generated image(s). Must be - one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, - the model will automatically determine the best background for the image. + """Allows to set transparency for the background of the generated image(s). + + Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` + is used, the model will automatically determine the best background for the + image. - 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`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, support `opaque` and `transparent` backgrounds. 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`. """ input_fidelity: Optional[Literal["high", "low"]] @@ -297,6 +300,10 @@ class ImageGeneration(TypedDict, total=False): "gpt-image-1-mini", "gpt-image-2", "gpt-image-2-2026-04-21", + "gpt-image-2.5-sunburst", + "gpt-image-2.5-sunburst-2026-09-08", + "gpt-image-2.5-flare", + "gpt-image-2.5-flare-2026-09-08", "gpt-image-1.5", "chatgpt-image-latest", ], @@ -304,7 +311,10 @@ class ImageGeneration(TypedDict, total=False): """The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: `gpt-image-1`. + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: + `gpt-image-1`. """ moderation: Literal["auto", "low"] @@ -325,25 +335,29 @@ class ImageGeneration(TypedDict, total=False): to 3. """ - quality: Literal["low", "medium", "high", "auto"] + quality: Literal["low", "medium", "high", "xhigh", "max", "auto"] """The quality of the generated image. - One of `low`, `medium`, `high`, or `auto`. Default: `auto`. + The GPT image models support `low`, `medium`, and `high`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, also support `xhigh` and `max`. Default: `auto`. """ size: Union[str, Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] """The size of the generated images. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are - supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height - must both be divisible by 16 and the requested aspect ratio must be between 1:3 - and 3:1. Resolutions above `2560x1440` are experimental, and the maximum - supported resolution is `3840x2160`. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes `1024x1024`, - `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is - supported for models that allow automatic sizing. For `dall-e-2`, use one of - `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, - `1792x1024`, or `1024x1792`. + For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and + `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as + `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be + divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above `2560x1440` are experimental, and the maximum supported + resolution is `3840x2160`. The requested size must also satisfy the model's + current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and + `1024x1536` are supported by the GPT image models; `auto` is supported for + models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, + `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, + or `1024x1792`. """ diff --git a/src/openai/types/webhooks/live_call_incoming_webhook_event.py b/src/openai/types/webhooks/live_call_incoming_webhook_event.py index 972265da6c..40514ddff1 100644 --- a/src/openai/types/webhooks/live_call_incoming_webhook_event.py +++ b/src/openai/types/webhooks/live_call_incoming_webhook_event.py @@ -22,9 +22,10 @@ class Data(BaseModel): """Event data payload.""" session_id: str - """The Transceiver `rtc_...` ID of the pending SIP session. + """The `live_...` ID of the pending SIP session. - The same value appears as `call_id` in `realtime.call.incoming`. + Forward this value unchanged when accepting or rejecting the call through the + Live API. """ sip_headers: List[DataSipHeader] diff --git a/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py b/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py index 47342ec8e4..bbbdffd366 100644 --- a/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py +++ b/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py @@ -24,7 +24,9 @@ class Data(BaseModel): call_id: str """The Transceiver `rtc_...` ID of the pending SIP session. - The same value appears as `session_id` in `live.call.incoming`. + The paired `live.call.incoming` event derives its `session_id` by replacing the + `rtc_` prefix with `live_`. Use the ID returned by the event with the + corresponding Realtime or Live API. """ sip_headers: List[DataSipHeader] diff --git a/tests/test_send_queue_reconnect.py b/tests/test_send_queue_reconnect.py index 9314b6a415..40492d73c8 100644 --- a/tests/test_send_queue_reconnect.py +++ b/tests/test_send_queue_reconnect.py @@ -52,6 +52,7 @@ def failing_send(data: str) -> None: assert connection._reconnect(RuntimeError("fake disconnect")) assert sent == ["aaa", "b"] assert q._bytes == 0 + assert not connection._reconnect(RuntimeError("retry budget exhausted")) @pytest.mark.parametrize( @@ -97,3 +98,4 @@ async def failing_send(data: str) -> None: assert await connection._reconnect(RuntimeError("fake disconnect")) assert sent == ["aaa", "b"] assert q._bytes == 0 + assert not await connection._reconnect(RuntimeError("retry budget exhausted"))